@pocketcoder/shared 0.0.2

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 (67) hide show
  1. package/LICENSE +53 -0
  2. package/dist/constants/__tests__/limits.test.d.ts +2 -0
  3. package/dist/constants/__tests__/limits.test.d.ts.map +1 -0
  4. package/dist/constants/__tests__/limits.test.js +68 -0
  5. package/dist/constants/__tests__/limits.test.js.map +1 -0
  6. package/dist/constants/errors.d.ts +48 -0
  7. package/dist/constants/errors.d.ts.map +1 -0
  8. package/dist/constants/errors.js +61 -0
  9. package/dist/constants/errors.js.map +1 -0
  10. package/dist/constants/index.d.ts +3 -0
  11. package/dist/constants/index.d.ts.map +1 -0
  12. package/dist/constants/index.js +4 -0
  13. package/dist/constants/index.js.map +1 -0
  14. package/dist/constants/limits.d.ts +41 -0
  15. package/dist/constants/limits.d.ts.map +1 -0
  16. package/dist/constants/limits.js +46 -0
  17. package/dist/constants/limits.js.map +1 -0
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +4 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/types/__tests__/auth-messages.test.d.ts +2 -0
  23. package/dist/types/__tests__/auth-messages.test.d.ts.map +1 -0
  24. package/dist/types/__tests__/auth-messages.test.js +94 -0
  25. package/dist/types/__tests__/auth-messages.test.js.map +1 -0
  26. package/dist/types/__tests__/messages.test.d.ts +2 -0
  27. package/dist/types/__tests__/messages.test.d.ts.map +1 -0
  28. package/dist/types/__tests__/messages.test.js +329 -0
  29. package/dist/types/__tests__/messages.test.js.map +1 -0
  30. package/dist/types/__tests__/relay-types.test.d.ts +2 -0
  31. package/dist/types/__tests__/relay-types.test.d.ts.map +1 -0
  32. package/dist/types/__tests__/relay-types.test.js +69 -0
  33. package/dist/types/__tests__/relay-types.test.js.map +1 -0
  34. package/dist/types/auth-messages.d.ts +49 -0
  35. package/dist/types/auth-messages.d.ts.map +1 -0
  36. package/dist/types/auth-messages.js +9 -0
  37. package/dist/types/auth-messages.js.map +1 -0
  38. package/dist/types/database.d.ts +259 -0
  39. package/dist/types/database.d.ts.map +1 -0
  40. package/dist/types/database.js +6 -0
  41. package/dist/types/database.js.map +1 -0
  42. package/dist/types/index.d.ts +5 -0
  43. package/dist/types/index.d.ts.map +1 -0
  44. package/dist/types/index.js +6 -0
  45. package/dist/types/index.js.map +1 -0
  46. package/dist/types/messages.d.ts +821 -0
  47. package/dist/types/messages.d.ts.map +1 -0
  48. package/dist/types/messages.js +122 -0
  49. package/dist/types/messages.js.map +1 -0
  50. package/dist/types/relay.d.ts +62 -0
  51. package/dist/types/relay.d.ts.map +1 -0
  52. package/dist/types/relay.js +8 -0
  53. package/dist/types/relay.js.map +1 -0
  54. package/package.json +49 -0
  55. package/src/constants/__tests__/limits.test.ts +93 -0
  56. package/src/constants/errors.ts +71 -0
  57. package/src/constants/index.ts +3 -0
  58. package/src/constants/limits.ts +53 -0
  59. package/src/index.ts +3 -0
  60. package/src/types/__tests__/auth-messages.test.ts +108 -0
  61. package/src/types/__tests__/messages.test.ts +382 -0
  62. package/src/types/__tests__/relay-types.test.ts +82 -0
  63. package/src/types/auth-messages.ts +66 -0
  64. package/src/types/database.ts +320 -0
  65. package/src/types/index.ts +5 -0
  66. package/src/types/messages.ts +1310 -0
  67. package/src/types/relay.ts +79 -0
@@ -0,0 +1,320 @@
1
+ export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[];
2
+
3
+ export type Database = {
4
+ // Allows to automatically instantiate createClient with right options
5
+ // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
6
+ __InternalSupabase: {
7
+ PostgrestVersion: "14.1";
8
+ };
9
+ public: {
10
+ Tables: {
11
+ subscriptions: {
12
+ Row: {
13
+ created_at: string | null;
14
+ current_period_end: string | null;
15
+ current_period_start: string | null;
16
+ id: string;
17
+ max_projects: number;
18
+ status: string;
19
+ stripe_customer_id: string | null;
20
+ stripe_subscription_id: string | null;
21
+ tier: string;
22
+ updated_at: string | null;
23
+ user_id: string;
24
+ };
25
+ Insert: {
26
+ created_at?: string | null;
27
+ current_period_end?: string | null;
28
+ current_period_start?: string | null;
29
+ id?: string;
30
+ max_projects?: number;
31
+ status?: string;
32
+ stripe_customer_id?: string | null;
33
+ stripe_subscription_id?: string | null;
34
+ tier?: string;
35
+ updated_at?: string | null;
36
+ user_id: string;
37
+ };
38
+ Update: {
39
+ created_at?: string | null;
40
+ current_period_end?: string | null;
41
+ current_period_start?: string | null;
42
+ id?: string;
43
+ max_projects?: number;
44
+ status?: string;
45
+ stripe_customer_id?: string | null;
46
+ stripe_subscription_id?: string | null;
47
+ tier?: string;
48
+ updated_at?: string | null;
49
+ user_id?: string;
50
+ };
51
+ Relationships: [
52
+ {
53
+ foreignKeyName: "subscriptions_user_id_fkey";
54
+ columns: ["user_id"];
55
+ isOneToOne: true;
56
+ referencedRelation: "users";
57
+ referencedColumns: ["id"];
58
+ },
59
+ ];
60
+ };
61
+ user_machines: {
62
+ Row: {
63
+ id: string;
64
+ user_id: string;
65
+ machine_key: string;
66
+ machine_name: string;
67
+ os: string | null;
68
+ os_version: string | null;
69
+ hostname: string | null;
70
+ username: string | null;
71
+ arch: string | null;
72
+ node_version: string | null;
73
+ host_version: string | null;
74
+ label: string | null;
75
+ last_seen: string | null;
76
+ created_at: string | null;
77
+ };
78
+ Insert: {
79
+ id?: string;
80
+ user_id: string;
81
+ machine_key: string;
82
+ machine_name: string;
83
+ os?: string | null;
84
+ os_version?: string | null;
85
+ hostname?: string | null;
86
+ username?: string | null;
87
+ arch?: string | null;
88
+ node_version?: string | null;
89
+ host_version?: string | null;
90
+ label?: string | null;
91
+ last_seen?: string | null;
92
+ created_at?: string | null;
93
+ };
94
+ Update: {
95
+ id?: string;
96
+ user_id?: string;
97
+ machine_key?: string;
98
+ machine_name?: string;
99
+ os?: string | null;
100
+ os_version?: string | null;
101
+ hostname?: string | null;
102
+ username?: string | null;
103
+ arch?: string | null;
104
+ node_version?: string | null;
105
+ host_version?: string | null;
106
+ label?: string | null;
107
+ last_seen?: string | null;
108
+ created_at?: string | null;
109
+ };
110
+ Relationships: [
111
+ {
112
+ foreignKeyName: "user_machines_user_id_fkey";
113
+ columns: ["user_id"];
114
+ isOneToOne: false;
115
+ referencedRelation: "users";
116
+ referencedColumns: ["id"];
117
+ },
118
+ ];
119
+ };
120
+ user_projects: {
121
+ Row: {
122
+ created_at: string | null;
123
+ id: string;
124
+ last_accessed: string | null;
125
+ machine_key: string;
126
+ project_hash: string;
127
+ project_name: string;
128
+ user_id: string;
129
+ };
130
+ Insert: {
131
+ created_at?: string | null;
132
+ id?: string;
133
+ last_accessed?: string | null;
134
+ machine_key: string;
135
+ project_hash: string;
136
+ project_name: string;
137
+ user_id: string;
138
+ };
139
+ Update: {
140
+ created_at?: string | null;
141
+ id?: string;
142
+ last_accessed?: string | null;
143
+ machine_key?: string;
144
+ project_hash?: string;
145
+ project_name?: string;
146
+ user_id?: string;
147
+ };
148
+ Relationships: [
149
+ {
150
+ foreignKeyName: "user_projects_user_id_fkey";
151
+ columns: ["user_id"];
152
+ isOneToOne: false;
153
+ referencedRelation: "users";
154
+ referencedColumns: ["id"];
155
+ },
156
+ ];
157
+ };
158
+ users: {
159
+ Row: {
160
+ created_at: string | null;
161
+ email: string | null;
162
+ github_id: string;
163
+ github_username: string;
164
+ id: string;
165
+ security_stamp: string | null;
166
+ };
167
+ Insert: {
168
+ created_at?: string | null;
169
+ email?: string | null;
170
+ github_id: string;
171
+ github_username: string;
172
+ id: string;
173
+ security_stamp?: string | null;
174
+ };
175
+ Update: {
176
+ created_at?: string | null;
177
+ email?: string | null;
178
+ github_id?: string;
179
+ github_username?: string;
180
+ id?: string;
181
+ security_stamp?: string | null;
182
+ };
183
+ Relationships: [];
184
+ };
185
+ };
186
+ Views: {
187
+ [_ in never]: never;
188
+ };
189
+ Functions: {
190
+ custom_access_token_hook: { Args: { event: Json }; Returns: Json };
191
+ };
192
+ Enums: {
193
+ [_ in never]: never;
194
+ };
195
+ CompositeTypes: {
196
+ [_ in never]: never;
197
+ };
198
+ };
199
+ };
200
+
201
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">;
202
+
203
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">];
204
+
205
+ export type Tables<
206
+ DefaultSchemaTableNameOrOptions extends
207
+ | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
208
+ | { schema: keyof DatabaseWithoutInternals },
209
+ TableName extends DefaultSchemaTableNameOrOptions extends {
210
+ schema: keyof DatabaseWithoutInternals;
211
+ }
212
+ ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
213
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
214
+ : never = never,
215
+ > = DefaultSchemaTableNameOrOptions extends {
216
+ schema: keyof DatabaseWithoutInternals;
217
+ }
218
+ ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
219
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
220
+ Row: infer R;
221
+ }
222
+ ? R
223
+ : never
224
+ : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
225
+ ? (DefaultSchema["Tables"] & DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
226
+ Row: infer R;
227
+ }
228
+ ? R
229
+ : never
230
+ : never;
231
+
232
+ export type TablesInsert<
233
+ DefaultSchemaTableNameOrOptions extends
234
+ | keyof DefaultSchema["Tables"]
235
+ | { schema: keyof DatabaseWithoutInternals },
236
+ TableName extends DefaultSchemaTableNameOrOptions extends {
237
+ schema: keyof DatabaseWithoutInternals;
238
+ }
239
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
240
+ : never = never,
241
+ > = DefaultSchemaTableNameOrOptions extends {
242
+ schema: keyof DatabaseWithoutInternals;
243
+ }
244
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
245
+ Insert: infer I;
246
+ }
247
+ ? I
248
+ : never
249
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
250
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
251
+ Insert: infer I;
252
+ }
253
+ ? I
254
+ : never
255
+ : never;
256
+
257
+ export type TablesUpdate<
258
+ DefaultSchemaTableNameOrOptions extends
259
+ | keyof DefaultSchema["Tables"]
260
+ | { schema: keyof DatabaseWithoutInternals },
261
+ TableName extends DefaultSchemaTableNameOrOptions extends {
262
+ schema: keyof DatabaseWithoutInternals;
263
+ }
264
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
265
+ : never = never,
266
+ > = DefaultSchemaTableNameOrOptions extends {
267
+ schema: keyof DatabaseWithoutInternals;
268
+ }
269
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
270
+ Update: infer U;
271
+ }
272
+ ? U
273
+ : never
274
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
275
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
276
+ Update: infer U;
277
+ }
278
+ ? U
279
+ : never
280
+ : never;
281
+
282
+ export type Enums<
283
+ DefaultSchemaEnumNameOrOptions extends
284
+ | keyof DefaultSchema["Enums"]
285
+ | { schema: keyof DatabaseWithoutInternals },
286
+ EnumName extends DefaultSchemaEnumNameOrOptions extends {
287
+ schema: keyof DatabaseWithoutInternals;
288
+ }
289
+ ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
290
+ : never = never,
291
+ > = DefaultSchemaEnumNameOrOptions extends {
292
+ schema: keyof DatabaseWithoutInternals;
293
+ }
294
+ ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
295
+ : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
296
+ ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
297
+ : never;
298
+
299
+ export type CompositeTypes<
300
+ PublicCompositeTypeNameOrOptions extends
301
+ | keyof DefaultSchema["CompositeTypes"]
302
+ | { schema: keyof DatabaseWithoutInternals },
303
+ CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
304
+ schema: keyof DatabaseWithoutInternals;
305
+ }
306
+ ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
307
+ : never = never,
308
+ > = PublicCompositeTypeNameOrOptions extends {
309
+ schema: keyof DatabaseWithoutInternals;
310
+ }
311
+ ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
312
+ : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
313
+ ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
314
+ : never;
315
+
316
+ export const Constants = {
317
+ public: {
318
+ Enums: {},
319
+ },
320
+ } as const;
@@ -0,0 +1,5 @@
1
+ // Re-export all types
2
+ export * from "./messages.js";
3
+ export * from "./auth-messages.js";
4
+ export * from "./database.js";
5
+ export * from "./relay.js";