@company-semantics/contracts 5.1.0 → 6.0.1

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": "5.1.0",
3
+ "version": "6.0.1",
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 = 'f8ecf637857f' as const;
3
- export const SPEC_HASH_FULL = 'f8ecf637857fded90a144d5a76bfa2919d3494bb0b5b78d4131e906ab4a6edf5' as const;
2
+ export const SPEC_HASH = 'cebabbf604ec' as const;
3
+ export const SPEC_HASH_FULL = 'cebabbf604eca92841bb1704c008a26709357ca85fb82664e7baad97a9840b85' as const;
@@ -1743,8 +1743,7 @@ export interface paths {
1743
1743
  delete: operations["deleteOrgUnitDelegation"];
1744
1744
  options?: never;
1745
1745
  head?: never;
1746
- /** Update the scopes of an existing delegation */
1747
- patch: operations["updateOrgUnitDelegationScopes"];
1746
+ patch?: never;
1748
1747
  trace?: never;
1749
1748
  };
1750
1749
  "/api/orgs/{orgId}/admins": {
@@ -3991,7 +3990,6 @@ export interface components {
3991
3990
  };
3992
3991
  /** Format: uuid */
3993
3992
  delegationId?: string;
3994
- scopes: ("doc.edit" | "doc.acl" | "members.manage")[];
3995
3993
  }[];
3996
3994
  }[];
3997
3995
  inherited?: {
@@ -4017,7 +4015,6 @@ export interface components {
4017
4015
  };
4018
4016
  /** Format: uuid */
4019
4017
  delegationId?: string;
4020
- scopes: ("doc.edit" | "doc.acl" | "members.manage")[];
4021
4018
  }[];
4022
4019
  }[];
4023
4020
  };
@@ -4036,7 +4033,6 @@ export interface components {
4036
4033
  /** @enum {string} */
4037
4034
  status: "active" | "revoked";
4038
4035
  note: string | null;
4039
- scopes: ("doc.edit" | "doc.acl" | "members.manage")[];
4040
4036
  };
4041
4037
  OrgAdminGrantResponse: {
4042
4038
  /** Format: uuid */
@@ -7395,7 +7391,6 @@ export interface operations {
7395
7391
  /** Format: uuid */
7396
7392
  userId: string;
7397
7393
  note?: string;
7398
- scopes?: ("doc.edit" | "doc.acl" | "members.manage")[];
7399
7394
  };
7400
7395
  };
7401
7396
  };
@@ -7432,35 +7427,6 @@ export interface operations {
7432
7427
  };
7433
7428
  };
7434
7429
  };
7435
- updateOrgUnitDelegationScopes: {
7436
- parameters: {
7437
- query?: never;
7438
- header?: never;
7439
- path: {
7440
- unitId: string;
7441
- id: string;
7442
- };
7443
- cookie?: never;
7444
- };
7445
- requestBody: {
7446
- content: {
7447
- "application/json": {
7448
- scopes: ("doc.edit" | "doc.acl" | "members.manage")[];
7449
- };
7450
- };
7451
- };
7452
- responses: {
7453
- /** @description Delegation row with updated scopes */
7454
- 200: {
7455
- headers: {
7456
- [name: string]: unknown;
7457
- };
7458
- content: {
7459
- "application/json": components["schemas"]["Delegation"];
7460
- };
7461
- };
7462
- };
7463
- };
7464
7430
  grantOrgAdmin: {
7465
7431
  parameters: {
7466
7432
  query?: never;
package/src/index.ts CHANGED
@@ -354,14 +354,11 @@ export {
354
354
  AuthorityMechanismSchema,
355
355
  AuthorityLocalitySchema,
356
356
  AuthorityMutabilitySchema,
357
- UnitAuthorityScopeSchema,
358
- ALL_UNIT_AUTHORITY_SCOPES,
359
357
  OwnerAuthoritySchema,
360
358
  OrgUnitOwnerSchema,
361
359
  OrgUnitOwnersResponseSchema,
362
360
  DelegationSchema,
363
361
  CreateDelegationRequestSchema,
364
- UpdateDelegationScopesRequestSchema,
365
362
  DelegationListResponseSchema,
366
363
  } from './org/index'
367
364
  export type {
@@ -371,13 +368,11 @@ export type {
371
368
  AuthorityMechanism,
372
369
  AuthorityLocality,
373
370
  AuthorityMutability,
374
- UnitAuthorityScope,
375
371
  OwnerAuthority,
376
372
  OrgUnitOwner,
377
373
  OrgUnitOwnersResponse,
378
374
  Delegation,
379
375
  CreateDelegationRequest,
380
- UpdateDelegationScopesRequest,
381
376
  DelegationListResponse,
382
377
  } from './org/index'
383
378
 
package/src/org/index.ts CHANGED
@@ -277,14 +277,11 @@ export {
277
277
  AuthorityMechanismSchema,
278
278
  AuthorityLocalitySchema,
279
279
  AuthorityMutabilitySchema,
280
- UnitAuthorityScopeSchema,
281
- ALL_UNIT_AUTHORITY_SCOPES,
282
280
  OwnerAuthoritySchema,
283
281
  OrgUnitOwnerSchema,
284
282
  OrgUnitOwnersResponseSchema,
285
283
  DelegationSchema,
286
284
  CreateDelegationRequestSchema,
287
- UpdateDelegationScopesRequestSchema,
288
285
  DelegationListResponseSchema,
289
286
  } from './schemas';
290
287
  export type {
@@ -294,12 +291,10 @@ export type {
294
291
  AuthorityMechanism,
295
292
  AuthorityLocality,
296
293
  AuthorityMutability,
297
- UnitAuthorityScope,
298
294
  OwnerAuthority,
299
295
  OrgUnitOwner,
300
296
  OrgUnitOwnersResponse,
301
297
  Delegation,
302
298
  CreateDelegationRequest,
303
- UpdateDelegationScopesRequest,
304
299
  DelegationListResponse,
305
300
  } from './schemas';
@@ -820,24 +820,6 @@ export type AuthorityLocality = z.infer<typeof AuthorityLocalitySchema>;
820
820
  export const AuthorityMutabilitySchema = z.enum(['derived', 'user_managed']);
821
821
  export type AuthorityMutability = z.infer<typeof AuthorityMutabilitySchema>;
822
822
 
823
- /**
824
- * Permission scopes a unit-authority grant entitles. A leader (structural or
825
- * rbac mechanism) implicitly holds all three. A delegate holds the subset
826
- * recorded on its `org_unit_delegations` row.
827
- */
828
- export const UnitAuthorityScopeSchema = z.enum([
829
- 'doc.edit',
830
- 'doc.acl',
831
- 'members.manage',
832
- ]);
833
- export type UnitAuthorityScope = z.infer<typeof UnitAuthorityScopeSchema>;
834
-
835
- export const ALL_UNIT_AUTHORITY_SCOPES: readonly UnitAuthorityScope[] = [
836
- 'doc.edit',
837
- 'doc.acl',
838
- 'members.manage',
839
- ];
840
-
841
823
  export const OwnerAuthoritySchema = z.object({
842
824
  mechanism: AuthorityMechanismSchema,
843
825
  locality: AuthorityLocalitySchema,
@@ -862,12 +844,6 @@ export const OwnerAuthoritySchema = z.object({
862
844
  * the revoke action.
863
845
  */
864
846
  delegationId: z.string().uuid().optional(),
865
- /**
866
- * Scopes this authority entitles. Derived mechanisms (structural, rbac) hold
867
- * the full set; delegated authorities hold the subset stored on the
868
- * delegation row. Non-empty.
869
- */
870
- scopes: z.array(UnitAuthorityScopeSchema).min(1),
871
847
  });
872
848
  export type OwnerAuthority = z.infer<typeof OwnerAuthoritySchema>;
873
849
 
@@ -910,28 +886,15 @@ export const DelegationSchema = z.object({
910
886
  revokedAt: z.string().nullable(),
911
887
  status: z.enum(['active', 'revoked']),
912
888
  note: z.string().nullable(),
913
- scopes: z.array(UnitAuthorityScopeSchema).min(1),
914
889
  });
915
890
  export type Delegation = z.infer<typeof DelegationSchema>;
916
891
 
917
892
  export const CreateDelegationRequestSchema = z.object({
918
893
  userId: z.string().uuid(),
919
894
  note: z.string().max(2000).optional(),
920
- /**
921
- * Optional. Omit to grant the full leader-equivalent scope set.
922
- * Provide a non-empty subset to narrow the delegation (e.g. doc edit only).
923
- */
924
- scopes: z.array(UnitAuthorityScopeSchema).min(1).optional(),
925
895
  });
926
896
  export type CreateDelegationRequest = z.infer<typeof CreateDelegationRequestSchema>;
927
897
 
928
- export const UpdateDelegationScopesRequestSchema = z.object({
929
- scopes: z.array(UnitAuthorityScopeSchema).min(1),
930
- });
931
- export type UpdateDelegationScopesRequest = z.infer<
932
- typeof UpdateDelegationScopesRequestSchema
933
- >;
934
-
935
898
  export const DelegationListResponseSchema = z.object({
936
899
  delegations: z.array(DelegationSchema),
937
900
  });