@company-semantics/contracts 0.115.1 → 0.116.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": "0.115.1",
3
+ "version": "0.116.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,6 +48,10 @@
48
48
  "types": "./src/chat/index.ts",
49
49
  "default": "./src/chat/index.ts"
50
50
  },
51
+ "./api": {
52
+ "types": "./src/api/index.ts",
53
+ "default": "./src/api/index.ts"
54
+ },
51
55
  "./schemas/guard-result.schema.json": "./schemas/guard-result.schema.json"
52
56
  },
53
57
  "types": "./src/index.ts",
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = '44201100a1da' as const;
3
- export const SPEC_HASH_FULL = '44201100a1da5085404efb94d34655031cb30cfd468853e9d8b9ac1de722976c' as const;
2
+ export const SPEC_HASH = 'd4f412a26098' as const;
3
+ export const SPEC_HASH_FULL = 'd4f412a26098e42f4578da215bc71e3960ed6850e2482e8de7c1a38f785c2cf6' as const;
@@ -2244,18 +2244,26 @@ export interface components {
2244
2244
  MeResponse: {
2245
2245
  /** Format: uuid */
2246
2246
  userId: string;
2247
- firstName: string;
2248
- lastName?: string | null;
2247
+ /** Format: email */
2248
+ email: string;
2249
2249
  fullName: string;
2250
2250
  preferredName?: string | null;
2251
- /** @description Computed at read time (preferredName ?? firstName) */
2251
+ /** @description Computed at read time (preferredName ?? fullName) */
2252
2252
  displayName: string;
2253
+ /** @enum {string} */
2254
+ nameSource: "self" | "sso";
2255
+ nameEditable: boolean;
2256
+ primaryDepartmentId: string | null;
2257
+ slackUserId: string | null;
2258
+ avatar: components["schemas"]["ResolvedAvatar"];
2253
2259
  /** Format: uuid */
2254
2260
  orgId: string;
2255
- orgName?: string | null;
2261
+ orgName: string | null;
2256
2262
  orgSlug: string;
2257
2263
  /** @enum {string} */
2258
2264
  plan: "free" | "pro" | "enterprise";
2265
+ hasMultipleOrgs: boolean;
2266
+ isInternalAdmin: boolean;
2259
2267
  };
2260
2268
  /** @description At least one field must be provided */
2261
2269
  ProfileUpdateRequest: {
@@ -2905,6 +2913,7 @@ export interface components {
2905
2913
  id: string;
2906
2914
  name: string;
2907
2915
  type: components["schemas"]["OrgType"];
2916
+ logoUrl: string | null;
2908
2917
  owner: {
2909
2918
  /** Format: uuid */
2910
2919
  id: string;
package/src/api/index.ts CHANGED
@@ -10,3 +10,7 @@ export type { paths, components, operations } from './generated'
10
10
 
11
11
  // Spec hash (from openapi/backend.yaml SHA-256)
12
12
  export { SPEC_HASH, SPEC_HASH_FULL } from './generated-spec-hash'
13
+
14
+ // Reusable API primitive schemas (CursorPage, ErrorResponse)
15
+ export { CursorPageSchema, ErrorResponseSchema } from './primitives'
16
+ export type { CursorPage, ErrorResponse } from './primitives'
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+
3
+ /** Generic factory for cursor-paginated responses. */
4
+ export function CursorPageSchema<T extends z.ZodTypeAny>(itemSchema: T) {
5
+ return z.object({
6
+ items: z.array(itemSchema),
7
+ nextCursor: z.string().nullable(),
8
+ hasMore: z.boolean(),
9
+ });
10
+ }
11
+
12
+ /** Standard error envelope — matches backend StandardErrorResponse. */
13
+ export const ErrorResponseSchema = z.object({
14
+ error: z.object({
15
+ code: z.string(),
16
+ message: z.string(),
17
+ retryable: z.boolean(),
18
+ }),
19
+ });
20
+
21
+ // Inferred types
22
+ export type CursorPage<T> = { items: T[]; nextCursor: string | null; hasMore: boolean };
23
+ export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;