@tscircuit/fake-snippets 0.0.21 → 0.0.22

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.
@@ -0,0 +1,996 @@
1
+ import * as zustand_vanilla from 'zustand/vanilla';
2
+ import { z } from 'zod';
3
+ import { Middleware } from 'winterspec';
4
+
5
+ declare const snippetSchema: z.ZodObject<{
6
+ snippet_id: z.ZodString;
7
+ package_release_id: z.ZodString;
8
+ name: z.ZodString;
9
+ unscoped_name: z.ZodString;
10
+ owner_name: z.ZodString;
11
+ is_starred: z.ZodDefault<z.ZodBoolean>;
12
+ code: z.ZodString;
13
+ dts: z.ZodOptional<z.ZodString>;
14
+ compiled_js: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
+ circuit_json: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">>>;
16
+ manual_edits_json_content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
+ created_at: z.ZodString;
18
+ updated_at: z.ZodString;
19
+ snippet_type: z.ZodEnum<["board", "package", "model", "footprint"]>;
20
+ description: z.ZodOptional<z.ZodString>;
21
+ version: z.ZodDefault<z.ZodString>;
22
+ star_count: z.ZodDefault<z.ZodNumber>;
23
+ is_private: z.ZodDefault<z.ZodBoolean>;
24
+ is_public: z.ZodDefault<z.ZodBoolean>;
25
+ is_unlisted: z.ZodDefault<z.ZodBoolean>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ code: string;
28
+ snippet_id: string;
29
+ package_release_id: string;
30
+ name: string;
31
+ unscoped_name: string;
32
+ owner_name: string;
33
+ is_starred: boolean;
34
+ created_at: string;
35
+ updated_at: string;
36
+ snippet_type: "board" | "package" | "model" | "footprint";
37
+ version: string;
38
+ star_count: number;
39
+ is_private: boolean;
40
+ is_public: boolean;
41
+ is_unlisted: boolean;
42
+ dts?: string | undefined;
43
+ compiled_js?: string | null | undefined;
44
+ circuit_json?: Record<string, any>[] | null | undefined;
45
+ manual_edits_json_content?: string | null | undefined;
46
+ description?: string | undefined;
47
+ }, {
48
+ code: string;
49
+ snippet_id: string;
50
+ package_release_id: string;
51
+ name: string;
52
+ unscoped_name: string;
53
+ owner_name: string;
54
+ created_at: string;
55
+ updated_at: string;
56
+ snippet_type: "board" | "package" | "model" | "footprint";
57
+ is_starred?: boolean | undefined;
58
+ dts?: string | undefined;
59
+ compiled_js?: string | null | undefined;
60
+ circuit_json?: Record<string, any>[] | null | undefined;
61
+ manual_edits_json_content?: string | null | undefined;
62
+ description?: string | undefined;
63
+ version?: string | undefined;
64
+ star_count?: number | undefined;
65
+ is_private?: boolean | undefined;
66
+ is_public?: boolean | undefined;
67
+ is_unlisted?: boolean | undefined;
68
+ }>;
69
+ type Snippet = z.infer<typeof snippetSchema>;
70
+ declare const sessionSchema: z.ZodObject<{
71
+ session_id: z.ZodString;
72
+ account_id: z.ZodString;
73
+ expires_at: z.ZodString;
74
+ is_cli_session: z.ZodBoolean;
75
+ }, "strip", z.ZodTypeAny, {
76
+ session_id: string;
77
+ account_id: string;
78
+ expires_at: string;
79
+ is_cli_session: boolean;
80
+ }, {
81
+ session_id: string;
82
+ account_id: string;
83
+ expires_at: string;
84
+ is_cli_session: boolean;
85
+ }>;
86
+ type Session = z.infer<typeof sessionSchema>;
87
+ declare const loginPageSchema: z.ZodObject<{
88
+ login_page_id: z.ZodString;
89
+ login_page_auth_token: z.ZodString;
90
+ was_login_successful: z.ZodBoolean;
91
+ has_been_used_to_create_session: z.ZodBoolean;
92
+ created_at: z.ZodString;
93
+ expires_at: z.ZodString;
94
+ }, "strip", z.ZodTypeAny, {
95
+ created_at: string;
96
+ expires_at: string;
97
+ login_page_id: string;
98
+ login_page_auth_token: string;
99
+ was_login_successful: boolean;
100
+ has_been_used_to_create_session: boolean;
101
+ }, {
102
+ created_at: string;
103
+ expires_at: string;
104
+ login_page_id: string;
105
+ login_page_auth_token: string;
106
+ was_login_successful: boolean;
107
+ has_been_used_to_create_session: boolean;
108
+ }>;
109
+ type LoginPage = z.infer<typeof loginPageSchema>;
110
+ declare const accountSchema: z.ZodObject<{
111
+ account_id: z.ZodString;
112
+ github_username: z.ZodString;
113
+ shippingInfo: z.ZodOptional<z.ZodObject<{
114
+ firstName: z.ZodString;
115
+ lastName: z.ZodString;
116
+ companyName: z.ZodOptional<z.ZodString>;
117
+ address: z.ZodString;
118
+ apartment: z.ZodOptional<z.ZodString>;
119
+ city: z.ZodString;
120
+ state: z.ZodString;
121
+ zipCode: z.ZodString;
122
+ country: z.ZodString;
123
+ phone: z.ZodString;
124
+ }, "strip", z.ZodTypeAny, {
125
+ firstName: string;
126
+ lastName: string;
127
+ address: string;
128
+ city: string;
129
+ state: string;
130
+ zipCode: string;
131
+ country: string;
132
+ phone: string;
133
+ companyName?: string | undefined;
134
+ apartment?: string | undefined;
135
+ }, {
136
+ firstName: string;
137
+ lastName: string;
138
+ address: string;
139
+ city: string;
140
+ state: string;
141
+ zipCode: string;
142
+ country: string;
143
+ phone: string;
144
+ companyName?: string | undefined;
145
+ apartment?: string | undefined;
146
+ }>>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ account_id: string;
149
+ github_username: string;
150
+ shippingInfo?: {
151
+ firstName: string;
152
+ lastName: string;
153
+ address: string;
154
+ city: string;
155
+ state: string;
156
+ zipCode: string;
157
+ country: string;
158
+ phone: string;
159
+ companyName?: string | undefined;
160
+ apartment?: string | undefined;
161
+ } | undefined;
162
+ }, {
163
+ account_id: string;
164
+ github_username: string;
165
+ shippingInfo?: {
166
+ firstName: string;
167
+ lastName: string;
168
+ address: string;
169
+ city: string;
170
+ state: string;
171
+ zipCode: string;
172
+ country: string;
173
+ phone: string;
174
+ companyName?: string | undefined;
175
+ apartment?: string | undefined;
176
+ } | undefined;
177
+ }>;
178
+ type Account = z.infer<typeof accountSchema>;
179
+ declare const orderSchema: z.ZodObject<{
180
+ order_id: z.ZodString;
181
+ account_id: z.ZodNullable<z.ZodString>;
182
+ is_running: z.ZodBoolean;
183
+ is_started: z.ZodBoolean;
184
+ is_finished: z.ZodBoolean;
185
+ error: z.ZodNullable<z.ZodObject<{
186
+ error_code: z.ZodString;
187
+ message: z.ZodString;
188
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
189
+ error_code: z.ZodString;
190
+ message: z.ZodString;
191
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
192
+ error_code: z.ZodString;
193
+ message: z.ZodString;
194
+ }, z.ZodTypeAny, "passthrough">>>;
195
+ has_error: z.ZodBoolean;
196
+ created_at: z.ZodString;
197
+ started_at: z.ZodNullable<z.ZodString>;
198
+ completed_at: z.ZodNullable<z.ZodString>;
199
+ circuit_json: z.ZodAny;
200
+ }, "strip", z.ZodTypeAny, {
201
+ error: z.objectOutputType<{
202
+ error_code: z.ZodString;
203
+ message: z.ZodString;
204
+ }, z.ZodTypeAny, "passthrough"> | null;
205
+ created_at: string;
206
+ account_id: string | null;
207
+ order_id: string;
208
+ is_running: boolean;
209
+ is_started: boolean;
210
+ is_finished: boolean;
211
+ has_error: boolean;
212
+ started_at: string | null;
213
+ completed_at: string | null;
214
+ circuit_json?: any;
215
+ }, {
216
+ error: z.objectInputType<{
217
+ error_code: z.ZodString;
218
+ message: z.ZodString;
219
+ }, z.ZodTypeAny, "passthrough"> | null;
220
+ created_at: string;
221
+ account_id: string | null;
222
+ order_id: string;
223
+ is_running: boolean;
224
+ is_started: boolean;
225
+ is_finished: boolean;
226
+ has_error: boolean;
227
+ started_at: string | null;
228
+ completed_at: string | null;
229
+ circuit_json?: any;
230
+ }>;
231
+ type Order = z.infer<typeof orderSchema>;
232
+ declare const orderFileSchema: z.ZodObject<{
233
+ order_file_id: z.ZodString;
234
+ order_id: z.ZodString;
235
+ is_gerbers_zip: z.ZodBoolean;
236
+ content_type: z.ZodString;
237
+ for_provider: z.ZodNullable<z.ZodString>;
238
+ uploaded_at: z.ZodString;
239
+ content_text: z.ZodNullable<z.ZodString>;
240
+ content_bytes: z.ZodNullable<z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ order_id: string;
243
+ order_file_id: string;
244
+ is_gerbers_zip: boolean;
245
+ content_type: string;
246
+ for_provider: string | null;
247
+ uploaded_at: string;
248
+ content_text: string | null;
249
+ content_bytes: Uint8Array<ArrayBuffer> | null;
250
+ }, {
251
+ order_id: string;
252
+ order_file_id: string;
253
+ is_gerbers_zip: boolean;
254
+ content_type: string;
255
+ for_provider: string | null;
256
+ uploaded_at: string;
257
+ content_text: string | null;
258
+ content_bytes: Uint8Array<ArrayBuffer> | null;
259
+ }>;
260
+ type OrderFile = z.infer<typeof orderFileSchema>;
261
+ declare const accountPackageSchema: z.ZodObject<{
262
+ account_package_id: z.ZodString;
263
+ account_id: z.ZodString;
264
+ package_id: z.ZodString;
265
+ is_starred: z.ZodBoolean;
266
+ created_at: z.ZodString;
267
+ updated_at: z.ZodString;
268
+ }, "strip", z.ZodTypeAny, {
269
+ is_starred: boolean;
270
+ created_at: string;
271
+ updated_at: string;
272
+ account_id: string;
273
+ account_package_id: string;
274
+ package_id: string;
275
+ }, {
276
+ is_starred: boolean;
277
+ created_at: string;
278
+ updated_at: string;
279
+ account_id: string;
280
+ account_package_id: string;
281
+ package_id: string;
282
+ }>;
283
+ type AccountPackage = z.infer<typeof accountPackageSchema>;
284
+ declare const packageReleaseSchema: z.ZodObject<{
285
+ package_release_id: z.ZodString;
286
+ package_id: z.ZodString;
287
+ version: z.ZodNullable<z.ZodString>;
288
+ is_locked: z.ZodBoolean;
289
+ is_latest: z.ZodBoolean;
290
+ created_at: z.ZodString;
291
+ commit_sha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
+ license: z.ZodOptional<z.ZodNullable<z.ZodString>>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ package_release_id: string;
295
+ created_at: string;
296
+ version: string | null;
297
+ package_id: string;
298
+ is_locked: boolean;
299
+ is_latest: boolean;
300
+ commit_sha?: string | null | undefined;
301
+ license?: string | null | undefined;
302
+ }, {
303
+ package_release_id: string;
304
+ created_at: string;
305
+ version: string | null;
306
+ package_id: string;
307
+ is_locked: boolean;
308
+ is_latest: boolean;
309
+ commit_sha?: string | null | undefined;
310
+ license?: string | null | undefined;
311
+ }>;
312
+ type PackageRelease = z.infer<typeof packageReleaseSchema>;
313
+ declare const packageFileSchema: z.ZodObject<{
314
+ package_file_id: z.ZodString;
315
+ package_release_id: z.ZodString;
316
+ file_path: z.ZodString;
317
+ content_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
+ created_at: z.ZodString;
319
+ }, "strip", z.ZodTypeAny, {
320
+ package_release_id: string;
321
+ created_at: string;
322
+ package_file_id: string;
323
+ file_path: string;
324
+ content_text?: string | null | undefined;
325
+ }, {
326
+ package_release_id: string;
327
+ created_at: string;
328
+ package_file_id: string;
329
+ file_path: string;
330
+ content_text?: string | null | undefined;
331
+ }>;
332
+ type PackageFile = z.infer<typeof packageFileSchema>;
333
+ declare const packageSchema: z.ZodObject<{
334
+ package_id: z.ZodString;
335
+ creator_account_id: z.ZodString;
336
+ owner_org_id: z.ZodString;
337
+ owner_github_username: z.ZodNullable<z.ZodString>;
338
+ name: z.ZodString;
339
+ unscoped_name: z.ZodString;
340
+ description: z.ZodNullable<z.ZodString>;
341
+ created_at: z.ZodString;
342
+ updated_at: z.ZodString;
343
+ is_snippet: z.ZodDefault<z.ZodBoolean>;
344
+ is_board: z.ZodDefault<z.ZodBoolean>;
345
+ is_package: z.ZodDefault<z.ZodBoolean>;
346
+ is_model: z.ZodDefault<z.ZodBoolean>;
347
+ is_footprint: z.ZodDefault<z.ZodBoolean>;
348
+ is_private: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
349
+ is_public: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
350
+ is_unlisted: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
351
+ is_source_from_github: z.ZodDefault<z.ZodBoolean>;
352
+ snippet_type: z.ZodOptional<z.ZodEnum<["board", "package", "model", "footprint"]>>;
353
+ latest_package_release_id: z.ZodNullable<z.ZodString>;
354
+ latest_version: z.ZodNullable<z.ZodString>;
355
+ license: z.ZodNullable<z.ZodString>;
356
+ star_count: z.ZodDefault<z.ZodNumber>;
357
+ ai_description: z.ZodNullable<z.ZodString>;
358
+ }, "strip", z.ZodTypeAny, {
359
+ name: string;
360
+ unscoped_name: string;
361
+ created_at: string;
362
+ updated_at: string;
363
+ description: string | null;
364
+ star_count: number;
365
+ is_private: boolean | null;
366
+ is_public: boolean | null;
367
+ is_unlisted: boolean | null;
368
+ package_id: string;
369
+ license: string | null;
370
+ creator_account_id: string;
371
+ owner_org_id: string;
372
+ owner_github_username: string | null;
373
+ is_snippet: boolean;
374
+ is_board: boolean;
375
+ is_package: boolean;
376
+ is_model: boolean;
377
+ is_footprint: boolean;
378
+ is_source_from_github: boolean;
379
+ latest_package_release_id: string | null;
380
+ latest_version: string | null;
381
+ ai_description: string | null;
382
+ snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
383
+ }, {
384
+ name: string;
385
+ unscoped_name: string;
386
+ created_at: string;
387
+ updated_at: string;
388
+ description: string | null;
389
+ package_id: string;
390
+ license: string | null;
391
+ creator_account_id: string;
392
+ owner_org_id: string;
393
+ owner_github_username: string | null;
394
+ latest_package_release_id: string | null;
395
+ latest_version: string | null;
396
+ ai_description: string | null;
397
+ snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
398
+ star_count?: number | undefined;
399
+ is_private?: boolean | null | undefined;
400
+ is_public?: boolean | null | undefined;
401
+ is_unlisted?: boolean | null | undefined;
402
+ is_snippet?: boolean | undefined;
403
+ is_board?: boolean | undefined;
404
+ is_package?: boolean | undefined;
405
+ is_model?: boolean | undefined;
406
+ is_footprint?: boolean | undefined;
407
+ is_source_from_github?: boolean | undefined;
408
+ }>;
409
+ type Package = z.infer<typeof packageSchema>;
410
+ declare const jlcpcbOrderStateSchema: z.ZodObject<{
411
+ jlcpcb_order_state_id: z.ZodString;
412
+ order_id: z.ZodString;
413
+ are_gerbers_uploaded: z.ZodDefault<z.ZodBoolean>;
414
+ is_gerber_analyzed: z.ZodDefault<z.ZodBoolean>;
415
+ are_initial_costs_calculated: z.ZodDefault<z.ZodBoolean>;
416
+ is_pcb_added_to_cart: z.ZodDefault<z.ZodBoolean>;
417
+ is_bom_uploaded: z.ZodDefault<z.ZodBoolean>;
418
+ is_pnp_uploaded: z.ZodDefault<z.ZodBoolean>;
419
+ is_bom_pnp_analyzed: z.ZodDefault<z.ZodBoolean>;
420
+ is_bom_parsing_complete: z.ZodDefault<z.ZodBoolean>;
421
+ are_components_available: z.ZodDefault<z.ZodBoolean>;
422
+ is_patch_map_generated: z.ZodDefault<z.ZodBoolean>;
423
+ is_json_merge_file_created: z.ZodDefault<z.ZodBoolean>;
424
+ is_dfm_result_generated: z.ZodDefault<z.ZodBoolean>;
425
+ are_files_downloaded: z.ZodDefault<z.ZodBoolean>;
426
+ are_product_categories_fetched: z.ZodDefault<z.ZodBoolean>;
427
+ are_final_costs_calculated: z.ZodDefault<z.ZodBoolean>;
428
+ is_json_merge_file_updated: z.ZodDefault<z.ZodBoolean>;
429
+ is_added_to_cart: z.ZodDefault<z.ZodBoolean>;
430
+ uploaded_gerber_metadata: z.ZodDefault<z.ZodNullable<z.ZodAny>>;
431
+ gerber_analysis: z.ZodDefault<z.ZodNullable<z.ZodAny>>;
432
+ created_at: z.ZodString;
433
+ are_gerbers_generated: z.ZodDefault<z.ZodBoolean>;
434
+ current_step: z.ZodDefault<z.ZodNullable<z.ZodString>>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ created_at: string;
437
+ order_id: string;
438
+ jlcpcb_order_state_id: string;
439
+ are_gerbers_uploaded: boolean;
440
+ is_gerber_analyzed: boolean;
441
+ are_initial_costs_calculated: boolean;
442
+ is_pcb_added_to_cart: boolean;
443
+ is_bom_uploaded: boolean;
444
+ is_pnp_uploaded: boolean;
445
+ is_bom_pnp_analyzed: boolean;
446
+ is_bom_parsing_complete: boolean;
447
+ are_components_available: boolean;
448
+ is_patch_map_generated: boolean;
449
+ is_json_merge_file_created: boolean;
450
+ is_dfm_result_generated: boolean;
451
+ are_files_downloaded: boolean;
452
+ are_product_categories_fetched: boolean;
453
+ are_final_costs_calculated: boolean;
454
+ is_json_merge_file_updated: boolean;
455
+ is_added_to_cart: boolean;
456
+ are_gerbers_generated: boolean;
457
+ current_step: string | null;
458
+ uploaded_gerber_metadata?: any;
459
+ gerber_analysis?: any;
460
+ }, {
461
+ created_at: string;
462
+ order_id: string;
463
+ jlcpcb_order_state_id: string;
464
+ are_gerbers_uploaded?: boolean | undefined;
465
+ is_gerber_analyzed?: boolean | undefined;
466
+ are_initial_costs_calculated?: boolean | undefined;
467
+ is_pcb_added_to_cart?: boolean | undefined;
468
+ is_bom_uploaded?: boolean | undefined;
469
+ is_pnp_uploaded?: boolean | undefined;
470
+ is_bom_pnp_analyzed?: boolean | undefined;
471
+ is_bom_parsing_complete?: boolean | undefined;
472
+ are_components_available?: boolean | undefined;
473
+ is_patch_map_generated?: boolean | undefined;
474
+ is_json_merge_file_created?: boolean | undefined;
475
+ is_dfm_result_generated?: boolean | undefined;
476
+ are_files_downloaded?: boolean | undefined;
477
+ are_product_categories_fetched?: boolean | undefined;
478
+ are_final_costs_calculated?: boolean | undefined;
479
+ is_json_merge_file_updated?: boolean | undefined;
480
+ is_added_to_cart?: boolean | undefined;
481
+ uploaded_gerber_metadata?: any;
482
+ gerber_analysis?: any;
483
+ are_gerbers_generated?: boolean | undefined;
484
+ current_step?: string | null | undefined;
485
+ }>;
486
+ type JlcpcbOrderState = z.infer<typeof jlcpcbOrderStateSchema>;
487
+ declare const jlcpcbOrderStepRunSchema: z.ZodObject<{
488
+ jlcpcb_order_step_run_id: z.ZodString;
489
+ is_running: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
490
+ step_function_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
491
+ jlcpcb_order_state_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
492
+ error_message: z.ZodDefault<z.ZodNullable<z.ZodString>>;
493
+ created_at: z.ZodString;
494
+ }, "strip", z.ZodTypeAny, {
495
+ created_at: string;
496
+ is_running: boolean | null;
497
+ jlcpcb_order_state_id: string | null;
498
+ jlcpcb_order_step_run_id: string;
499
+ step_function_name: string | null;
500
+ error_message: string | null;
501
+ }, {
502
+ created_at: string;
503
+ jlcpcb_order_step_run_id: string;
504
+ is_running?: boolean | null | undefined;
505
+ jlcpcb_order_state_id?: string | null | undefined;
506
+ step_function_name?: string | null | undefined;
507
+ error_message?: string | null | undefined;
508
+ }>;
509
+ type JlcpcbOrderStepRun = z.infer<typeof jlcpcbOrderStepRunSchema>;
510
+
511
+ declare const createDatabase: ({ seed }?: {
512
+ seed?: boolean;
513
+ }) => zustand_vanilla.StoreApi<Omit<{
514
+ idCounter: number;
515
+ snippets: {
516
+ code: string;
517
+ snippet_id: string;
518
+ package_release_id: string;
519
+ name: string;
520
+ unscoped_name: string;
521
+ owner_name: string;
522
+ is_starred: boolean;
523
+ created_at: string;
524
+ updated_at: string;
525
+ snippet_type: "board" | "package" | "model" | "footprint";
526
+ version: string;
527
+ star_count: number;
528
+ is_private: boolean;
529
+ is_public: boolean;
530
+ is_unlisted: boolean;
531
+ dts?: string | undefined;
532
+ compiled_js?: string | null | undefined;
533
+ circuit_json?: Record<string, any>[] | null | undefined;
534
+ manual_edits_json_content?: string | null | undefined;
535
+ description?: string | undefined;
536
+ }[];
537
+ packageReleases: {
538
+ package_release_id: string;
539
+ created_at: string;
540
+ version: string | null;
541
+ package_id: string;
542
+ is_locked: boolean;
543
+ is_latest: boolean;
544
+ commit_sha?: string | null | undefined;
545
+ license?: string | null | undefined;
546
+ }[];
547
+ packageFiles: {
548
+ package_release_id: string;
549
+ created_at: string;
550
+ package_file_id: string;
551
+ file_path: string;
552
+ content_text?: string | null | undefined;
553
+ }[];
554
+ sessions: {
555
+ session_id: string;
556
+ account_id: string;
557
+ expires_at: string;
558
+ is_cli_session: boolean;
559
+ }[];
560
+ loginPages: {
561
+ created_at: string;
562
+ expires_at: string;
563
+ login_page_id: string;
564
+ login_page_auth_token: string;
565
+ was_login_successful: boolean;
566
+ has_been_used_to_create_session: boolean;
567
+ }[];
568
+ accounts: {
569
+ account_id: string;
570
+ github_username: string;
571
+ shippingInfo?: {
572
+ firstName: string;
573
+ lastName: string;
574
+ address: string;
575
+ city: string;
576
+ state: string;
577
+ zipCode: string;
578
+ country: string;
579
+ phone: string;
580
+ companyName?: string | undefined;
581
+ apartment?: string | undefined;
582
+ } | undefined;
583
+ }[];
584
+ packages: {
585
+ name: string;
586
+ unscoped_name: string;
587
+ created_at: string;
588
+ updated_at: string;
589
+ description: string | null;
590
+ star_count: number;
591
+ is_private: boolean | null;
592
+ is_public: boolean | null;
593
+ is_unlisted: boolean | null;
594
+ package_id: string;
595
+ license: string | null;
596
+ creator_account_id: string;
597
+ owner_org_id: string;
598
+ owner_github_username: string | null;
599
+ is_snippet: boolean;
600
+ is_board: boolean;
601
+ is_package: boolean;
602
+ is_model: boolean;
603
+ is_footprint: boolean;
604
+ is_source_from_github: boolean;
605
+ latest_package_release_id: string | null;
606
+ latest_version: string | null;
607
+ ai_description: string | null;
608
+ snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
609
+ }[];
610
+ orders: {
611
+ error: z.objectOutputType<{
612
+ error_code: z.ZodString;
613
+ message: z.ZodString;
614
+ }, z.ZodTypeAny, "passthrough"> | null;
615
+ created_at: string;
616
+ account_id: string | null;
617
+ order_id: string;
618
+ is_running: boolean;
619
+ is_started: boolean;
620
+ is_finished: boolean;
621
+ has_error: boolean;
622
+ started_at: string | null;
623
+ completed_at: string | null;
624
+ circuit_json?: any;
625
+ }[];
626
+ orderFiles: {
627
+ order_id: string;
628
+ order_file_id: string;
629
+ is_gerbers_zip: boolean;
630
+ content_type: string;
631
+ for_provider: string | null;
632
+ uploaded_at: string;
633
+ content_text: string | null;
634
+ content_bytes: Uint8Array<ArrayBuffer> | null;
635
+ }[];
636
+ accountSnippets: {
637
+ snippet_id: string;
638
+ created_at: string;
639
+ updated_at: string;
640
+ account_id: string;
641
+ has_starred: boolean;
642
+ }[];
643
+ accountPackages: {
644
+ is_starred: boolean;
645
+ created_at: string;
646
+ updated_at: string;
647
+ account_id: string;
648
+ account_package_id: string;
649
+ package_id: string;
650
+ }[];
651
+ jlcpcbOrderState: {
652
+ created_at: string;
653
+ order_id: string;
654
+ jlcpcb_order_state_id: string;
655
+ are_gerbers_uploaded: boolean;
656
+ is_gerber_analyzed: boolean;
657
+ are_initial_costs_calculated: boolean;
658
+ is_pcb_added_to_cart: boolean;
659
+ is_bom_uploaded: boolean;
660
+ is_pnp_uploaded: boolean;
661
+ is_bom_pnp_analyzed: boolean;
662
+ is_bom_parsing_complete: boolean;
663
+ are_components_available: boolean;
664
+ is_patch_map_generated: boolean;
665
+ is_json_merge_file_created: boolean;
666
+ is_dfm_result_generated: boolean;
667
+ are_files_downloaded: boolean;
668
+ are_product_categories_fetched: boolean;
669
+ are_final_costs_calculated: boolean;
670
+ is_json_merge_file_updated: boolean;
671
+ is_added_to_cart: boolean;
672
+ are_gerbers_generated: boolean;
673
+ current_step: string | null;
674
+ uploaded_gerber_metadata?: any;
675
+ gerber_analysis?: any;
676
+ }[];
677
+ jlcpcbOrderStepRuns: {
678
+ created_at: string;
679
+ is_running: boolean | null;
680
+ jlcpcb_order_state_id: string | null;
681
+ jlcpcb_order_step_run_id: string;
682
+ step_function_name: string | null;
683
+ error_message: string | null;
684
+ }[];
685
+ }, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getNewestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "addPackageFile" | "getStarCount" | "getPackageFilesByReleaseId"> & {
686
+ addOrder: (order: Omit<Order, "order_id">) => Order;
687
+ getOrderById: (orderId: string) => Order | undefined;
688
+ getOrderFilesByOrderId: (orderId: string) => OrderFile[];
689
+ getJlcpcbOrderStatesByOrderId: (orderId: string) => JlcpcbOrderState | undefined;
690
+ getJlcpcbOrderStepRunsByJlcpcbOrderStateId: (jlcpcbOrderStateId: string) => JlcpcbOrderStepRun[];
691
+ updateOrder: (orderId: string, updates: Partial<Order>) => void;
692
+ addJlcpcbOrderState: (orderState: Omit<JlcpcbOrderState, "jlcpcb_order_state_id">) => JlcpcbOrderState;
693
+ updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
694
+ addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
695
+ getOrderFileById: (orderFileId: string) => OrderFile | undefined;
696
+ addAccount: (account: Omit<Account, "account_id"> & Partial<Pick<Account, "account_id">>) => {
697
+ github_username: string;
698
+ shippingInfo?: {
699
+ firstName: string;
700
+ lastName: string;
701
+ address: string;
702
+ city: string;
703
+ state: string;
704
+ zipCode: string;
705
+ country: string;
706
+ phone: string;
707
+ companyName?: string | undefined;
708
+ apartment?: string | undefined;
709
+ } | undefined;
710
+ account_id: string;
711
+ };
712
+ addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
713
+ getAccountPackageById: (accountPackageId: string) => AccountPackage | undefined;
714
+ updateAccountPackage: (accountPackageId: string, updates: Partial<AccountPackage>) => void;
715
+ deleteAccountPackage: (accountPackageId: string) => boolean;
716
+ addSnippet: (snippet: Omit<z.input<typeof snippetSchema>, "snippet_id" | "package_release_id">) => Snippet;
717
+ getNewestSnippets: (limit: number) => Snippet[];
718
+ getTrendingSnippets: (limit: number, since: string) => Snippet[];
719
+ getPackagesByAuthor: (authorName?: string) => Package[];
720
+ getSnippetByAuthorAndName: (authorName: string, snippetName: string) => Snippet | undefined;
721
+ updateSnippet: (snippetId: string, updates: Partial<Snippet>) => Snippet | undefined;
722
+ getSnippetById: (snippetId: string, auth?: {
723
+ github_username: string;
724
+ }) => Snippet | undefined;
725
+ searchSnippets: (query: string) => Snippet[];
726
+ deleteSnippet: (snippetId: string) => boolean;
727
+ addSession: (session: Omit<Session, "session_id">) => Session;
728
+ getSessions: ({ account_id, is_cli_session, }: {
729
+ account_id: string;
730
+ is_cli_session?: boolean;
731
+ }) => Session[];
732
+ createLoginPage: () => LoginPage;
733
+ getLoginPage: (loginPageId: string) => LoginPage | undefined;
734
+ updateLoginPage: (loginPageId: string, updates: Partial<LoginPage>) => void;
735
+ getAccount: (accountId: string) => Account | undefined;
736
+ updateAccount: (accountId: string, updates: Partial<Account>) => Account | undefined;
737
+ createSession: (session: Omit<Session, "session_id">) => Session;
738
+ addStar: (accountId: string, packageId: string) => AccountPackage;
739
+ removeStar: (accountId: string, packageId: string) => void;
740
+ hasStarred: (accountId: string, packageId: string) => boolean;
741
+ addPackage: (_package: Omit<z.input<typeof packageSchema>, "package_id">) => Package;
742
+ updatePackage: (packageId: string, updates: Partial<Package>) => Package | undefined;
743
+ getPackageById: (packageId: string) => Package | undefined;
744
+ getPackageReleaseById: (packageReleaseId: string) => PackageRelease | undefined;
745
+ addPackageRelease: (packageRelease: Omit<PackageRelease, "package_release_id">) => PackageRelease;
746
+ updatePackageRelease: (packageRelease: PackageRelease) => void;
747
+ addPackageFile: (packageFile: Omit<PackageFile, "package_file_id">) => PackageFile;
748
+ getStarCount: (packageId: string) => number;
749
+ getPackageFilesByReleaseId: (packageReleaseId: string) => PackageFile[];
750
+ }> & Omit<{
751
+ idCounter: number;
752
+ snippets: {
753
+ code: string;
754
+ snippet_id: string;
755
+ package_release_id: string;
756
+ name: string;
757
+ unscoped_name: string;
758
+ owner_name: string;
759
+ is_starred: boolean;
760
+ created_at: string;
761
+ updated_at: string;
762
+ snippet_type: "board" | "package" | "model" | "footprint";
763
+ version: string;
764
+ star_count: number;
765
+ is_private: boolean;
766
+ is_public: boolean;
767
+ is_unlisted: boolean;
768
+ dts?: string | undefined;
769
+ compiled_js?: string | null | undefined;
770
+ circuit_json?: Record<string, any>[] | null | undefined;
771
+ manual_edits_json_content?: string | null | undefined;
772
+ description?: string | undefined;
773
+ }[];
774
+ packageReleases: {
775
+ package_release_id: string;
776
+ created_at: string;
777
+ version: string | null;
778
+ package_id: string;
779
+ is_locked: boolean;
780
+ is_latest: boolean;
781
+ commit_sha?: string | null | undefined;
782
+ license?: string | null | undefined;
783
+ }[];
784
+ packageFiles: {
785
+ package_release_id: string;
786
+ created_at: string;
787
+ package_file_id: string;
788
+ file_path: string;
789
+ content_text?: string | null | undefined;
790
+ }[];
791
+ sessions: {
792
+ session_id: string;
793
+ account_id: string;
794
+ expires_at: string;
795
+ is_cli_session: boolean;
796
+ }[];
797
+ loginPages: {
798
+ created_at: string;
799
+ expires_at: string;
800
+ login_page_id: string;
801
+ login_page_auth_token: string;
802
+ was_login_successful: boolean;
803
+ has_been_used_to_create_session: boolean;
804
+ }[];
805
+ accounts: {
806
+ account_id: string;
807
+ github_username: string;
808
+ shippingInfo?: {
809
+ firstName: string;
810
+ lastName: string;
811
+ address: string;
812
+ city: string;
813
+ state: string;
814
+ zipCode: string;
815
+ country: string;
816
+ phone: string;
817
+ companyName?: string | undefined;
818
+ apartment?: string | undefined;
819
+ } | undefined;
820
+ }[];
821
+ packages: {
822
+ name: string;
823
+ unscoped_name: string;
824
+ created_at: string;
825
+ updated_at: string;
826
+ description: string | null;
827
+ star_count: number;
828
+ is_private: boolean | null;
829
+ is_public: boolean | null;
830
+ is_unlisted: boolean | null;
831
+ package_id: string;
832
+ license: string | null;
833
+ creator_account_id: string;
834
+ owner_org_id: string;
835
+ owner_github_username: string | null;
836
+ is_snippet: boolean;
837
+ is_board: boolean;
838
+ is_package: boolean;
839
+ is_model: boolean;
840
+ is_footprint: boolean;
841
+ is_source_from_github: boolean;
842
+ latest_package_release_id: string | null;
843
+ latest_version: string | null;
844
+ ai_description: string | null;
845
+ snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
846
+ }[];
847
+ orders: {
848
+ error: z.objectOutputType<{
849
+ error_code: z.ZodString;
850
+ message: z.ZodString;
851
+ }, z.ZodTypeAny, "passthrough"> | null;
852
+ created_at: string;
853
+ account_id: string | null;
854
+ order_id: string;
855
+ is_running: boolean;
856
+ is_started: boolean;
857
+ is_finished: boolean;
858
+ has_error: boolean;
859
+ started_at: string | null;
860
+ completed_at: string | null;
861
+ circuit_json?: any;
862
+ }[];
863
+ orderFiles: {
864
+ order_id: string;
865
+ order_file_id: string;
866
+ is_gerbers_zip: boolean;
867
+ content_type: string;
868
+ for_provider: string | null;
869
+ uploaded_at: string;
870
+ content_text: string | null;
871
+ content_bytes: Uint8Array<ArrayBuffer> | null;
872
+ }[];
873
+ accountSnippets: {
874
+ snippet_id: string;
875
+ created_at: string;
876
+ updated_at: string;
877
+ account_id: string;
878
+ has_starred: boolean;
879
+ }[];
880
+ accountPackages: {
881
+ is_starred: boolean;
882
+ created_at: string;
883
+ updated_at: string;
884
+ account_id: string;
885
+ account_package_id: string;
886
+ package_id: string;
887
+ }[];
888
+ jlcpcbOrderState: {
889
+ created_at: string;
890
+ order_id: string;
891
+ jlcpcb_order_state_id: string;
892
+ are_gerbers_uploaded: boolean;
893
+ is_gerber_analyzed: boolean;
894
+ are_initial_costs_calculated: boolean;
895
+ is_pcb_added_to_cart: boolean;
896
+ is_bom_uploaded: boolean;
897
+ is_pnp_uploaded: boolean;
898
+ is_bom_pnp_analyzed: boolean;
899
+ is_bom_parsing_complete: boolean;
900
+ are_components_available: boolean;
901
+ is_patch_map_generated: boolean;
902
+ is_json_merge_file_created: boolean;
903
+ is_dfm_result_generated: boolean;
904
+ are_files_downloaded: boolean;
905
+ are_product_categories_fetched: boolean;
906
+ are_final_costs_calculated: boolean;
907
+ is_json_merge_file_updated: boolean;
908
+ is_added_to_cart: boolean;
909
+ are_gerbers_generated: boolean;
910
+ current_step: string | null;
911
+ uploaded_gerber_metadata?: any;
912
+ gerber_analysis?: any;
913
+ }[];
914
+ jlcpcbOrderStepRuns: {
915
+ created_at: string;
916
+ is_running: boolean | null;
917
+ jlcpcb_order_state_id: string | null;
918
+ jlcpcb_order_step_run_id: string;
919
+ step_function_name: string | null;
920
+ error_message: string | null;
921
+ }[];
922
+ }, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getNewestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "addPackageFile" | "getStarCount" | "getPackageFilesByReleaseId"> & {
923
+ addOrder: (order: Omit<Order, "order_id">) => Order;
924
+ getOrderById: (orderId: string) => Order | undefined;
925
+ getOrderFilesByOrderId: (orderId: string) => OrderFile[];
926
+ getJlcpcbOrderStatesByOrderId: (orderId: string) => JlcpcbOrderState | undefined;
927
+ getJlcpcbOrderStepRunsByJlcpcbOrderStateId: (jlcpcbOrderStateId: string) => JlcpcbOrderStepRun[];
928
+ updateOrder: (orderId: string, updates: Partial<Order>) => void;
929
+ addJlcpcbOrderState: (orderState: Omit<JlcpcbOrderState, "jlcpcb_order_state_id">) => JlcpcbOrderState;
930
+ updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
931
+ addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
932
+ getOrderFileById: (orderFileId: string) => OrderFile | undefined;
933
+ addAccount: (account: Omit<Account, "account_id"> & Partial<Pick<Account, "account_id">>) => {
934
+ github_username: string;
935
+ shippingInfo?: {
936
+ firstName: string;
937
+ lastName: string;
938
+ address: string;
939
+ city: string;
940
+ state: string;
941
+ zipCode: string;
942
+ country: string;
943
+ phone: string;
944
+ companyName?: string | undefined;
945
+ apartment?: string | undefined;
946
+ } | undefined;
947
+ account_id: string;
948
+ };
949
+ addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
950
+ getAccountPackageById: (accountPackageId: string) => AccountPackage | undefined;
951
+ updateAccountPackage: (accountPackageId: string, updates: Partial<AccountPackage>) => void;
952
+ deleteAccountPackage: (accountPackageId: string) => boolean;
953
+ addSnippet: (snippet: Omit<z.input<typeof snippetSchema>, "snippet_id" | "package_release_id">) => Snippet;
954
+ getNewestSnippets: (limit: number) => Snippet[];
955
+ getTrendingSnippets: (limit: number, since: string) => Snippet[];
956
+ getPackagesByAuthor: (authorName?: string) => Package[];
957
+ getSnippetByAuthorAndName: (authorName: string, snippetName: string) => Snippet | undefined;
958
+ updateSnippet: (snippetId: string, updates: Partial<Snippet>) => Snippet | undefined;
959
+ getSnippetById: (snippetId: string, auth?: {
960
+ github_username: string;
961
+ }) => Snippet | undefined;
962
+ searchSnippets: (query: string) => Snippet[];
963
+ deleteSnippet: (snippetId: string) => boolean;
964
+ addSession: (session: Omit<Session, "session_id">) => Session;
965
+ getSessions: ({ account_id, is_cli_session, }: {
966
+ account_id: string;
967
+ is_cli_session?: boolean;
968
+ }) => Session[];
969
+ createLoginPage: () => LoginPage;
970
+ getLoginPage: (loginPageId: string) => LoginPage | undefined;
971
+ updateLoginPage: (loginPageId: string, updates: Partial<LoginPage>) => void;
972
+ getAccount: (accountId: string) => Account | undefined;
973
+ updateAccount: (accountId: string, updates: Partial<Account>) => Account | undefined;
974
+ createSession: (session: Omit<Session, "session_id">) => Session;
975
+ addStar: (accountId: string, packageId: string) => AccountPackage;
976
+ removeStar: (accountId: string, packageId: string) => void;
977
+ hasStarred: (accountId: string, packageId: string) => boolean;
978
+ addPackage: (_package: Omit<z.input<typeof packageSchema>, "package_id">) => Package;
979
+ updatePackage: (packageId: string, updates: Partial<Package>) => Package | undefined;
980
+ getPackageById: (packageId: string) => Package | undefined;
981
+ getPackageReleaseById: (packageReleaseId: string) => PackageRelease | undefined;
982
+ addPackageRelease: (packageRelease: Omit<PackageRelease, "package_release_id">) => PackageRelease;
983
+ updatePackageRelease: (packageRelease: PackageRelease) => void;
984
+ addPackageFile: (packageFile: Omit<PackageFile, "package_file_id">) => PackageFile;
985
+ getStarCount: (packageId: string) => number;
986
+ getPackageFilesByReleaseId: (packageReleaseId: string) => PackageFile[];
987
+ };
988
+ type DbClient = ReturnType<typeof createDatabase>;
989
+
990
+ declare const seed: (db: DbClient) => void;
991
+
992
+ declare const withDb: Middleware<{}, {
993
+ db: DbClient;
994
+ }>;
995
+
996
+ export { type DbClient, createDatabase, seed, withDb };