@teardown/types 0.1.49 → 2.0.27

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": "@teardown/types",
3
- "version": "0.1.49",
3
+ "version": "2.0.27",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -45,10 +45,13 @@
45
45
  "lint": "bun x biome lint --write ./src",
46
46
  "check": "bun x biome check ./src"
47
47
  },
48
+ "dependencies": {
49
+ "@teardown/db": "0.0.1"
50
+ },
48
51
  "devDependencies": {
49
- "@biomejs/biome": "2.3.8",
50
- "@teardown/tsconfig": "0.1.49",
51
- "@types/bun": "1.3.4"
52
+ "@biomejs/biome": "2.3.10",
53
+ "@teardown/tsconfig": "2.0.27",
54
+ "@types/bun": "1.3.5"
52
55
  },
53
56
  "peerDependencies": {
54
57
  "typescript": "5.9.3"
@@ -1,3 +1,22 @@
1
+ export enum DaytonaSandboxStatusEnum {
2
+ CREATING = "CREATING",
3
+ STARTED = "STARTED",
4
+ STOPPED = "STOPPED",
5
+ ARCHIVED = "ARCHIVED",
6
+ ERROR = "ERROR",
7
+ DELETED = "DELETED",
8
+ }
9
+
10
+ export enum DevServerInstanceStatusEnum {
11
+ CREATING = "CREATING",
12
+ DEPLOYING = "DEPLOYING",
13
+ RUNNING = "RUNNING",
14
+ STOPPING = "STOPPING",
15
+ STOPPED = "STOPPED",
16
+ ERROR = "ERROR",
17
+ DESTROYED = "DESTROYED",
18
+ }
19
+
1
20
  export enum DevicePlatformEnum {
2
21
  IOS = "IOS",
3
22
  ANDROID = "ANDROID",
@@ -23,6 +42,19 @@ export enum EnvironmentTypeEnum {
23
42
  PRODUCTION = "PRODUCTION",
24
43
  }
25
44
 
45
+ export enum InvestorAccessStatusEnum {
46
+ PENDING = "PENDING",
47
+ APPROVED = "APPROVED",
48
+ REJECTED = "REJECTED",
49
+ }
50
+
51
+ export enum MessageRoleEnum {
52
+ USER = "USER",
53
+ ASSISTANT = "ASSISTANT",
54
+ SYSTEM = "SYSTEM",
55
+ TOOL = "TOOL",
56
+ }
57
+
26
58
  export enum OrgInvitationStatusEnum {
27
59
  PENDING = "PENDING",
28
60
  ACCEPTED = "ACCEPTED",
@@ -68,6 +100,20 @@ export enum ProjectVersionStatusEnum {
68
100
  UPDATE_REQUIRED = "UPDATE_REQUIRED",
69
101
  }
70
102
 
103
+ export enum SandboxScopeEnum {
104
+ PROJECT = "PROJECT",
105
+ ORG = "ORG",
106
+ PERSONAL = "PERSONAL",
107
+ }
108
+
109
+ export enum SandboxStatusEnum {
110
+ CREATING = "CREATING",
111
+ RUNNING = "RUNNING",
112
+ PAUSED = "PAUSED",
113
+ TERMINATED = "TERMINATED",
114
+ ERROR = "ERROR",
115
+ }
116
+
71
117
  export enum SubscriptionStatusEnum {
72
118
  ACTIVE = "ACTIVE",
73
119
  PAST_DUE = "PAST_DUE",
@@ -10,10 +10,152 @@ export type Database = {
10
10
  // Allows to automatically instantiate createClient with right options
11
11
  // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
12
12
  __InternalSupabase: {
13
- PostgrestVersion: "13.0.5"
13
+ PostgrestVersion: "14.1"
14
14
  }
15
15
  public: {
16
16
  Tables: {
17
+ dashboard_user_sessions: {
18
+ Row: {
19
+ created_at: string
20
+ id: string
21
+ last_activity_at: string
22
+ started_at: string
23
+ user_agent: string | null
24
+ user_id: string
25
+ }
26
+ Insert: {
27
+ created_at?: string
28
+ id?: string
29
+ last_activity_at?: string
30
+ started_at?: string
31
+ user_agent?: string | null
32
+ user_id: string
33
+ }
34
+ Update: {
35
+ created_at?: string
36
+ id?: string
37
+ last_activity_at?: string
38
+ started_at?: string
39
+ user_agent?: string | null
40
+ user_id?: string
41
+ }
42
+ Relationships: []
43
+ }
44
+ daytona_sandboxes: {
45
+ Row: {
46
+ auto_stop_interval: number
47
+ created_at: string
48
+ daytona_sandbox_id: string
49
+ deleted_at: string | null
50
+ env_vars: Json
51
+ error_reason: string | null
52
+ id: string
53
+ is_recoverable: boolean
54
+ labels: Json
55
+ language: string
56
+ name: string
57
+ project_id: string
58
+ status: Database["public"]["Enums"]["daytona_sandbox_status"]
59
+ updated_at: string
60
+ user_id: string
61
+ }
62
+ Insert: {
63
+ auto_stop_interval?: number
64
+ created_at?: string
65
+ daytona_sandbox_id: string
66
+ deleted_at?: string | null
67
+ env_vars?: Json
68
+ error_reason?: string | null
69
+ id?: string
70
+ is_recoverable?: boolean
71
+ labels?: Json
72
+ language?: string
73
+ name: string
74
+ project_id: string
75
+ status?: Database["public"]["Enums"]["daytona_sandbox_status"]
76
+ updated_at?: string
77
+ user_id: string
78
+ }
79
+ Update: {
80
+ auto_stop_interval?: number
81
+ created_at?: string
82
+ daytona_sandbox_id?: string
83
+ deleted_at?: string | null
84
+ env_vars?: Json
85
+ error_reason?: string | null
86
+ id?: string
87
+ is_recoverable?: boolean
88
+ labels?: Json
89
+ language?: string
90
+ name?: string
91
+ project_id?: string
92
+ status?: Database["public"]["Enums"]["daytona_sandbox_status"]
93
+ updated_at?: string
94
+ user_id?: string
95
+ }
96
+ Relationships: [
97
+ {
98
+ foreignKeyName: "daytona_sandboxes_project_id_fkey"
99
+ columns: ["project_id"]
100
+ isOneToOne: false
101
+ referencedRelation: "projects"
102
+ referencedColumns: ["id"]
103
+ },
104
+ ]
105
+ }
106
+ dev_server_instances: {
107
+ Row: {
108
+ created_at: string
109
+ destroyed_at: string | null
110
+ domain: string | null
111
+ id: string
112
+ name: string
113
+ project_id: string
114
+ railway_deployment_id: string | null
115
+ railway_service_id: string
116
+ session_metadata: Json | null
117
+ status: Database["public"]["Enums"]["dev_server_instance_status"]
118
+ updated_at: string
119
+ user_id: string
120
+ }
121
+ Insert: {
122
+ created_at?: string
123
+ destroyed_at?: string | null
124
+ domain?: string | null
125
+ id?: string
126
+ name: string
127
+ project_id: string
128
+ railway_deployment_id?: string | null
129
+ railway_service_id: string
130
+ session_metadata?: Json | null
131
+ status?: Database["public"]["Enums"]["dev_server_instance_status"]
132
+ updated_at?: string
133
+ user_id: string
134
+ }
135
+ Update: {
136
+ created_at?: string
137
+ destroyed_at?: string | null
138
+ domain?: string | null
139
+ id?: string
140
+ name?: string
141
+ project_id?: string
142
+ railway_deployment_id?: string | null
143
+ railway_service_id?: string
144
+ session_metadata?: Json | null
145
+ status?: Database["public"]["Enums"]["dev_server_instance_status"]
146
+ updated_at?: string
147
+ user_id?: string
148
+ }
149
+ Relationships: [
150
+ {
151
+ foreignKeyName: "dev_server_instances_project_id_fkey"
152
+ columns: ["project_id"]
153
+ isOneToOne: false
154
+ referencedRelation: "projects"
155
+ referencedColumns: ["id"]
156
+ },
157
+ ]
158
+ }
17
159
  device_sessions: {
18
160
  Row: {
19
161
  build_number: number
@@ -518,6 +660,98 @@ export type Database = {
518
660
  },
519
661
  ]
520
662
  }
663
+ investor_access: {
664
+ Row: {
665
+ created_at: string
666
+ granted_at: string | null
667
+ granted_by: string | null
668
+ id: string
669
+ revoked_at: string | null
670
+ status: Database["public"]["Enums"]["investor_access_status"]
671
+ updated_at: string
672
+ user_id: string
673
+ }
674
+ Insert: {
675
+ created_at?: string
676
+ granted_at?: string | null
677
+ granted_by?: string | null
678
+ id?: string
679
+ revoked_at?: string | null
680
+ status?: Database["public"]["Enums"]["investor_access_status"]
681
+ updated_at?: string
682
+ user_id: string
683
+ }
684
+ Update: {
685
+ created_at?: string
686
+ granted_at?: string | null
687
+ granted_by?: string | null
688
+ id?: string
689
+ revoked_at?: string | null
690
+ status?: Database["public"]["Enums"]["investor_access_status"]
691
+ updated_at?: string
692
+ user_id?: string
693
+ }
694
+ Relationships: []
695
+ }
696
+ launchpad_github_repositories: {
697
+ Row: {
698
+ clone_url: string
699
+ created_at: string
700
+ created_by_user_id: string
701
+ default_branch: string
702
+ full_name: string
703
+ html_url: string
704
+ id: string
705
+ name: string
706
+ owner: string
707
+ private: boolean
708
+ project_id: string
709
+ repository_id: number
710
+ ssh_url: string
711
+ updated_at: string
712
+ }
713
+ Insert: {
714
+ clone_url: string
715
+ created_at?: string
716
+ created_by_user_id: string
717
+ default_branch?: string
718
+ full_name: string
719
+ html_url: string
720
+ id?: string
721
+ name: string
722
+ owner: string
723
+ private?: boolean
724
+ project_id: string
725
+ repository_id: number
726
+ ssh_url: string
727
+ updated_at?: string
728
+ }
729
+ Update: {
730
+ clone_url?: string
731
+ created_at?: string
732
+ created_by_user_id?: string
733
+ default_branch?: string
734
+ full_name?: string
735
+ html_url?: string
736
+ id?: string
737
+ name?: string
738
+ owner?: string
739
+ private?: boolean
740
+ project_id?: string
741
+ repository_id?: number
742
+ ssh_url?: string
743
+ updated_at?: string
744
+ }
745
+ Relationships: [
746
+ {
747
+ foreignKeyName: "launchpad_github_repositories_project_id_fkey"
748
+ columns: ["project_id"]
749
+ isOneToOne: true
750
+ referencedRelation: "projects"
751
+ referencedColumns: ["id"]
752
+ },
753
+ ]
754
+ }
521
755
  org_api_keys: {
522
756
  Row: {
523
757
  created_at: string
@@ -903,6 +1137,41 @@ export type Database = {
903
1137
  },
904
1138
  ]
905
1139
  }
1140
+ railway_project_configs: {
1141
+ Row: {
1142
+ created_at: string
1143
+ id: string
1144
+ project_id: string
1145
+ railway_environment_id: string
1146
+ railway_project_id: string
1147
+ updated_at: string
1148
+ }
1149
+ Insert: {
1150
+ created_at?: string
1151
+ id?: string
1152
+ project_id: string
1153
+ railway_environment_id: string
1154
+ railway_project_id: string
1155
+ updated_at?: string
1156
+ }
1157
+ Update: {
1158
+ created_at?: string
1159
+ id?: string
1160
+ project_id?: string
1161
+ railway_environment_id?: string
1162
+ railway_project_id?: string
1163
+ updated_at?: string
1164
+ }
1165
+ Relationships: [
1166
+ {
1167
+ foreignKeyName: "railway_project_configs_project_id_fkey"
1168
+ columns: ["project_id"]
1169
+ isOneToOne: true
1170
+ referencedRelation: "projects"
1171
+ referencedColumns: ["id"]
1172
+ },
1173
+ ]
1174
+ }
906
1175
  subscription_usage: {
907
1176
  Row: {
908
1177
  created_at: string
@@ -1117,6 +1386,15 @@ export type Database = {
1117
1386
  isSetofReturn: false
1118
1387
  }
1119
1388
  }
1389
+ get_admin_user_stats: {
1390
+ Args: { exclude_user_ids?: string[]; top_n?: number }
1391
+ Returns: {
1392
+ id: string
1393
+ last_active: string
1394
+ org_count: number
1395
+ session_count: number
1396
+ }[]
1397
+ }
1120
1398
  resolve_project_id_from_session: {
1121
1399
  Args: { _env_id: string; _version_id: string }
1122
1400
  Returns: string
@@ -1140,6 +1418,20 @@ export type Database = {
1140
1418
  version_name: string
1141
1419
  }[]
1142
1420
  }
1421
+ search_admin_users: {
1422
+ Args: {
1423
+ exclude_user_ids?: string[]
1424
+ p_limit?: number
1425
+ p_offset?: number
1426
+ }
1427
+ Returns: {
1428
+ last_active: string
1429
+ org_count: number
1430
+ org_names: string[]
1431
+ session_count: number
1432
+ user_id: string
1433
+ }[]
1434
+ }
1143
1435
  search_build_sessions: {
1144
1436
  Args: {
1145
1437
  p_build_id: string
@@ -1164,6 +1456,21 @@ export type Database = {
1164
1456
  }
1165
1457
  }
1166
1458
  Enums: {
1459
+ daytona_sandbox_status:
1460
+ | "CREATING"
1461
+ | "STARTED"
1462
+ | "STOPPED"
1463
+ | "ARCHIVED"
1464
+ | "ERROR"
1465
+ | "DELETED"
1466
+ dev_server_instance_status:
1467
+ | "CREATING"
1468
+ | "DEPLOYING"
1469
+ | "RUNNING"
1470
+ | "STOPPING"
1471
+ | "STOPPED"
1472
+ | "ERROR"
1473
+ | "DESTROYED"
1167
1474
  device_platform:
1168
1475
  | "IOS"
1169
1476
  | "ANDROID"
@@ -1182,6 +1489,8 @@ export type Database = {
1182
1489
  | "UNKNOWN"
1183
1490
  | "OTHER"
1184
1491
  environment_type: "DEVELOPMENT" | "STAGING" | "PRODUCTION"
1492
+ investor_access_status: "PENDING" | "APPROVED" | "REJECTED"
1493
+ message_role: "USER" | "ASSISTANT" | "SYSTEM" | "TOOL"
1185
1494
  org_invitation_status: "PENDING" | "ACCEPTED" | "CANCELLED" | "EXPIRED"
1186
1495
  org_role_type: "OWNER" | "ADMIN" | "ENGINEER"
1187
1496
  org_type: "PERSONAL" | "START_UP" | "SCALE_UP" | "AGENCY" | "ENTERPRISE"
@@ -1193,6 +1502,8 @@ export type Database = {
1193
1502
  | "UPDATE_AVAILABLE"
1194
1503
  | "UPDATE_RECOMMENDED"
1195
1504
  | "UPDATE_REQUIRED"
1505
+ sandbox_scope: "PROJECT" | "ORG" | "PERSONAL"
1506
+ sandbox_status: "CREATING" | "RUNNING" | "PAUSED" | "TERMINATED" | "ERROR"
1196
1507
  subscription_status:
1197
1508
  | "ACTIVE"
1198
1509
  | "PAST_DUE"
@@ -1226,6 +1537,12 @@ export type Database = {
1226
1537
  session_count: number | null
1227
1538
  last_active: string | null
1228
1539
  }
1540
+ admin_top_user_stats: {
1541
+ id: string | null
1542
+ session_count: number | null
1543
+ org_count: number | null
1544
+ last_active: string | null
1545
+ }
1229
1546
  }
1230
1547
  }
1231
1548
  }
@@ -1350,6 +1667,23 @@ export type CompositeTypes<
1350
1667
  export const Constants = {
1351
1668
  public: {
1352
1669
  Enums: {
1670
+ daytona_sandbox_status: [
1671
+ "CREATING",
1672
+ "STARTED",
1673
+ "STOPPED",
1674
+ "ARCHIVED",
1675
+ "ERROR",
1676
+ "DELETED",
1677
+ ],
1678
+ dev_server_instance_status: [
1679
+ "CREATING",
1680
+ "DEPLOYING",
1681
+ "RUNNING",
1682
+ "STOPPING",
1683
+ "STOPPED",
1684
+ "ERROR",
1685
+ "DESTROYED",
1686
+ ],
1353
1687
  device_platform: [
1354
1688
  "IOS",
1355
1689
  "ANDROID",
@@ -1369,6 +1703,8 @@ export const Constants = {
1369
1703
  "OTHER",
1370
1704
  ],
1371
1705
  environment_type: ["DEVELOPMENT", "STAGING", "PRODUCTION"],
1706
+ investor_access_status: ["PENDING", "APPROVED", "REJECTED"],
1707
+ message_role: ["USER", "ASSISTANT", "SYSTEM", "TOOL"],
1372
1708
  org_invitation_status: ["PENDING", "ACCEPTED", "CANCELLED", "EXPIRED"],
1373
1709
  org_role_type: ["OWNER", "ADMIN", "ENGINEER"],
1374
1710
  org_type: ["PERSONAL", "START_UP", "SCALE_UP", "AGENCY", "ENTERPRISE"],
@@ -1381,6 +1717,8 @@ export const Constants = {
1381
1717
  "UPDATE_RECOMMENDED",
1382
1718
  "UPDATE_REQUIRED",
1383
1719
  ],
1720
+ sandbox_scope: ["PROJECT", "ORG", "PERSONAL"],
1721
+ sandbox_status: ["CREATING", "RUNNING", "PAUSED", "TERMINATED", "ERROR"],
1384
1722
  subscription_status: [
1385
1723
  "ACTIVE",
1386
1724
  "PAST_DUE",
package/src/index.ts CHANGED
@@ -45,8 +45,54 @@ export type Result<Success, Error = string> = SuccessResult<Success> | ErrorResu
45
45
  */
46
46
  export type AsyncResult<Success, Error = string> = Promise<Result<Success, Error>>;
47
47
 
48
+ // Re-export Drizzle types for new code (gradual migration)
49
+ // These use camelCase column names vs snake_case in generated-types.ts
50
+ export type {
51
+ // Select types (for reading)
52
+ DashboardUserSession as DrizzleDashboardUserSession,
53
+ DaytonaSandbox as DrizzleDaytonaSandbox,
54
+ // Enum types
55
+ DaytonaSandboxStatus,
56
+ Device as DrizzleDevice,
57
+ DevicePlatform,
58
+ DeviceSession as DrizzleDeviceSession,
59
+ Environment as DrizzleEnvironment,
60
+ EnvironmentType,
61
+ Event as DrizzleEvent,
62
+ GithubInstallation as DrizzleGithubInstallation,
63
+ GithubProjectConnection as DrizzleGithubProjectConnection,
64
+ GithubRepository as DrizzleGithubRepository,
65
+ GithubWebhookEvent as DrizzleGithubWebhookEvent,
66
+ InvestorAccess as DrizzleInvestorAccess,
67
+ InvestorAccessStatus,
68
+ LaunchpadGithubRepository as DrizzleLaunchpadGithubRepository,
69
+ MessageRole,
70
+ Org as DrizzleOrg,
71
+ OrgApiKey as DrizzleOrgApiKey,
72
+ OrgInvitation as DrizzleOrgInvitation,
73
+ OrgInvitationStatus,
74
+ OrgRole as DrizzleOrgRole,
75
+ OrgRoleType,
76
+ OrgType,
77
+ OtaUpdate as DrizzleOtaUpdate,
78
+ Project as DrizzleProject,
79
+ ProjectApiKey as DrizzleProjectApiKey,
80
+ ProjectApiKeyKind,
81
+ ProjectStatus,
82
+ ProjectType,
83
+ ProjectUser as DrizzleProjectUser,
84
+ ProjectVersion as DrizzleProjectVersion,
85
+ ProjectVersionStatus,
86
+ SandboxScope,
87
+ SandboxStatus,
88
+ SubscriptionStatus,
89
+ SubscriptionTier,
90
+ SubscriptionUsage as DrizzleSubscriptionUsage,
91
+ UserApiKey as DrizzleUserApiKey,
92
+ VersionBuild as DrizzleVersionBuild,
93
+ VersionBuildStatus,
94
+ } from "@teardown/db";
48
95
  // Export Eden Treaty types for query utilities
49
96
  export * from "./eden-treaty.types";
50
-
51
97
  // Export Service class and related types
52
98
  export { type LoggingContext, Service } from "./interfaces/service.interface";
package/tsconfig.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "extends": "@teardown/tsconfig/tsconfig.base.json",
2
3
  "references": [
3
4
  {
4
5
  "path": "./tsconfig.lib.json"
package/tsconfig.lib.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "extends": "@teardown/tsconfig/tsconfig.lib.json",
3
3
  "include": ["src/**/*"],
4
4
  "compilerOptions": {
5
- "noEmit": true,
5
+ "noEmit": false,
6
+ "composite": true,
6
7
  "rootDir": "src",
7
8
  "paths": {
8
9
  "@/*": ["./src/*"]