@baseworks/organization 0.2.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.
Files changed (39) hide show
  1. package/dist/chunk-5UCSEIJS.js +64 -0
  2. package/dist/cli.d.ts +18 -0
  3. package/dist/cli.js +534 -0
  4. package/dist/index.d.ts +199 -0
  5. package/dist/index.js +335 -0
  6. package/dist/schema/pg/index.d.ts +562 -0
  7. package/dist/schema/pg/index.js +62 -0
  8. package/dist/schema/sqlite/index.d.ts +604 -0
  9. package/dist/schema/sqlite/index.js +12 -0
  10. package/package.json +37 -0
  11. package/src/__tests__/cli-env.test.ts +158 -0
  12. package/src/__tests__/cli-org.test.ts +154 -0
  13. package/src/__tests__/cli-proj.test.ts +157 -0
  14. package/src/__tests__/cli-ws.test.ts +156 -0
  15. package/src/__tests__/helpers.ts +29 -0
  16. package/src/cli.ts +682 -0
  17. package/src/index.ts +5 -0
  18. package/src/operations/bootstrap.ts +50 -0
  19. package/src/repo/environments.ts +82 -0
  20. package/src/repo/index.ts +9 -0
  21. package/src/repo/organizations.ts +96 -0
  22. package/src/repo/projects.ts +106 -0
  23. package/src/repo/workspaces.ts +87 -0
  24. package/src/schema/environments.ts +14 -0
  25. package/src/schema/index.ts +5 -0
  26. package/src/schema/organizations.ts +11 -0
  27. package/src/schema/pg/environments.ts +14 -0
  28. package/src/schema/pg/index.ts +4 -0
  29. package/src/schema/pg/organizations.ts +11 -0
  30. package/src/schema/pg/projects.ts +16 -0
  31. package/src/schema/pg/workspaces.ts +15 -0
  32. package/src/schema/projects.ts +16 -0
  33. package/src/schema/sqlite/environments.ts +14 -0
  34. package/src/schema/sqlite/index.ts +4 -0
  35. package/src/schema/sqlite/organizations.ts +11 -0
  36. package/src/schema/sqlite/projects.ts +16 -0
  37. package/src/schema/sqlite/workspaces.ts +15 -0
  38. package/src/schema/workspaces.ts +15 -0
  39. package/src/types.ts +88 -0
package/src/types.ts ADDED
@@ -0,0 +1,88 @@
1
+ // Plain interfaces — dialect-agnostic.
2
+ // Compatible with both SQLite and PostgreSQL schema inference.
3
+
4
+ export interface Organization {
5
+ id: string
6
+ shortId: string
7
+ slug: string
8
+ name: string
9
+ metadata: string | null
10
+ createdAt: number
11
+ updatedAt: number
12
+ }
13
+
14
+ export interface NewOrganization {
15
+ id?: string
16
+ shortId?: string
17
+ slug?: string
18
+ name: string
19
+ metadata?: string | null
20
+ createdAt?: number
21
+ updatedAt?: number
22
+ }
23
+
24
+ export interface Workspace {
25
+ id: string
26
+ organizationId: string
27
+ shortId: string
28
+ slug: string
29
+ name: string
30
+ isDefault: boolean
31
+ createdAt: number
32
+ updatedAt: number
33
+ }
34
+
35
+ export interface NewWorkspace {
36
+ id?: string
37
+ organizationId: string
38
+ shortId?: string
39
+ slug?: string
40
+ name: string
41
+ isDefault?: boolean
42
+ createdAt?: number
43
+ updatedAt?: number
44
+ }
45
+
46
+ export interface Project {
47
+ id: string
48
+ workspaceId: string
49
+ shortId: string
50
+ slug: string
51
+ name: string
52
+ isDefault: boolean
53
+ metadata: string | null
54
+ createdAt: number
55
+ updatedAt: number
56
+ }
57
+
58
+ export interface NewProject {
59
+ id?: string
60
+ workspaceId: string
61
+ shortId?: string
62
+ slug?: string
63
+ name: string
64
+ isDefault?: boolean
65
+ metadata?: string | null
66
+ createdAt?: number
67
+ updatedAt?: number
68
+ }
69
+
70
+ export interface Environment {
71
+ id: string
72
+ projectId: string
73
+ shortId: string
74
+ slug: string
75
+ name: string
76
+ createdAt: number
77
+ updatedAt: number
78
+ }
79
+
80
+ export interface NewEnvironment {
81
+ id?: string
82
+ projectId: string
83
+ shortId?: string
84
+ slug?: string
85
+ name: string
86
+ createdAt?: number
87
+ updatedAt?: number
88
+ }