@company-semantics/contracts 30.0.0 → 32.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": "30.0.0",
3
+ "version": "32.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -125,13 +125,13 @@
125
125
  "zod": "^4.4.3"
126
126
  },
127
127
  "devDependencies": {
128
- "@types/node": "^22.20.0",
128
+ "@types/node": "^26.1.1",
129
129
  "husky": "^9.1.7",
130
130
  "lint-staged": "^17.0.8",
131
131
  "markdownlint-cli2": "^0.23.0",
132
132
  "openapi-typescript": "^7.13.0",
133
- "prettier": "^3.9.4",
134
- "tsx": "^4.23.0",
133
+ "prettier": "^3.9.5",
134
+ "tsx": "^4.23.1",
135
135
  "typescript": "^5.8.3",
136
136
  "vitest": "^4.1.10",
137
137
  "yaml": "^2.9.0"
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = '43cd15935d12' as const;
3
- export const SPEC_HASH_FULL = '43cd15935d1232049463ee9ed6c4e833b6e012906cfc46644157aaaa310b895b' as const;
2
+ export const SPEC_HASH = 'f12a9039164d' as const;
3
+ export const SPEC_HASH_FULL = 'f12a9039164d9b743f154e65127c54971b513ed58f3f7f0e49a25397961de8d3' as const;
@@ -4667,14 +4667,8 @@ export interface components {
4667
4667
  grantedAt: string;
4668
4668
  }[];
4669
4669
  effectiveAccess: {
4670
- /** @enum {string} */
4671
- level: "none" | "viewer" | "commenter" | "editor";
4672
- reasons: {
4673
- /** @enum {string} */
4674
- source: "org_rbac" | "sharing_policy" | "unit_baseline" | "unit_delegation" | "acl_grant" | "doc_ownership";
4675
- detail: string;
4676
- }[];
4677
- canShare: boolean;
4670
+ access_level: ("meta" | "owner" | "editor" | "commenter" | "viewer") | null;
4671
+ source_chain: ("explicit" | "ownership" | "visibility" | "inheritance" | "authority" | "context_association" | "migration")[];
4678
4672
  };
4679
4673
  };
4680
4674
  UpdateCompanyMdSharingPolicyRequest: {
@@ -5657,7 +5651,7 @@ export interface components {
5657
5651
  /** @enum {string} */
5658
5652
  access_level: "meta" | "owner" | "editor" | "commenter" | "viewer";
5659
5653
  /** @enum {string} */
5660
- source: "explicit" | "ownership" | "visibility" | "inheritance" | "migration";
5654
+ source: "explicit" | "ownership" | "visibility" | "inheritance" | "authority" | "context_association" | "migration";
5661
5655
  }[];
5662
5656
  };
5663
5657
  RecentDecisionsResponse: {
@@ -5671,7 +5665,7 @@ export interface components {
5671
5665
  actor_user_id: string | null;
5672
5666
  allow: boolean;
5673
5667
  reason: string;
5674
- source_chain: ("explicit" | "ownership" | "visibility" | "inheritance" | "migration")[];
5668
+ source_chain: ("explicit" | "ownership" | "visibility" | "inheritance" | "authority" | "context_association" | "migration")[];
5675
5669
  /** Format: date-time */
5676
5670
  decided_at: string;
5677
5671
  }[];
@@ -5684,7 +5678,7 @@ export interface components {
5684
5678
  /** @enum {string} */
5685
5679
  access_level: "meta" | "owner" | "editor" | "commenter" | "viewer";
5686
5680
  /** @enum {string} */
5687
- source: "explicit" | "ownership" | "visibility" | "inheritance" | "migration";
5681
+ source: "explicit" | "ownership" | "visibility" | "inheritance" | "authority" | "context_association" | "migration";
5688
5682
  }[];
5689
5683
  };
5690
5684
  FloorResponse: {
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { z } from "zod";
13
13
  import { CursorPageSchema } from "../api/primitives";
14
+ import { EffectiveAccessResponseSchema } from "../permissions/share-api";
14
15
 
15
16
  // ---------------------------------------------------------------------------
16
17
  // Company.md Sub-schemas
@@ -197,29 +198,17 @@ const AclEntrySchema = z.object({
197
198
  grantedAt: z.string(),
198
199
  });
199
200
 
200
- const AccessReasonSchema = z.object({
201
- source: z.enum([
202
- "org_rbac",
203
- "sharing_policy",
204
- "unit_baseline",
205
- "unit_delegation",
206
- "acl_grant",
207
- "doc_ownership",
208
- ]),
209
- detail: z.string(),
210
- });
211
-
212
- const EffectiveAccessSchema = z.object({
213
- level: z.enum(["none", "viewer", "commenter", "editor"]),
214
- reasons: z.array(AccessReasonSchema),
215
- canShare: z.boolean(),
216
- });
217
-
218
- /** Response for GET /api/company-md/docs/:slug/sharing */
201
+ /** Response for GET /api/company-md/docs/:id/sharing.
202
+ *
203
+ * `effectiveAccess` is the ONE authority's projection answer
204
+ * ({@link EffectiveAccessResponseSchema}: nullable `access_level` +
205
+ * `source_chain`). The legacy `EffectiveAccess` shape (`level` / `reasons` /
206
+ * `canShare`) was removed with `CompanyMdAccessEvaluator` (ADR-BE-392 /
207
+ * ADR-CONTRACTS-082). */
219
208
  export const CompanyMdShareResponseSchema = z.object({
220
209
  sharingPolicy: z.enum(["restricted", "org_read", "org_comment", "org_edit"]),
221
210
  acl: z.array(AclEntrySchema),
222
- effectiveAccess: EffectiveAccessSchema,
211
+ effectiveAccess: EffectiveAccessResponseSchema,
223
212
  });
224
213
 
225
214
  // ---------------------------------------------------------------------------
@@ -10,7 +10,7 @@ describe("EMAIL_KINDS golden snapshot", () => {
10
10
  expect(EMAIL_KINDS).toStrictEqual({
11
11
  "auth.otp": {
12
12
  kind: "auth.otp",
13
- subject: "Your login code",
13
+ subject: "Your login code for Company Semantics",
14
14
  plainTextRequired: true,
15
15
  htmlSupported: false,
16
16
  },
@@ -22,13 +22,13 @@ describe("EMAIL_KINDS golden snapshot", () => {
22
22
  },
23
23
  "org.invite": {
24
24
  kind: "org.invite",
25
- subject: "You have been invited to join a workspace",
25
+ subject: "You've been invited to join {orgName} on Company Semantics",
26
26
  plainTextRequired: true,
27
27
  htmlSupported: true,
28
28
  },
29
29
  "org.unit_owner_granted": {
30
30
  kind: "org.unit_owner_granted",
31
- subject: "You've been added to a team",
31
+ subject: "You've been added as {roleWord} to {unitName} in {orgName}",
32
32
  plainTextRequired: true,
33
33
  htmlSupported: true,
34
34
  },
@@ -32,7 +32,9 @@ import type { EmailKind } from "./types";
32
32
  export interface EmailKindDefinition {
33
33
  /** The email kind this definition describes */
34
34
  kind: EmailKind;
35
- /** Email subject line (single source of truth) */
35
+ /** Email subject line (single source of truth). May contain `{field}`
36
+ * placeholders that `renderEmail` fills from the payload (e.g. `{orgName}`);
37
+ * an unmatched placeholder is left verbatim. */
36
38
  subject: string;
37
39
  /** Whether plain text body is required */
38
40
  plainTextRequired: boolean;
@@ -60,7 +62,7 @@ export interface EmailKindDefinition {
60
62
  export const EMAIL_KINDS = {
61
63
  "auth.otp": {
62
64
  kind: "auth.otp",
63
- subject: "Your login code",
65
+ subject: "Your login code for Company Semantics",
64
66
  plainTextRequired: true,
65
67
  htmlSupported: false,
66
68
  },
@@ -72,13 +74,13 @@ export const EMAIL_KINDS = {
72
74
  },
73
75
  "org.invite": {
74
76
  kind: "org.invite",
75
- subject: "You have been invited to join a workspace",
77
+ subject: "You've been invited to join {orgName} on Company Semantics",
76
78
  plainTextRequired: true,
77
79
  htmlSupported: true,
78
80
  },
79
81
  "org.unit_owner_granted": {
80
82
  kind: "org.unit_owner_granted",
81
- subject: "You've been added to a team",
83
+ subject: "You've been added as {roleWord} to {unitName} in {orgName}",
82
84
  plainTextRequired: true,
83
85
  htmlSupported: true,
84
86
  },