codebuff 1.0.289 → 1.0.291

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.
@@ -1385,7 +1385,7 @@ export declare const encryptedApiKeys: import("drizzle-orm/pg-core").PgTableWith
1385
1385
  tableName: "encrypted_api_keys";
1386
1386
  dataType: "string";
1387
1387
  columnType: "PgEnumColumn";
1388
- data: "anthropic" | "gemini" | "openai";
1388
+ data: "gemini" | "anthropic" | "openai";
1389
1389
  driverParam: string;
1390
1390
  notNull: true;
1391
1391
  hasDefault: false;
@@ -0,0 +1,102 @@
1
+ export type OrganizationRole = 'owner' | 'admin' | 'member';
2
+ export interface OrganizationMember {
3
+ organization_id: string;
4
+ user_id: string;
5
+ role: OrganizationRole;
6
+ joined_at: Date;
7
+ }
8
+ export interface Organization {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ description?: string;
13
+ owner_id: string;
14
+ stripe_customer_id?: string;
15
+ created_at: Date;
16
+ updated_at: Date;
17
+ }
18
+ export interface OrganizationRepository {
19
+ id: string;
20
+ organization_id: string;
21
+ repository_url: string;
22
+ repository_name: string;
23
+ approved_by: string;
24
+ approved_at: Date;
25
+ is_active: boolean;
26
+ }
27
+ export interface OrganizationUsage {
28
+ id: string;
29
+ organization_id: string;
30
+ user_id: string;
31
+ repository_url: string;
32
+ credits_used: number;
33
+ message_id?: string;
34
+ created_at: Date;
35
+ }
36
+ export interface CreateOrganizationRequest {
37
+ name: string;
38
+ slug?: string;
39
+ description?: string;
40
+ }
41
+ export interface ListOrganizationsResponse {
42
+ organizations: Array<{
43
+ id: string;
44
+ name: string;
45
+ slug: string;
46
+ role: OrganizationRole;
47
+ memberCount: number;
48
+ repositoryCount: number;
49
+ }>;
50
+ }
51
+ export interface OrganizationDetailsResponse {
52
+ id: string;
53
+ name: string;
54
+ slug: string;
55
+ description?: string;
56
+ owner_id: string;
57
+ created_at: string;
58
+ userRole: OrganizationRole;
59
+ memberCount: number;
60
+ repositoryCount: number;
61
+ creditBalance?: number;
62
+ }
63
+ export interface InviteMemberRequest {
64
+ email: string;
65
+ role: 'admin' | 'member';
66
+ }
67
+ export interface UpdateMemberRoleRequest {
68
+ role: 'admin' | 'member';
69
+ }
70
+ export interface AddRepositoryRequest {
71
+ repository_url: string;
72
+ repository_name: string;
73
+ }
74
+ export interface OrganizationUsageResponse {
75
+ currentBalance: number;
76
+ usageThisCycle: number;
77
+ topUsers: Array<{
78
+ user_id: string;
79
+ user_name: string;
80
+ credits_used: number;
81
+ }>;
82
+ recentUsage: Array<{
83
+ date: string;
84
+ credits_used: number;
85
+ repository_url: string;
86
+ user_name: string;
87
+ }>;
88
+ }
89
+ export interface CreditDelegationResult {
90
+ useOrganization: boolean;
91
+ organizationId?: string;
92
+ requiresOverride: boolean;
93
+ organizationBalance?: number;
94
+ userBalance?: number;
95
+ }
96
+ export interface CreditConsumptionWithDelegationResult {
97
+ success: boolean;
98
+ consumed: number;
99
+ fromOrganization: boolean;
100
+ organizationId?: string;
101
+ error?: string;
102
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":""}