@company-semantics/contracts 1.12.0 → 1.14.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.14.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 = '3c2104cecec4' as const;
3
- export const SPEC_HASH_FULL = '3c2104cecec403986da31a11310ce09d3dd773fd095b7416c0cf6f4e30d64f6c' as const;
2
+ export const SPEC_HASH = '508bfa08f5fd' as const;
3
+ export const SPEC_HASH_FULL = '508bfa08f5fdd3ae4f8d472fa9a6fd9a7dbfca1bb4b63f86c24cc1dbc2fc4cf3' as const;
@@ -1430,7 +1430,8 @@ export interface paths {
1430
1430
  delete?: never;
1431
1431
  options?: never;
1432
1432
  head?: never;
1433
- patch?: never;
1433
+ /** Update an org unit (name and/or description) */
1434
+ patch: operations["updateOrgUnit"];
1434
1435
  trace?: never;
1435
1436
  };
1436
1437
  "/api/org-units/{unitId}/children": {
@@ -2936,6 +2937,31 @@ export interface components {
2936
2937
  updatedAt: string;
2937
2938
  };
2938
2939
  };
2940
+ UpdateOrgUnitResponse: {
2941
+ unit: {
2942
+ /** Format: uuid */
2943
+ id: string;
2944
+ /** Format: uuid */
2945
+ orgId: string;
2946
+ parentId: string | null;
2947
+ slug: string;
2948
+ name: string;
2949
+ description: string | null;
2950
+ typeTag: string;
2951
+ classification: ("execution_unit" | "org_container" | "custom") | null;
2952
+ orderKey: string;
2953
+ path: string;
2954
+ /** @enum {string} */
2955
+ syncMode: "manual_only" | "synced_readonly" | "synced_with_overrides";
2956
+ visibilityDefault: ("public" | "private" | "restricted") | null;
2957
+ metadata: {
2958
+ [key: string]: unknown;
2959
+ };
2960
+ archivedAt: string | null;
2961
+ createdAt: string;
2962
+ updatedAt: string;
2963
+ };
2964
+ };
2939
2965
  OrgUnitChildrenResponse: {
2940
2966
  /** Format: uuid */
2941
2967
  parentId: string;
@@ -5522,6 +5548,35 @@ export interface operations {
5522
5548
  };
5523
5549
  };
5524
5550
  };
5551
+ updateOrgUnit: {
5552
+ parameters: {
5553
+ query?: never;
5554
+ header?: never;
5555
+ path: {
5556
+ unitId: string;
5557
+ };
5558
+ cookie?: never;
5559
+ };
5560
+ requestBody: {
5561
+ content: {
5562
+ "application/json": {
5563
+ name?: string;
5564
+ description?: string | null;
5565
+ };
5566
+ };
5567
+ };
5568
+ responses: {
5569
+ /** @description Updated org unit */
5570
+ 200: {
5571
+ headers: {
5572
+ [name: string]: unknown;
5573
+ };
5574
+ content: {
5575
+ "application/json": components["schemas"]["UpdateOrgUnitResponse"];
5576
+ };
5577
+ };
5578
+ };
5579
+ };
5525
5580
  listOrgUnitChildren: {
5526
5581
  parameters: {
5527
5582
  query?: never;
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>;