@company-semantics/contracts 29.0.0 → 31.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/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +5 -11
- package/src/content/schemas.ts +9 -20
- package/src/email/render/__tests__/__snapshots__/render-snapshot.test.ts.snap +199 -224
- package/src/email/render/blocks.ts +33 -24
- package/src/email/render/company-md-access-requested.ts +1 -1
- package/src/email/render/ownership-transfer.ts +1 -1
- package/src/email/render/share-granted.ts +1 -1
- package/src/email/render/unit-owner-granted.ts +1 -1
- package/src/index.ts +4 -6
- package/src/org/README.md +0 -5
- package/src/org/index.ts +5 -6
- package/src/org/sharing.ts +15 -69
package/package.json
CHANGED
|
@@ -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 = 'f12a9039164d' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = 'f12a9039164d9b743f154e65127c54971b513ed58f3f7f0e49a25397961de8d3' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -4667,14 +4667,8 @@ export interface components {
|
|
|
4667
4667
|
grantedAt: string;
|
|
4668
4668
|
}[];
|
|
4669
4669
|
effectiveAccess: {
|
|
4670
|
-
|
|
4671
|
-
|
|
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: {
|
package/src/content/schemas.ts
CHANGED
|
@@ -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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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:
|
|
211
|
+
effectiveAccess: EffectiveAccessResponseSchema,
|
|
223
212
|
});
|
|
224
213
|
|
|
225
214
|
// ---------------------------------------------------------------------------
|