@company-semantics/contracts 1.12.0 → 1.13.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": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/org/index.ts CHANGED
@@ -235,6 +235,8 @@ export {
235
235
  OrgUnitMembershipListResponseSchema,
236
236
  OrgUnitPermissionsEntrySchema,
237
237
  ListOrgUnitPermissionsResponseSchema,
238
+ UpdateOrgUnitRequestSchema,
239
+ UpdateOrgUnitResponseSchema,
238
240
  } from './schemas';
239
241
  export type {
240
242
  OrgUnit,
@@ -254,4 +256,6 @@ export type {
254
256
  OrgUnitMembershipListResponse,
255
257
  OrgUnitPermissionsEntry,
256
258
  ListOrgUnitPermissionsResponse,
259
+ UpdateOrgUnitRequest,
260
+ UpdateOrgUnitResponse,
257
261
  } from './schemas';
@@ -788,6 +788,24 @@ export const ListOrgUnitPermissionsResponseSchema = z.object({
788
788
  entries: z.array(OrgUnitPermissionsEntrySchema),
789
789
  });
790
790
 
791
+ // ---------------------------------------------------------------------------
792
+ // PATCH /api/org-units/:unitId (PRD-00526)
793
+ // Request schema colocated with the response schema so the app can import
794
+ // the same shape backend validates against. This is a narrow deviation from
795
+ // ADR-CONT-044 (request schemas normally live in backend) because the
796
+ // partial-update + at-least-one-field refinement is the published promise
797
+ // consumers must satisfy.
798
+ // ---------------------------------------------------------------------------
799
+
800
+ export const UpdateOrgUnitRequestSchema = z.object({
801
+ name: z.string().min(1).max(255).optional(),
802
+ description: z.string().max(2000).nullable().optional(),
803
+ }).refine((v) => v.name !== undefined || v.description !== undefined, {
804
+ message: 'at least one of name or description must be provided',
805
+ });
806
+
807
+ export const UpdateOrgUnitResponseSchema = z.object({ unit: OrgUnitSchema });
808
+
791
809
  // --- Inferred types ---
792
810
 
793
811
  export type OrgUnit = z.infer<typeof OrgUnitSchema>;
@@ -807,3 +825,5 @@ export type OrgUnitMembershipResponse = z.infer<typeof OrgUnitMembershipResponse
807
825
  export type OrgUnitMembershipListResponse = z.infer<typeof OrgUnitMembershipListResponseSchema>;
808
826
  export type OrgUnitPermissionsEntry = z.infer<typeof OrgUnitPermissionsEntrySchema>;
809
827
  export type ListOrgUnitPermissionsResponse = z.infer<typeof ListOrgUnitPermissionsResponseSchema>;
828
+ export type UpdateOrgUnitRequest = z.infer<typeof UpdateOrgUnitRequestSchema>;
829
+ export type UpdateOrgUnitResponse = z.infer<typeof UpdateOrgUnitResponseSchema>;