@company-semantics/contracts 1.9.0 → 1.10.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,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 = '491b4248b151' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '491b4248b151c9d176a7f2ff3cff06381302277360bfc766e8cd79b2b96bac28' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1553,7 +1553,7 @@ export interface paths {
|
|
|
1553
1553
|
patch?: never;
|
|
1554
1554
|
trace?: never;
|
|
1555
1555
|
};
|
|
1556
|
-
"/api/
|
|
1556
|
+
"/api/org-units/tree": {
|
|
1557
1557
|
parameters: {
|
|
1558
1558
|
query?: never;
|
|
1559
1559
|
header?: never;
|
|
@@ -1561,7 +1561,7 @@ export interface paths {
|
|
|
1561
1561
|
cookie?: never;
|
|
1562
1562
|
};
|
|
1563
1563
|
/** Get the org tree (path-ordered snapshot) with level labels */
|
|
1564
|
-
get: operations["
|
|
1564
|
+
get: operations["getOrgUnitsTree"];
|
|
1565
1565
|
put?: never;
|
|
1566
1566
|
post?: never;
|
|
1567
1567
|
delete?: never;
|
|
@@ -3112,7 +3112,8 @@ export interface components {
|
|
|
3112
3112
|
/** Format: uuid */
|
|
3113
3113
|
orgId: string;
|
|
3114
3114
|
depth: number;
|
|
3115
|
-
label: string;
|
|
3115
|
+
label: string | null;
|
|
3116
|
+
icon: ("city" | "buildings" | "users-four" | "users-three" | "users") | null;
|
|
3116
3117
|
createdAt: string;
|
|
3117
3118
|
updatedAt: string;
|
|
3118
3119
|
}[];
|
|
@@ -3122,7 +3123,8 @@ export interface components {
|
|
|
3122
3123
|
/** Format: uuid */
|
|
3123
3124
|
orgId: string;
|
|
3124
3125
|
depth: number;
|
|
3125
|
-
label: string;
|
|
3126
|
+
label: string | null;
|
|
3127
|
+
icon: ("city" | "buildings" | "users-four" | "users-three" | "users") | null;
|
|
3126
3128
|
createdAt: string;
|
|
3127
3129
|
updatedAt: string;
|
|
3128
3130
|
}[];
|
|
@@ -5728,13 +5730,11 @@ export interface operations {
|
|
|
5728
5730
|
};
|
|
5729
5731
|
};
|
|
5730
5732
|
};
|
|
5731
|
-
|
|
5733
|
+
getOrgUnitsTree: {
|
|
5732
5734
|
parameters: {
|
|
5733
5735
|
query?: never;
|
|
5734
5736
|
header?: never;
|
|
5735
|
-
path
|
|
5736
|
-
orgId: string;
|
|
5737
|
-
};
|
|
5737
|
+
path?: never;
|
|
5738
5738
|
cookie?: never;
|
|
5739
5739
|
};
|
|
5740
5740
|
requestBody?: never;
|
|
@@ -5786,7 +5786,9 @@ export interface operations {
|
|
|
5786
5786
|
"application/json": {
|
|
5787
5787
|
entries: {
|
|
5788
5788
|
depth: number;
|
|
5789
|
-
label
|
|
5789
|
+
label?: string;
|
|
5790
|
+
/** @enum {string} */
|
|
5791
|
+
icon: "city" | "buildings" | "users-four" | "users-three" | "users";
|
|
5790
5792
|
}[];
|
|
5791
5793
|
};
|
|
5792
5794
|
};
|
|
@@ -128,17 +128,24 @@ describe('OrgUnitRelationshipSchema', () => {
|
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
describe('OrgLevelConfigSchema', () => {
|
|
131
|
-
it('enforces depth 1..5
|
|
131
|
+
it('enforces depth 1..5, non-empty-when-present label, and icon enum', () => {
|
|
132
132
|
const entry = {
|
|
133
133
|
orgId: UUID_B,
|
|
134
134
|
depth: 2,
|
|
135
135
|
label: 'Department',
|
|
136
|
+
icon: 'users-four' as const,
|
|
136
137
|
createdAt: '2026-04-17T00:00:00Z',
|
|
137
138
|
updatedAt: '2026-04-17T00:00:00Z',
|
|
138
139
|
};
|
|
139
140
|
expect(() => OrgLevelConfigSchema.parse(entry)).not.toThrow();
|
|
141
|
+
expect(() =>
|
|
142
|
+
OrgLevelConfigSchema.parse({ ...entry, label: null, icon: null })
|
|
143
|
+
).not.toThrow();
|
|
140
144
|
expect(() => OrgLevelConfigSchema.parse({ ...entry, depth: 6 })).toThrow();
|
|
141
145
|
expect(() => OrgLevelConfigSchema.parse({ ...entry, label: '' })).toThrow();
|
|
146
|
+
expect(() =>
|
|
147
|
+
OrgLevelConfigSchema.parse({ ...entry, icon: 'not-an-icon' })
|
|
148
|
+
).toThrow();
|
|
142
149
|
});
|
|
143
150
|
});
|
|
144
151
|
|
package/src/org/index.ts
CHANGED
|
@@ -222,6 +222,7 @@ export {
|
|
|
222
222
|
OrgUnitMembershipSchema,
|
|
223
223
|
OrgUnitRelationshipSchema,
|
|
224
224
|
OrgLevelConfigSchema,
|
|
225
|
+
OrgLevelIconSchema,
|
|
225
226
|
OrgUnitResponseSchema,
|
|
226
227
|
OrgUnitTreeResponseSchema,
|
|
227
228
|
OrgUnitChildrenResponseSchema,
|
|
@@ -240,6 +241,7 @@ export type {
|
|
|
240
241
|
OrgUnitMembership,
|
|
241
242
|
OrgUnitRelationship,
|
|
242
243
|
OrgLevelConfig,
|
|
244
|
+
OrgLevelIcon,
|
|
243
245
|
OrgUnitResponse,
|
|
244
246
|
OrgUnitTreeResponse,
|
|
245
247
|
OrgUnitChildrenResponse,
|
package/src/org/schemas.ts
CHANGED
|
@@ -707,10 +707,19 @@ export const OrgUnitRelationshipSchema = z.object({
|
|
|
707
707
|
createdAt: z.string(),
|
|
708
708
|
});
|
|
709
709
|
|
|
710
|
+
export const OrgLevelIconSchema = z.enum([
|
|
711
|
+
'city',
|
|
712
|
+
'buildings',
|
|
713
|
+
'users-four',
|
|
714
|
+
'users-three',
|
|
715
|
+
'users',
|
|
716
|
+
]);
|
|
717
|
+
|
|
710
718
|
export const OrgLevelConfigSchema = z.object({
|
|
711
719
|
orgId: z.string().uuid(),
|
|
712
720
|
depth: z.number().int().min(1).max(5),
|
|
713
|
-
label: z.string().min(1),
|
|
721
|
+
label: z.string().min(1).nullable(),
|
|
722
|
+
icon: OrgLevelIconSchema.nullable(),
|
|
714
723
|
createdAt: z.string(),
|
|
715
724
|
updatedAt: z.string(),
|
|
716
725
|
});
|
|
@@ -785,6 +794,7 @@ export type OrgUnitTreeNode = z.infer<typeof OrgUnitTreeNodeSchema>;
|
|
|
785
794
|
export type OrgUnitMembership = z.infer<typeof OrgUnitMembershipSchema>;
|
|
786
795
|
export type OrgUnitRelationship = z.infer<typeof OrgUnitRelationshipSchema>;
|
|
787
796
|
export type OrgLevelConfig = z.infer<typeof OrgLevelConfigSchema>;
|
|
797
|
+
export type OrgLevelIcon = z.infer<typeof OrgLevelIconSchema>;
|
|
788
798
|
export type OrgUnitResponse = z.infer<typeof OrgUnitResponseSchema>;
|
|
789
799
|
export type OrgUnitTreeResponse = z.infer<typeof OrgUnitTreeResponseSchema>;
|
|
790
800
|
export type OrgUnitChildrenResponse = z.infer<typeof OrgUnitChildrenResponseSchema>;
|