@company-semantics/contracts 5.1.0 → 6.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": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
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
  });