@tscircuit/fake-snippets 0.0.108 → 0.0.110
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/.github/workflows/bun-formatcheck.yml +2 -2
- package/.github/workflows/bun-pver-release.yml +3 -3
- package/.github/workflows/bun-test.yml +1 -1
- package/.github/workflows/bun-typecheck.yml +2 -2
- package/.github/workflows/update-snapshots.yml +1 -1
- package/README.md +4 -0
- package/api/generated-index.js +37 -3
- package/biome.json +2 -1
- package/bun-tests/fake-snippets-api/fixtures/get-test-server.ts +31 -3
- package/bun-tests/fake-snippets-api/fixtures/preload.ts +18 -0
- package/bun-tests/fake-snippets-api/routes/orgs/add_member.test.ts +26 -0
- package/bun-tests/fake-snippets-api/routes/orgs/create.test.ts +37 -0
- package/bun-tests/fake-snippets-api/routes/orgs/get.test.ts +52 -0
- package/bun-tests/fake-snippets-api/routes/orgs/list.test.ts +17 -0
- package/bun-tests/fake-snippets-api/routes/orgs/list_members.test.ts +23 -0
- package/bun-tests/fake-snippets-api/routes/orgs/remove_member.test.ts +81 -0
- package/bun-tests/fake-snippets-api/routes/orgs/update.test.ts +99 -0
- package/bun-tests/fake-snippets-api/routes/package_builds/get.test.ts +1 -1
- package/bun-tests/fake-snippets-api/routes/package_files/create.test.ts +15 -13
- package/bun-tests/fake-snippets-api/routes/package_files/create_or_update.test.ts +26 -24
- package/bun-tests/fake-snippets-api/routes/package_files/delete.test.ts +9 -9
- package/bun-tests/fake-snippets-api/routes/package_files/download.test.ts +4 -4
- package/bun-tests/fake-snippets-api/routes/package_files/get.test.ts +38 -28
- package/bun-tests/fake-snippets-api/routes/package_files/list.test.ts +23 -15
- package/bun-tests/fake-snippets-api/routes/package_releases/create.test.ts +33 -0
- package/bun-tests/fake-snippets-api/routes/package_releases/get.test.ts +4 -4
- package/bun-tests/fake-snippets-api/routes/package_releases/get_image_generation_fields.test.ts +38 -0
- package/bun-tests/fake-snippets-api/routes/packages/create.test.ts +19 -0
- package/bun-tests/fake-snippets-api/routes/packages/fork.test.ts +3 -4
- package/bun-tests/fake-snippets-api/routes/packages/get.test.ts +30 -0
- package/bun-tests/fake-snippets-api/routes/packages/images.test.ts +4 -2
- package/bun-tests/fake-snippets-api/routes/packages/list-1.test.ts +34 -0
- package/bun.lock +389 -450
- package/bunfig.toml +2 -1
- package/dist/bundle.js +1255 -625
- package/dist/index.d.ts +296 -4
- package/dist/index.js +325 -24
- package/dist/schema.d.ts +282 -1
- package/dist/schema.js +54 -2
- package/fake-snippets-api/lib/db/autoload-dev-packages.ts +31 -20
- package/fake-snippets-api/lib/db/db-client.ts +214 -3
- package/fake-snippets-api/lib/db/schema.ts +62 -0
- package/fake-snippets-api/lib/db/seed.ts +100 -0
- package/fake-snippets-api/lib/middleware/with-session-auth.ts +1 -1
- package/fake-snippets-api/lib/package_file/get-package-file-id-from-file-descriptor.ts +2 -2
- package/fake-snippets-api/lib/public-mapping/public-map-org.ts +32 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package-build.ts +10 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package-release.ts +17 -0
- package/fake-snippets-api/routes/api/orgs/add_member.ts +52 -0
- package/fake-snippets-api/routes/api/orgs/create.ts +46 -0
- package/fake-snippets-api/routes/api/orgs/get.ts +39 -0
- package/fake-snippets-api/routes/api/orgs/list.ts +31 -0
- package/fake-snippets-api/routes/api/orgs/list_members.ts +67 -0
- package/fake-snippets-api/routes/api/orgs/remove_member.ts +46 -0
- package/fake-snippets-api/routes/api/orgs/update.ts +93 -0
- package/fake-snippets-api/routes/api/package_files/get.ts +3 -6
- package/fake-snippets-api/routes/api/package_files/list.ts +7 -4
- package/fake-snippets-api/routes/api/packages/create.ts +54 -10
- package/fake-snippets-api/routes/api/packages/get.ts +23 -0
- package/fake-snippets-api/routes/api/packages/images/[owner_github_username]/[unscoped_name]/[view_format].ts +13 -11
- package/fake-snippets-api/routes/api/packages/list.ts +29 -2
- package/fake-snippets-api/routes/api/packages/update_ai_description.ts +37 -0
- package/package.json +27 -24
- package/renovate.json +1 -1
- package/scripts/generate-sitemap.ts +1 -1
- package/src/App.tsx +29 -10
- package/src/ContextProviders.tsx +25 -2
- package/src/components/CircuitJsonImportDialog.tsx +1 -1
- package/src/components/CmdKMenu.tsx +281 -247
- package/src/components/DownloadButtonAndMenu.tsx +133 -36
- package/src/components/FileSidebar.tsx +41 -50
- package/src/components/Footer.tsx +8 -10
- package/src/components/Header.tsx +19 -32
- package/src/components/Header2.tsx +16 -32
- package/src/components/HeaderDropdown.tsx +13 -8
- package/src/components/HeaderLogin.tsx +44 -16
- package/src/components/HiddenFilesDropdown.tsx +0 -2
- package/src/components/NotFound.tsx +5 -5
- package/src/components/PackageBreadcrumb.tsx +6 -12
- package/src/components/PackageCard.tsx +0 -1
- package/src/components/PackageSearchResults.tsx +1 -1
- package/src/components/PrefetchPageLink.tsx +7 -1
- package/src/components/ProfileRouter.tsx +32 -0
- package/src/components/SearchComponent.tsx +12 -8
- package/src/components/UserCard.tsx +80 -0
- package/src/components/ViewPackagePage/components/ShikiCodeViewer.tsx +20 -11
- package/src/components/ViewPackagePage/components/build-status.tsx +1 -1
- package/src/components/ViewPackagePage/components/important-files-view.tsx +174 -87
- package/src/components/ViewPackagePage/components/main-content-header.tsx +8 -4
- package/src/components/ViewPackagePage/components/main-content-view-selector.tsx +1 -2
- package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +54 -20
- package/src/components/ViewPackagePage/components/package-header.tsx +26 -37
- package/src/components/ViewPackagePage/components/preview-image-squares.tsx +11 -19
- package/src/components/ViewPackagePage/components/repo-page-content.tsx +33 -25
- package/src/components/ViewPackagePage/components/sidebar-about-section.tsx +16 -10
- package/src/components/ViewPackagePage/components/sidebar-releases-section.tsx +11 -11
- package/src/components/ViewPackagePage/components/sidebar.tsx +0 -2
- package/src/components/ViewPackagePage/components/tab-views/files-view.tsx +18 -17
- package/src/components/ViewPackagePage/components/tab-views/pcb-view.tsx +1 -2
- package/src/components/ViewPackagePage/components/tab-views/schematic-view.tsx +2 -1
- package/src/components/ViewPackagePage/components/theme-toggle.tsx +0 -2
- package/src/components/ViewPackagePage/hooks/use-toast.tsx +0 -1
- package/src/components/dialogs/GitHubRepositorySelector.tsx +56 -49
- package/src/components/dialogs/edit-package-details-dialog.tsx +5 -6
- package/src/components/dialogs/import-component-dialog.tsx +16 -9
- package/src/components/dialogs/import-package-dialog.tsx +3 -2
- package/src/components/dialogs/new-package-save-prompt-dialog.tsx +190 -0
- package/src/components/organization/OrganizationCard.tsx +204 -0
- package/src/components/organization/OrganizationCardSkeleton.tsx +55 -0
- package/src/components/organization/OrganizationHeader.tsx +154 -0
- package/src/components/organization/OrganizationMembers.tsx +146 -0
- package/src/components/package-port/CodeAndPreview.tsx +32 -46
- package/src/components/package-port/CodeEditor.tsx +28 -31
- package/src/components/package-port/CodeEditorHeader.tsx +128 -63
- package/src/components/package-port/EditorNav.tsx +32 -49
- package/src/components/preview/ConnectedPackagesList.tsx +8 -8
- package/src/components/preview/ConnectedRepoOverview.tsx +102 -2
- package/src/components/preview/PackageReleasesDashboard.tsx +53 -36
- package/src/components/ui/tree-view.tsx +6 -3
- package/src/hooks/use-add-org-member-mutation.ts +51 -0
- package/src/hooks/use-create-org-mutation.ts +38 -0
- package/src/hooks/use-create-package-mutation.ts +3 -0
- package/src/hooks/use-current-package-id.ts +5 -30
- package/src/hooks/use-current-package-info.ts +29 -5
- package/src/hooks/use-current-package-release.ts +4 -3
- package/src/hooks/use-download-zip.ts +2 -2
- package/src/hooks/use-global-store.ts +6 -4
- package/src/hooks/use-jlcpcb-component-import.tsx +164 -0
- package/src/hooks/use-list-org-members.ts +27 -0
- package/src/hooks/use-list-user-orgs.ts +25 -0
- package/src/hooks/use-org-by-github-handle.ts +26 -0
- package/src/hooks/use-org.ts +24 -0
- package/src/hooks/use-organization.ts +42 -0
- package/src/hooks/use-package-as-snippet.ts +4 -2
- package/src/hooks/use-package-builds.ts +6 -2
- package/src/hooks/use-package-files.ts +5 -3
- package/src/hooks/use-package-release-by-id-or-version.ts +29 -20
- package/src/hooks/use-package-release-images.ts +105 -0
- package/src/hooks/use-package-release.ts +2 -2
- package/src/hooks/use-package-stars.ts +80 -4
- package/src/hooks/use-preview-images.ts +6 -3
- package/src/hooks/use-remove-org-member-mutation.ts +32 -0
- package/src/hooks/use-update-ai-description-mutation.ts +42 -0
- package/src/hooks/use-update-org-mutation.ts +41 -0
- package/src/hooks/use-warn-user-on-page-change.ts +71 -4
- package/src/hooks/useFileManagement.ts +183 -35
- package/src/hooks/useOptimizedPackageFilesLoader.ts +136 -0
- package/src/hooks/usePackageFilesLoader.ts +2 -2
- package/src/hooks/useUpdatePackageFilesMutation.ts +15 -1
- package/src/lib/download-fns/download-circuit-png.ts +11 -3
- package/src/lib/download-fns/download-gltf-from-circuit-json.ts +44 -0
- package/src/lib/download-fns/download-kicad-files.ts +12 -11
- package/src/lib/normalize-svg-for-tile.ts +50 -0
- package/src/lib/posthog.ts +11 -9
- package/src/lib/react-query-api-failure-tracking.ts +148 -0
- package/src/lib/sentry.ts +14 -0
- package/src/lib/templates/blank-circuit-board-template.ts +0 -4
- package/src/lib/ts-lib-cache.ts +122 -7
- package/src/lib/utils/checkIfManualEditsImported.ts +4 -4
- package/src/lib/utils/findTargetFile.ts +45 -10
- package/src/lib/utils/isComponentExported.ts +10 -0
- package/src/main.tsx +2 -1
- package/src/pages/authorize.tsx +0 -2
- package/src/pages/create-organization.tsx +168 -0
- package/src/pages/dashboard.tsx +38 -6
- package/src/pages/datasheet.tsx +1 -1
- package/src/pages/datasheets.tsx +3 -3
- package/src/pages/editor.tsx +4 -6
- package/src/pages/landing.tsx +6 -7
- package/src/pages/latest.tsx +3 -0
- package/src/pages/organization-profile.tsx +199 -0
- package/src/pages/organization-settings.tsx +566 -0
- package/src/pages/package-editor.tsx +21 -21
- package/src/pages/preview-release.tsx +76 -136
- package/src/pages/quickstart.tsx +159 -123
- package/src/pages/release-detail.tsx +119 -31
- package/src/pages/search.tsx +192 -57
- package/src/pages/settings-redirect.tsx +44 -0
- package/src/pages/trending.tsx +29 -20
- package/src/pages/user-profile.tsx +58 -7
- package/src/pages/view-package.tsx +21 -26
- package/vite.config.ts +9 -0
- package/fake-snippets-api/routes/api/autocomplete/create_autocomplete.ts +0 -133
- package/src/components/Footer2.tsx +0 -100
- package/src/components/JLCPCBImportDialog.tsx +0 -280
- package/src/components/PackageBuildsPage/LogContent.tsx +0 -72
- package/src/components/PackageBuildsPage/PackageBuildDetailsPage.tsx +0 -115
- package/src/components/PackageBuildsPage/build-preview-content.tsx +0 -27
- package/src/components/PackageBuildsPage/collapsible-section.tsx +0 -63
- package/src/components/PackageBuildsPage/package-build-details-panel.tsx +0 -166
- package/src/components/PackageBuildsPage/package-build-header.tsx +0 -79
- package/src/components/PageSearchComponent.tsx +0 -148
- package/src/components/ShippingInformationForm.tsx +0 -423
- package/src/components/StaticViewSnippetHeader.tsx +0 -70
- package/src/components/ViewPackagePage/components/file-explorer.tsx +0 -67
- package/src/components/ViewPackagePage/components/readme-view.tsx +0 -58
- package/src/components/ViewPackagePage/components/repo-header-button.tsx +0 -36
- package/src/components/ViewPackagePage/components/repo-header.tsx +0 -4
- package/src/components/ViewPackagePage/components/sidebar-contributors-section.tsx +0 -31
- package/src/components/ViewSnippetHeader.tsx +0 -181
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/pages/package-builds.tsx +0 -33
- package/src/pages/settings.tsx +0 -25
package/dist/index.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ declare const accountSchema: z.ZodObject<{
|
|
|
150
150
|
companyName?: string | undefined;
|
|
151
151
|
apartment?: string | undefined;
|
|
152
152
|
}>>;
|
|
153
|
+
personal_org_id: z.ZodOptional<z.ZodString>;
|
|
153
154
|
}, "strip", z.ZodTypeAny, {
|
|
154
155
|
account_id: string;
|
|
155
156
|
github_username: string;
|
|
@@ -165,6 +166,7 @@ declare const accountSchema: z.ZodObject<{
|
|
|
165
166
|
companyName?: string | undefined;
|
|
166
167
|
apartment?: string | undefined;
|
|
167
168
|
} | undefined;
|
|
169
|
+
personal_org_id?: string | undefined;
|
|
168
170
|
}, {
|
|
169
171
|
account_id: string;
|
|
170
172
|
github_username: string;
|
|
@@ -180,6 +182,7 @@ declare const accountSchema: z.ZodObject<{
|
|
|
180
182
|
companyName?: string | undefined;
|
|
181
183
|
apartment?: string | undefined;
|
|
182
184
|
} | undefined;
|
|
185
|
+
personal_org_id?: string | undefined;
|
|
183
186
|
}>;
|
|
184
187
|
type Account = z.infer<typeof accountSchema>;
|
|
185
188
|
declare const orderSchema: z.ZodObject<{
|
|
@@ -512,6 +515,14 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
512
515
|
circuit_json_build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
516
|
circuit_json_build_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
514
517
|
circuit_json_build_is_stale: z.ZodDefault<z.ZodBoolean>;
|
|
518
|
+
image_generation_display_status: z.ZodDefault<z.ZodEnum<["pending", "building", "complete", "error"]>>;
|
|
519
|
+
image_generation_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
520
|
+
image_generation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
521
|
+
image_generation_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
522
|
+
image_generation_logs: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
523
|
+
image_generation_is_stale: z.ZodDefault<z.ZodBoolean>;
|
|
524
|
+
image_generation_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
525
|
+
image_generation_error_last_updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
515
526
|
ai_review_text: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
516
527
|
ai_review_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
517
528
|
ai_review_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -541,6 +552,10 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
541
552
|
circuit_json_build_in_progress: boolean;
|
|
542
553
|
circuit_json_build_logs: any[];
|
|
543
554
|
circuit_json_build_is_stale: boolean;
|
|
555
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
556
|
+
image_generation_in_progress: boolean;
|
|
557
|
+
image_generation_logs: any[] | null;
|
|
558
|
+
image_generation_is_stale: boolean;
|
|
544
559
|
ai_review_requested: boolean;
|
|
545
560
|
is_pr_preview: boolean;
|
|
546
561
|
ai_review_text?: string | null | undefined;
|
|
@@ -555,6 +570,10 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
555
570
|
transpilation_completed_at?: string | null | undefined;
|
|
556
571
|
circuit_json_build_started_at?: string | null | undefined;
|
|
557
572
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
573
|
+
image_generation_started_at?: string | null | undefined;
|
|
574
|
+
image_generation_completed_at?: string | null | undefined;
|
|
575
|
+
image_generation_error?: string | null | undefined;
|
|
576
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
558
577
|
ai_review_started_at?: string | null | undefined;
|
|
559
578
|
ai_review_completed_at?: string | null | undefined;
|
|
560
579
|
ai_review_error?: any;
|
|
@@ -593,6 +612,14 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
593
612
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
594
613
|
circuit_json_build_logs?: any[] | undefined;
|
|
595
614
|
circuit_json_build_is_stale?: boolean | undefined;
|
|
615
|
+
image_generation_display_status?: "error" | "pending" | "building" | "complete" | undefined;
|
|
616
|
+
image_generation_in_progress?: boolean | undefined;
|
|
617
|
+
image_generation_started_at?: string | null | undefined;
|
|
618
|
+
image_generation_completed_at?: string | null | undefined;
|
|
619
|
+
image_generation_logs?: any[] | null | undefined;
|
|
620
|
+
image_generation_is_stale?: boolean | undefined;
|
|
621
|
+
image_generation_error?: string | null | undefined;
|
|
622
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
596
623
|
ai_review_started_at?: string | null | undefined;
|
|
597
624
|
ai_review_completed_at?: string | null | undefined;
|
|
598
625
|
ai_review_error?: any;
|
|
@@ -667,6 +694,7 @@ declare const packageSchema: z.ZodObject<{
|
|
|
667
694
|
latest_package_release_fs_sha: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
668
695
|
default_view: z.ZodOptional<z.ZodDefault<z.ZodEnum<["files", "3d", "pcb", "schematic"]>>>;
|
|
669
696
|
allow_pr_previews: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
697
|
+
is_starred: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
670
698
|
}, "strip", z.ZodTypeAny, {
|
|
671
699
|
name: string;
|
|
672
700
|
unscoped_name: string;
|
|
@@ -695,6 +723,7 @@ declare const packageSchema: z.ZodObject<{
|
|
|
695
723
|
website: string | null;
|
|
696
724
|
ai_usage_instructions: string | null;
|
|
697
725
|
latest_package_release_fs_sha: string | null;
|
|
726
|
+
is_starred?: boolean | undefined;
|
|
698
727
|
snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
|
|
699
728
|
latest_license?: string | null | undefined;
|
|
700
729
|
default_view?: "files" | "3d" | "pcb" | "schematic" | undefined;
|
|
@@ -715,6 +744,7 @@ declare const packageSchema: z.ZodObject<{
|
|
|
715
744
|
latest_package_release_id: string | null;
|
|
716
745
|
latest_version: string | null;
|
|
717
746
|
ai_usage_instructions: string | null;
|
|
747
|
+
is_starred?: boolean | undefined;
|
|
718
748
|
snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
|
|
719
749
|
star_count?: number | undefined;
|
|
720
750
|
is_private?: boolean | null | undefined;
|
|
@@ -847,6 +877,11 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
847
877
|
circuit_json_build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
848
878
|
circuit_json_build_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
849
879
|
circuit_json_build_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
880
|
+
image_generation_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
881
|
+
image_generation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
882
|
+
image_generation_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
883
|
+
image_generation_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
884
|
+
image_generation_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
850
885
|
build_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
851
886
|
build_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
852
887
|
build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -861,6 +896,8 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
861
896
|
transpilation_logs: any[];
|
|
862
897
|
circuit_json_build_in_progress: boolean;
|
|
863
898
|
circuit_json_build_logs: any[];
|
|
899
|
+
image_generation_in_progress: boolean;
|
|
900
|
+
image_generation_logs: any[];
|
|
864
901
|
package_build_id: string;
|
|
865
902
|
build_in_progress: boolean;
|
|
866
903
|
build_error_last_updated_at: string;
|
|
@@ -870,6 +907,9 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
870
907
|
transpilation_completed_at?: string | null | undefined;
|
|
871
908
|
circuit_json_build_started_at?: string | null | undefined;
|
|
872
909
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
910
|
+
image_generation_started_at?: string | null | undefined;
|
|
911
|
+
image_generation_completed_at?: string | null | undefined;
|
|
912
|
+
image_generation_error?: string | null | undefined;
|
|
873
913
|
build_started_at?: string | null | undefined;
|
|
874
914
|
build_completed_at?: string | null | undefined;
|
|
875
915
|
build_error?: string | null | undefined;
|
|
@@ -890,6 +930,11 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
890
930
|
circuit_json_build_started_at?: string | null | undefined;
|
|
891
931
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
892
932
|
circuit_json_build_logs?: any[] | undefined;
|
|
933
|
+
image_generation_in_progress?: boolean | undefined;
|
|
934
|
+
image_generation_started_at?: string | null | undefined;
|
|
935
|
+
image_generation_completed_at?: string | null | undefined;
|
|
936
|
+
image_generation_logs?: any[] | undefined;
|
|
937
|
+
image_generation_error?: string | null | undefined;
|
|
893
938
|
build_in_progress?: boolean | undefined;
|
|
894
939
|
build_started_at?: string | null | undefined;
|
|
895
940
|
build_completed_at?: string | null | undefined;
|
|
@@ -898,6 +943,49 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
898
943
|
build_logs?: string | null | undefined;
|
|
899
944
|
}>;
|
|
900
945
|
type PackageBuild = z.infer<typeof packageBuildSchema>;
|
|
946
|
+
declare const orgSchema: z.ZodObject<{
|
|
947
|
+
org_id: z.ZodString;
|
|
948
|
+
github_handle: z.ZodString;
|
|
949
|
+
owner_account_id: z.ZodString;
|
|
950
|
+
is_personal_org: z.ZodDefault<z.ZodBoolean>;
|
|
951
|
+
created_at: z.ZodString;
|
|
952
|
+
org_display_name: z.ZodOptional<z.ZodString>;
|
|
953
|
+
}, "strip", z.ZodTypeAny, {
|
|
954
|
+
created_at: string;
|
|
955
|
+
org_id: string;
|
|
956
|
+
github_handle: string;
|
|
957
|
+
owner_account_id: string;
|
|
958
|
+
is_personal_org: boolean;
|
|
959
|
+
org_display_name?: string | undefined;
|
|
960
|
+
}, {
|
|
961
|
+
created_at: string;
|
|
962
|
+
org_id: string;
|
|
963
|
+
github_handle: string;
|
|
964
|
+
owner_account_id: string;
|
|
965
|
+
is_personal_org?: boolean | undefined;
|
|
966
|
+
org_display_name?: string | undefined;
|
|
967
|
+
}>;
|
|
968
|
+
type Organization = z.infer<typeof orgSchema>;
|
|
969
|
+
declare const orgAccountSchema: z.ZodObject<{
|
|
970
|
+
org_account_id: z.ZodString;
|
|
971
|
+
org_id: z.ZodString;
|
|
972
|
+
account_id: z.ZodString;
|
|
973
|
+
is_owner: z.ZodDefault<z.ZodBoolean>;
|
|
974
|
+
created_at: z.ZodString;
|
|
975
|
+
}, "strip", z.ZodTypeAny, {
|
|
976
|
+
created_at: string;
|
|
977
|
+
account_id: string;
|
|
978
|
+
org_id: string;
|
|
979
|
+
org_account_id: string;
|
|
980
|
+
is_owner: boolean;
|
|
981
|
+
}, {
|
|
982
|
+
created_at: string;
|
|
983
|
+
account_id: string;
|
|
984
|
+
org_id: string;
|
|
985
|
+
org_account_id: string;
|
|
986
|
+
is_owner?: boolean | undefined;
|
|
987
|
+
}>;
|
|
988
|
+
type OrgAccount = z.infer<typeof orgAccountSchema>;
|
|
901
989
|
|
|
902
990
|
declare const createDatabase: ({ seed }?: {
|
|
903
991
|
seed?: boolean;
|
|
@@ -944,6 +1032,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
944
1032
|
circuit_json_build_in_progress: boolean;
|
|
945
1033
|
circuit_json_build_logs: any[];
|
|
946
1034
|
circuit_json_build_is_stale: boolean;
|
|
1035
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
1036
|
+
image_generation_in_progress: boolean;
|
|
1037
|
+
image_generation_logs: any[] | null;
|
|
1038
|
+
image_generation_is_stale: boolean;
|
|
947
1039
|
ai_review_requested: boolean;
|
|
948
1040
|
is_pr_preview: boolean;
|
|
949
1041
|
ai_review_text?: string | null | undefined;
|
|
@@ -958,6 +1050,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
958
1050
|
transpilation_completed_at?: string | null | undefined;
|
|
959
1051
|
circuit_json_build_started_at?: string | null | undefined;
|
|
960
1052
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1053
|
+
image_generation_started_at?: string | null | undefined;
|
|
1054
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1055
|
+
image_generation_error?: string | null | undefined;
|
|
1056
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
961
1057
|
ai_review_started_at?: string | null | undefined;
|
|
962
1058
|
ai_review_completed_at?: string | null | undefined;
|
|
963
1059
|
ai_review_error?: any;
|
|
@@ -1007,6 +1103,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1007
1103
|
companyName?: string | undefined;
|
|
1008
1104
|
apartment?: string | undefined;
|
|
1009
1105
|
} | undefined;
|
|
1106
|
+
personal_org_id?: string | undefined;
|
|
1010
1107
|
}[];
|
|
1011
1108
|
packages: {
|
|
1012
1109
|
name: string;
|
|
@@ -1036,6 +1133,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1036
1133
|
website: string | null;
|
|
1037
1134
|
ai_usage_instructions: string | null;
|
|
1038
1135
|
latest_package_release_fs_sha: string | null;
|
|
1136
|
+
is_starred?: boolean | undefined;
|
|
1039
1137
|
snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
|
|
1040
1138
|
latest_license?: string | null | undefined;
|
|
1041
1139
|
default_view?: "files" | "3d" | "pcb" | "schematic" | undefined;
|
|
@@ -1057,6 +1155,21 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1057
1155
|
completed_at: string | null;
|
|
1058
1156
|
circuit_json?: any;
|
|
1059
1157
|
}[];
|
|
1158
|
+
organizations: {
|
|
1159
|
+
created_at: string;
|
|
1160
|
+
org_id: string;
|
|
1161
|
+
github_handle: string;
|
|
1162
|
+
owner_account_id: string;
|
|
1163
|
+
is_personal_org: boolean;
|
|
1164
|
+
org_display_name?: string | undefined;
|
|
1165
|
+
}[];
|
|
1166
|
+
orgAccounts: {
|
|
1167
|
+
created_at: string;
|
|
1168
|
+
account_id: string;
|
|
1169
|
+
org_id: string;
|
|
1170
|
+
org_account_id: string;
|
|
1171
|
+
is_owner: boolean;
|
|
1172
|
+
}[];
|
|
1060
1173
|
orderFiles: {
|
|
1061
1174
|
order_id: string;
|
|
1062
1175
|
order_file_id: string;
|
|
@@ -1188,6 +1301,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1188
1301
|
transpilation_logs: any[];
|
|
1189
1302
|
circuit_json_build_in_progress: boolean;
|
|
1190
1303
|
circuit_json_build_logs: any[];
|
|
1304
|
+
image_generation_in_progress: boolean;
|
|
1305
|
+
image_generation_logs: any[];
|
|
1191
1306
|
package_build_id: string;
|
|
1192
1307
|
build_in_progress: boolean;
|
|
1193
1308
|
build_error_last_updated_at: string;
|
|
@@ -1197,13 +1312,16 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1197
1312
|
transpilation_completed_at?: string | null | undefined;
|
|
1198
1313
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1199
1314
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1315
|
+
image_generation_started_at?: string | null | undefined;
|
|
1316
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1317
|
+
image_generation_error?: string | null | undefined;
|
|
1200
1318
|
build_started_at?: string | null | undefined;
|
|
1201
1319
|
build_completed_at?: string | null | undefined;
|
|
1202
1320
|
build_error?: string | null | undefined;
|
|
1203
1321
|
preview_url?: string | null | undefined;
|
|
1204
1322
|
build_logs?: string | null | undefined;
|
|
1205
1323
|
}[];
|
|
1206
|
-
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "deletePackageFile" | "addPackageFile" | "updatePackageFile" | "getStarCount" | "getPackageFilesByReleaseId" | "updatePackageReleaseFsSha" | "addAiReview" | "updateAiReview" | "getAiReviewById" | "listAiReviews" | "addDatasheet" | "getDatasheetById" | "getDatasheetByChipName" | "listDatasheets" | "updateDatasheet" | "addPackageBuild" | "getPackageBuildById" | "getPackageBuildsByReleaseId" | "updatePackageBuild"> & {
|
|
1324
|
+
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "deletePackageFile" | "addPackageFile" | "updatePackageFile" | "getStarCount" | "getPackageFilesByReleaseId" | "updatePackageReleaseFsSha" | "addAiReview" | "updateAiReview" | "getAiReviewById" | "listAiReviews" | "addDatasheet" | "getDatasheetById" | "getDatasheetByChipName" | "listDatasheets" | "updateDatasheet" | "addPackageBuild" | "getPackageBuildById" | "getPackageBuildsByReleaseId" | "updatePackageBuild" | "addOrganization" | "getOrgs" | "getOrg" | "addOrganizationAccount" | "getOrganizationAccount" | "getOrganizationAccounts" | "removeOrganizationAccount" | "updateOrganization"> & {
|
|
1207
1325
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
1208
1326
|
getOrderById: (orderId: string) => Order | undefined;
|
|
1209
1327
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -1234,6 +1352,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1234
1352
|
companyName?: string | undefined;
|
|
1235
1353
|
apartment?: string | undefined;
|
|
1236
1354
|
} | undefined;
|
|
1355
|
+
personal_org_id?: string | undefined;
|
|
1237
1356
|
account_id: string;
|
|
1238
1357
|
};
|
|
1239
1358
|
addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
|
|
@@ -1302,10 +1421,81 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1302
1421
|
is_popular?: boolean;
|
|
1303
1422
|
}) => Datasheet[];
|
|
1304
1423
|
updateDatasheet: (datasheetId: string, updates: Partial<Datasheet>) => Datasheet | undefined;
|
|
1305
|
-
addPackageBuild: (packageBuild: Omit<
|
|
1424
|
+
addPackageBuild: (packageBuild: Omit<z.input<typeof packageBuildSchema>, "package_build_id">) => PackageBuild;
|
|
1306
1425
|
getPackageBuildById: (packageBuildId: string) => PackageBuild | undefined;
|
|
1307
1426
|
getPackageBuildsByReleaseId: (packageReleaseId: string) => PackageBuild[];
|
|
1308
1427
|
updatePackageBuild: (packageBuildId: string, updates: Partial<PackageBuild>) => PackageBuild | undefined;
|
|
1428
|
+
addOrganization: (organization: {
|
|
1429
|
+
name: string;
|
|
1430
|
+
org_id?: string;
|
|
1431
|
+
is_personal_org?: boolean;
|
|
1432
|
+
owner_account_id: string;
|
|
1433
|
+
}) => {
|
|
1434
|
+
created_at: string;
|
|
1435
|
+
org_id: string;
|
|
1436
|
+
github_handle: string;
|
|
1437
|
+
owner_account_id: string;
|
|
1438
|
+
is_personal_org: boolean;
|
|
1439
|
+
org_display_name?: string | undefined;
|
|
1440
|
+
};
|
|
1441
|
+
getOrgs: (filters?: {
|
|
1442
|
+
owner_account_id?: string;
|
|
1443
|
+
github_handle?: string;
|
|
1444
|
+
name?: string;
|
|
1445
|
+
}, auth?: {
|
|
1446
|
+
account_id?: string;
|
|
1447
|
+
}) => {
|
|
1448
|
+
member_count: number;
|
|
1449
|
+
package_count: number;
|
|
1450
|
+
can_manage_org: boolean;
|
|
1451
|
+
created_at: string;
|
|
1452
|
+
org_id: string;
|
|
1453
|
+
github_handle: string;
|
|
1454
|
+
owner_account_id: string;
|
|
1455
|
+
is_personal_org: boolean;
|
|
1456
|
+
org_display_name?: string | undefined;
|
|
1457
|
+
}[];
|
|
1458
|
+
getOrg: (filters: {
|
|
1459
|
+
org_id?: string;
|
|
1460
|
+
org_name?: string;
|
|
1461
|
+
github_handle?: string;
|
|
1462
|
+
}, auth?: {
|
|
1463
|
+
account_id: string;
|
|
1464
|
+
}) => {
|
|
1465
|
+
member_count: number;
|
|
1466
|
+
package_count: number;
|
|
1467
|
+
can_manage_org: boolean;
|
|
1468
|
+
created_at: string;
|
|
1469
|
+
org_id: string;
|
|
1470
|
+
github_handle: string;
|
|
1471
|
+
owner_account_id: string;
|
|
1472
|
+
is_personal_org: boolean;
|
|
1473
|
+
org_display_name?: string | undefined;
|
|
1474
|
+
} | null;
|
|
1475
|
+
addOrganizationAccount: (organizationAccount: {
|
|
1476
|
+
org_id: string;
|
|
1477
|
+
account_id: string;
|
|
1478
|
+
is_owner?: boolean;
|
|
1479
|
+
}) => {
|
|
1480
|
+
created_at: string;
|
|
1481
|
+
account_id: string;
|
|
1482
|
+
org_id: string;
|
|
1483
|
+
org_account_id: string;
|
|
1484
|
+
is_owner: boolean;
|
|
1485
|
+
};
|
|
1486
|
+
getOrganizationAccount: (filters: {
|
|
1487
|
+
org_id?: string;
|
|
1488
|
+
account_id?: string;
|
|
1489
|
+
}) => OrgAccount | undefined;
|
|
1490
|
+
getOrganizationAccounts: (filters?: {
|
|
1491
|
+
org_id?: string;
|
|
1492
|
+
account_id?: string;
|
|
1493
|
+
}) => OrgAccount[];
|
|
1494
|
+
removeOrganizationAccount: (filters: {
|
|
1495
|
+
org_id: string;
|
|
1496
|
+
account_id: string;
|
|
1497
|
+
}) => boolean;
|
|
1498
|
+
updateOrganization: (orgId: string, updates: Partial<Organization>) => Organization | undefined;
|
|
1309
1499
|
}> & Omit<{
|
|
1310
1500
|
idCounter: number;
|
|
1311
1501
|
snippets: {
|
|
@@ -1349,6 +1539,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1349
1539
|
circuit_json_build_in_progress: boolean;
|
|
1350
1540
|
circuit_json_build_logs: any[];
|
|
1351
1541
|
circuit_json_build_is_stale: boolean;
|
|
1542
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
1543
|
+
image_generation_in_progress: boolean;
|
|
1544
|
+
image_generation_logs: any[] | null;
|
|
1545
|
+
image_generation_is_stale: boolean;
|
|
1352
1546
|
ai_review_requested: boolean;
|
|
1353
1547
|
is_pr_preview: boolean;
|
|
1354
1548
|
ai_review_text?: string | null | undefined;
|
|
@@ -1363,6 +1557,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1363
1557
|
transpilation_completed_at?: string | null | undefined;
|
|
1364
1558
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1365
1559
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1560
|
+
image_generation_started_at?: string | null | undefined;
|
|
1561
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1562
|
+
image_generation_error?: string | null | undefined;
|
|
1563
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
1366
1564
|
ai_review_started_at?: string | null | undefined;
|
|
1367
1565
|
ai_review_completed_at?: string | null | undefined;
|
|
1368
1566
|
ai_review_error?: any;
|
|
@@ -1412,6 +1610,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1412
1610
|
companyName?: string | undefined;
|
|
1413
1611
|
apartment?: string | undefined;
|
|
1414
1612
|
} | undefined;
|
|
1613
|
+
personal_org_id?: string | undefined;
|
|
1415
1614
|
}[];
|
|
1416
1615
|
packages: {
|
|
1417
1616
|
name: string;
|
|
@@ -1441,6 +1640,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1441
1640
|
website: string | null;
|
|
1442
1641
|
ai_usage_instructions: string | null;
|
|
1443
1642
|
latest_package_release_fs_sha: string | null;
|
|
1643
|
+
is_starred?: boolean | undefined;
|
|
1444
1644
|
snippet_type?: "board" | "package" | "model" | "footprint" | undefined;
|
|
1445
1645
|
latest_license?: string | null | undefined;
|
|
1446
1646
|
default_view?: "files" | "3d" | "pcb" | "schematic" | undefined;
|
|
@@ -1462,6 +1662,21 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1462
1662
|
completed_at: string | null;
|
|
1463
1663
|
circuit_json?: any;
|
|
1464
1664
|
}[];
|
|
1665
|
+
organizations: {
|
|
1666
|
+
created_at: string;
|
|
1667
|
+
org_id: string;
|
|
1668
|
+
github_handle: string;
|
|
1669
|
+
owner_account_id: string;
|
|
1670
|
+
is_personal_org: boolean;
|
|
1671
|
+
org_display_name?: string | undefined;
|
|
1672
|
+
}[];
|
|
1673
|
+
orgAccounts: {
|
|
1674
|
+
created_at: string;
|
|
1675
|
+
account_id: string;
|
|
1676
|
+
org_id: string;
|
|
1677
|
+
org_account_id: string;
|
|
1678
|
+
is_owner: boolean;
|
|
1679
|
+
}[];
|
|
1465
1680
|
orderFiles: {
|
|
1466
1681
|
order_id: string;
|
|
1467
1682
|
order_file_id: string;
|
|
@@ -1593,6 +1808,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1593
1808
|
transpilation_logs: any[];
|
|
1594
1809
|
circuit_json_build_in_progress: boolean;
|
|
1595
1810
|
circuit_json_build_logs: any[];
|
|
1811
|
+
image_generation_in_progress: boolean;
|
|
1812
|
+
image_generation_logs: any[];
|
|
1596
1813
|
package_build_id: string;
|
|
1597
1814
|
build_in_progress: boolean;
|
|
1598
1815
|
build_error_last_updated_at: string;
|
|
@@ -1602,13 +1819,16 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1602
1819
|
transpilation_completed_at?: string | null | undefined;
|
|
1603
1820
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1604
1821
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1822
|
+
image_generation_started_at?: string | null | undefined;
|
|
1823
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1824
|
+
image_generation_error?: string | null | undefined;
|
|
1605
1825
|
build_started_at?: string | null | undefined;
|
|
1606
1826
|
build_completed_at?: string | null | undefined;
|
|
1607
1827
|
build_error?: string | null | undefined;
|
|
1608
1828
|
preview_url?: string | null | undefined;
|
|
1609
1829
|
build_logs?: string | null | undefined;
|
|
1610
1830
|
}[];
|
|
1611
|
-
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "deletePackageFile" | "addPackageFile" | "updatePackageFile" | "getStarCount" | "getPackageFilesByReleaseId" | "updatePackageReleaseFsSha" | "addAiReview" | "updateAiReview" | "getAiReviewById" | "listAiReviews" | "addDatasheet" | "getDatasheetById" | "getDatasheetByChipName" | "listDatasheets" | "updateDatasheet" | "addPackageBuild" | "getPackageBuildById" | "getPackageBuildsByReleaseId" | "updatePackageBuild"> & {
|
|
1831
|
+
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "getJlcpcbOrderStatesByOrderId" | "getJlcpcbOrderStepRunsByJlcpcbOrderStateId" | "updateOrder" | "addJlcpcbOrderState" | "updateJlcpcbOrderState" | "addOrderFile" | "getOrderFileById" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "addStar" | "removeStar" | "hasStarred" | "addPackage" | "updatePackage" | "getPackageById" | "getPackageReleaseById" | "addPackageRelease" | "updatePackageRelease" | "deletePackageFile" | "addPackageFile" | "updatePackageFile" | "getStarCount" | "getPackageFilesByReleaseId" | "updatePackageReleaseFsSha" | "addAiReview" | "updateAiReview" | "getAiReviewById" | "listAiReviews" | "addDatasheet" | "getDatasheetById" | "getDatasheetByChipName" | "listDatasheets" | "updateDatasheet" | "addPackageBuild" | "getPackageBuildById" | "getPackageBuildsByReleaseId" | "updatePackageBuild" | "addOrganization" | "getOrgs" | "getOrg" | "addOrganizationAccount" | "getOrganizationAccount" | "getOrganizationAccounts" | "removeOrganizationAccount" | "updateOrganization"> & {
|
|
1612
1832
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
1613
1833
|
getOrderById: (orderId: string) => Order | undefined;
|
|
1614
1834
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -1639,6 +1859,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1639
1859
|
companyName?: string | undefined;
|
|
1640
1860
|
apartment?: string | undefined;
|
|
1641
1861
|
} | undefined;
|
|
1862
|
+
personal_org_id?: string | undefined;
|
|
1642
1863
|
account_id: string;
|
|
1643
1864
|
};
|
|
1644
1865
|
addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
|
|
@@ -1707,10 +1928,81 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1707
1928
|
is_popular?: boolean;
|
|
1708
1929
|
}) => Datasheet[];
|
|
1709
1930
|
updateDatasheet: (datasheetId: string, updates: Partial<Datasheet>) => Datasheet | undefined;
|
|
1710
|
-
addPackageBuild: (packageBuild: Omit<
|
|
1931
|
+
addPackageBuild: (packageBuild: Omit<z.input<typeof packageBuildSchema>, "package_build_id">) => PackageBuild;
|
|
1711
1932
|
getPackageBuildById: (packageBuildId: string) => PackageBuild | undefined;
|
|
1712
1933
|
getPackageBuildsByReleaseId: (packageReleaseId: string) => PackageBuild[];
|
|
1713
1934
|
updatePackageBuild: (packageBuildId: string, updates: Partial<PackageBuild>) => PackageBuild | undefined;
|
|
1935
|
+
addOrganization: (organization: {
|
|
1936
|
+
name: string;
|
|
1937
|
+
org_id?: string;
|
|
1938
|
+
is_personal_org?: boolean;
|
|
1939
|
+
owner_account_id: string;
|
|
1940
|
+
}) => {
|
|
1941
|
+
created_at: string;
|
|
1942
|
+
org_id: string;
|
|
1943
|
+
github_handle: string;
|
|
1944
|
+
owner_account_id: string;
|
|
1945
|
+
is_personal_org: boolean;
|
|
1946
|
+
org_display_name?: string | undefined;
|
|
1947
|
+
};
|
|
1948
|
+
getOrgs: (filters?: {
|
|
1949
|
+
owner_account_id?: string;
|
|
1950
|
+
github_handle?: string;
|
|
1951
|
+
name?: string;
|
|
1952
|
+
}, auth?: {
|
|
1953
|
+
account_id?: string;
|
|
1954
|
+
}) => {
|
|
1955
|
+
member_count: number;
|
|
1956
|
+
package_count: number;
|
|
1957
|
+
can_manage_org: boolean;
|
|
1958
|
+
created_at: string;
|
|
1959
|
+
org_id: string;
|
|
1960
|
+
github_handle: string;
|
|
1961
|
+
owner_account_id: string;
|
|
1962
|
+
is_personal_org: boolean;
|
|
1963
|
+
org_display_name?: string | undefined;
|
|
1964
|
+
}[];
|
|
1965
|
+
getOrg: (filters: {
|
|
1966
|
+
org_id?: string;
|
|
1967
|
+
org_name?: string;
|
|
1968
|
+
github_handle?: string;
|
|
1969
|
+
}, auth?: {
|
|
1970
|
+
account_id: string;
|
|
1971
|
+
}) => {
|
|
1972
|
+
member_count: number;
|
|
1973
|
+
package_count: number;
|
|
1974
|
+
can_manage_org: boolean;
|
|
1975
|
+
created_at: string;
|
|
1976
|
+
org_id: string;
|
|
1977
|
+
github_handle: string;
|
|
1978
|
+
owner_account_id: string;
|
|
1979
|
+
is_personal_org: boolean;
|
|
1980
|
+
org_display_name?: string | undefined;
|
|
1981
|
+
} | null;
|
|
1982
|
+
addOrganizationAccount: (organizationAccount: {
|
|
1983
|
+
org_id: string;
|
|
1984
|
+
account_id: string;
|
|
1985
|
+
is_owner?: boolean;
|
|
1986
|
+
}) => {
|
|
1987
|
+
created_at: string;
|
|
1988
|
+
account_id: string;
|
|
1989
|
+
org_id: string;
|
|
1990
|
+
org_account_id: string;
|
|
1991
|
+
is_owner: boolean;
|
|
1992
|
+
};
|
|
1993
|
+
getOrganizationAccount: (filters: {
|
|
1994
|
+
org_id?: string;
|
|
1995
|
+
account_id?: string;
|
|
1996
|
+
}) => OrgAccount | undefined;
|
|
1997
|
+
getOrganizationAccounts: (filters?: {
|
|
1998
|
+
org_id?: string;
|
|
1999
|
+
account_id?: string;
|
|
2000
|
+
}) => OrgAccount[];
|
|
2001
|
+
removeOrganizationAccount: (filters: {
|
|
2002
|
+
org_id: string;
|
|
2003
|
+
account_id: string;
|
|
2004
|
+
}) => boolean;
|
|
2005
|
+
updateOrganization: (orgId: string, updates: Partial<Organization>) => Organization | undefined;
|
|
1714
2006
|
};
|
|
1715
2007
|
type DbClient = ReturnType<typeof createDatabase>;
|
|
1716
2008
|
|