@tscircuit/fake-snippets 0.0.109 → 0.0.111
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 +32 -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 +151 -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 +361 -453
- package/bunfig.toml +2 -1
- package/dist/bundle.js +1313 -639
- package/dist/index.d.ts +313 -6
- package/dist/index.js +328 -24
- package/dist/schema.d.ts +290 -1
- package/dist/schema.js +54 -1
- package/fake-snippets-api/lib/db/autoload-dev-packages.ts +31 -20
- package/fake-snippets-api/lib/db/db-client.ts +219 -4
- package/fake-snippets-api/lib/db/schema.ts +63 -1
- package/fake-snippets-api/lib/db/seed.ts +100 -0
- package/fake-snippets-api/lib/middleware/with-session-auth.ts +60 -8
- 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 +33 -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 +48 -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 +60 -0
- package/fake-snippets-api/routes/api/orgs/remove_member.ts +46 -0
- package/fake-snippets-api/routes/api/orgs/update.ts +118 -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 +57 -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 +25 -19
- package/renovate.json +1 -1
- package/scripts/generate-sitemap.ts +1 -1
- package/src/App.tsx +27 -8
- 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 +17 -5
- package/src/components/FileSidebar.tsx +11 -17
- package/src/components/Footer.tsx +8 -9
- 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 +43 -15
- package/src/components/NotFound.tsx +5 -5
- package/src/components/PackageBreadcrumb.tsx +6 -12
- 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/SentryNotFoundReporter.tsx +44 -0
- package/src/components/UserCard.tsx +80 -0
- package/src/components/ViewPackagePage/components/build-status.tsx +1 -1
- package/src/components/ViewPackagePage/components/important-files-view.tsx +105 -34
- package/src/components/ViewPackagePage/components/main-content-header.tsx +10 -6
- package/src/components/ViewPackagePage/components/main-content-view-selector.tsx +1 -1
- package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +54 -19
- package/src/components/ViewPackagePage/components/package-header.tsx +25 -33
- package/src/components/ViewPackagePage/components/preview-image-squares.tsx +11 -18
- package/src/components/ViewPackagePage/components/repo-page-content.tsx +12 -5
- 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/tab-views/pcb-view.tsx +1 -2
- package/src/components/ViewPackagePage/components/tab-views/schematic-view.tsx +2 -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 +206 -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 +15 -12
- package/src/components/package-port/CodeEditor.tsx +4 -30
- package/src/components/package-port/CodeEditorHeader.tsx +123 -61
- 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 +23 -11
- 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-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-hydration.ts +30 -0
- 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 +51 -22
- package/src/hooks/useOptimizedPackageFilesLoader.ts +11 -24
- package/src/hooks/usePackageFilesLoader.ts +2 -2
- package/src/hooks/useUpdatePackageFilesMutation.ts +13 -1
- package/src/lib/download-fns/download-gltf-from-circuit-json.ts +1 -1
- package/src/lib/download-fns/download-kicad-files.ts +22 -11
- package/src/lib/download-fns/download-step.ts +12 -0
- 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 +2 -1
- package/src/main.tsx +2 -1
- package/src/pages/create-organization.tsx +169 -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 -6
- package/src/pages/latest.tsx +3 -0
- package/src/pages/organization-profile.tsx +199 -0
- package/src/pages/organization-settings.tsx +569 -0
- package/src/pages/package-editor.tsx +21 -21
- package/src/pages/preview-release.tsx +75 -145
- package/src/pages/quickstart.tsx +159 -123
- package/src/pages/release-detail.tsx +119 -31
- package/src/pages/search.tsx +197 -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/user-settings.tsx +161 -0
- package/src/pages/view-package.tsx +30 -16
- package/vite.config.ts +9 -0
- package/fake-snippets-api/routes/api/autocomplete/create_autocomplete.ts +0 -133
- package/src/components/JLCPCBImportDialog.tsx +0 -280
- package/src/components/PackageBuildsPage/LogContent.tsx +0 -72
- package/src/components/PackageBuildsPage/PackageBuildDetailsPage.tsx +0 -113
- package/src/components/PackageBuildsPage/build-preview-content.tsx +0 -56
- 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/pages/package-builds.tsx +0 -33
package/dist/index.d.ts
CHANGED
|
@@ -150,9 +150,12 @@ 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>;
|
|
154
|
+
is_tscircuit_staff: z.ZodDefault<z.ZodBoolean>;
|
|
153
155
|
}, "strip", z.ZodTypeAny, {
|
|
154
156
|
account_id: string;
|
|
155
157
|
github_username: string;
|
|
158
|
+
is_tscircuit_staff: boolean;
|
|
156
159
|
shippingInfo?: {
|
|
157
160
|
firstName: string;
|
|
158
161
|
lastName: string;
|
|
@@ -165,6 +168,7 @@ declare const accountSchema: z.ZodObject<{
|
|
|
165
168
|
companyName?: string | undefined;
|
|
166
169
|
apartment?: string | undefined;
|
|
167
170
|
} | undefined;
|
|
171
|
+
personal_org_id?: string | undefined;
|
|
168
172
|
}, {
|
|
169
173
|
account_id: string;
|
|
170
174
|
github_username: string;
|
|
@@ -180,6 +184,8 @@ declare const accountSchema: z.ZodObject<{
|
|
|
180
184
|
companyName?: string | undefined;
|
|
181
185
|
apartment?: string | undefined;
|
|
182
186
|
} | undefined;
|
|
187
|
+
personal_org_id?: string | undefined;
|
|
188
|
+
is_tscircuit_staff?: boolean | undefined;
|
|
183
189
|
}>;
|
|
184
190
|
type Account = z.infer<typeof accountSchema>;
|
|
185
191
|
declare const orderSchema: z.ZodObject<{
|
|
@@ -512,6 +518,14 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
512
518
|
circuit_json_build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
519
|
circuit_json_build_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
514
520
|
circuit_json_build_is_stale: z.ZodDefault<z.ZodBoolean>;
|
|
521
|
+
image_generation_display_status: z.ZodDefault<z.ZodEnum<["pending", "building", "complete", "error"]>>;
|
|
522
|
+
image_generation_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
523
|
+
image_generation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
524
|
+
image_generation_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
525
|
+
image_generation_logs: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
526
|
+
image_generation_is_stale: z.ZodDefault<z.ZodBoolean>;
|
|
527
|
+
image_generation_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
528
|
+
image_generation_error_last_updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
515
529
|
ai_review_text: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
516
530
|
ai_review_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
517
531
|
ai_review_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -541,6 +555,10 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
541
555
|
circuit_json_build_in_progress: boolean;
|
|
542
556
|
circuit_json_build_logs: any[];
|
|
543
557
|
circuit_json_build_is_stale: boolean;
|
|
558
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
559
|
+
image_generation_in_progress: boolean;
|
|
560
|
+
image_generation_logs: any[] | null;
|
|
561
|
+
image_generation_is_stale: boolean;
|
|
544
562
|
ai_review_requested: boolean;
|
|
545
563
|
is_pr_preview: boolean;
|
|
546
564
|
ai_review_text?: string | null | undefined;
|
|
@@ -555,6 +573,10 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
555
573
|
transpilation_completed_at?: string | null | undefined;
|
|
556
574
|
circuit_json_build_started_at?: string | null | undefined;
|
|
557
575
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
576
|
+
image_generation_started_at?: string | null | undefined;
|
|
577
|
+
image_generation_completed_at?: string | null | undefined;
|
|
578
|
+
image_generation_error?: string | null | undefined;
|
|
579
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
558
580
|
ai_review_started_at?: string | null | undefined;
|
|
559
581
|
ai_review_completed_at?: string | null | undefined;
|
|
560
582
|
ai_review_error?: any;
|
|
@@ -593,6 +615,14 @@ declare const packageReleaseSchema: z.ZodObject<{
|
|
|
593
615
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
594
616
|
circuit_json_build_logs?: any[] | undefined;
|
|
595
617
|
circuit_json_build_is_stale?: boolean | undefined;
|
|
618
|
+
image_generation_display_status?: "error" | "pending" | "building" | "complete" | undefined;
|
|
619
|
+
image_generation_in_progress?: boolean | undefined;
|
|
620
|
+
image_generation_started_at?: string | null | undefined;
|
|
621
|
+
image_generation_completed_at?: string | null | undefined;
|
|
622
|
+
image_generation_logs?: any[] | null | undefined;
|
|
623
|
+
image_generation_is_stale?: boolean | undefined;
|
|
624
|
+
image_generation_error?: string | null | undefined;
|
|
625
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
596
626
|
ai_review_started_at?: string | null | undefined;
|
|
597
627
|
ai_review_completed_at?: string | null | undefined;
|
|
598
628
|
ai_review_error?: any;
|
|
@@ -850,6 +880,11 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
850
880
|
circuit_json_build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
851
881
|
circuit_json_build_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
852
882
|
circuit_json_build_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
883
|
+
image_generation_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
884
|
+
image_generation_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
885
|
+
image_generation_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
886
|
+
image_generation_logs: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
887
|
+
image_generation_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
853
888
|
build_in_progress: z.ZodDefault<z.ZodBoolean>;
|
|
854
889
|
build_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
855
890
|
build_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -864,6 +899,8 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
864
899
|
transpilation_logs: any[];
|
|
865
900
|
circuit_json_build_in_progress: boolean;
|
|
866
901
|
circuit_json_build_logs: any[];
|
|
902
|
+
image_generation_in_progress: boolean;
|
|
903
|
+
image_generation_logs: any[];
|
|
867
904
|
package_build_id: string;
|
|
868
905
|
build_in_progress: boolean;
|
|
869
906
|
build_error_last_updated_at: string;
|
|
@@ -873,6 +910,9 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
873
910
|
transpilation_completed_at?: string | null | undefined;
|
|
874
911
|
circuit_json_build_started_at?: string | null | undefined;
|
|
875
912
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
913
|
+
image_generation_started_at?: string | null | undefined;
|
|
914
|
+
image_generation_completed_at?: string | null | undefined;
|
|
915
|
+
image_generation_error?: string | null | undefined;
|
|
876
916
|
build_started_at?: string | null | undefined;
|
|
877
917
|
build_completed_at?: string | null | undefined;
|
|
878
918
|
build_error?: string | null | undefined;
|
|
@@ -893,6 +933,11 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
893
933
|
circuit_json_build_started_at?: string | null | undefined;
|
|
894
934
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
895
935
|
circuit_json_build_logs?: any[] | undefined;
|
|
936
|
+
image_generation_in_progress?: boolean | undefined;
|
|
937
|
+
image_generation_started_at?: string | null | undefined;
|
|
938
|
+
image_generation_completed_at?: string | null | undefined;
|
|
939
|
+
image_generation_logs?: any[] | undefined;
|
|
940
|
+
image_generation_error?: string | null | undefined;
|
|
896
941
|
build_in_progress?: boolean | undefined;
|
|
897
942
|
build_started_at?: string | null | undefined;
|
|
898
943
|
build_completed_at?: string | null | undefined;
|
|
@@ -901,6 +946,52 @@ declare const packageBuildSchema: z.ZodObject<{
|
|
|
901
946
|
build_logs?: string | null | undefined;
|
|
902
947
|
}>;
|
|
903
948
|
type PackageBuild = z.infer<typeof packageBuildSchema>;
|
|
949
|
+
declare const orgSchema: z.ZodObject<{
|
|
950
|
+
org_id: z.ZodString;
|
|
951
|
+
github_handle: z.ZodOptional<z.ZodString>;
|
|
952
|
+
owner_account_id: z.ZodString;
|
|
953
|
+
is_personal_org: z.ZodDefault<z.ZodBoolean>;
|
|
954
|
+
created_at: z.ZodString;
|
|
955
|
+
org_display_name: z.ZodOptional<z.ZodString>;
|
|
956
|
+
org_name: z.ZodString;
|
|
957
|
+
}, "strip", z.ZodTypeAny, {
|
|
958
|
+
created_at: string;
|
|
959
|
+
org_id: string;
|
|
960
|
+
owner_account_id: string;
|
|
961
|
+
is_personal_org: boolean;
|
|
962
|
+
org_name: string;
|
|
963
|
+
github_handle?: string | undefined;
|
|
964
|
+
org_display_name?: string | undefined;
|
|
965
|
+
}, {
|
|
966
|
+
created_at: string;
|
|
967
|
+
org_id: string;
|
|
968
|
+
owner_account_id: string;
|
|
969
|
+
org_name: string;
|
|
970
|
+
github_handle?: string | undefined;
|
|
971
|
+
is_personal_org?: boolean | undefined;
|
|
972
|
+
org_display_name?: string | undefined;
|
|
973
|
+
}>;
|
|
974
|
+
type Organization = z.infer<typeof orgSchema>;
|
|
975
|
+
declare const orgAccountSchema: z.ZodObject<{
|
|
976
|
+
org_account_id: z.ZodString;
|
|
977
|
+
org_id: z.ZodString;
|
|
978
|
+
account_id: z.ZodString;
|
|
979
|
+
is_owner: z.ZodDefault<z.ZodBoolean>;
|
|
980
|
+
created_at: z.ZodString;
|
|
981
|
+
}, "strip", z.ZodTypeAny, {
|
|
982
|
+
created_at: string;
|
|
983
|
+
account_id: string;
|
|
984
|
+
org_id: string;
|
|
985
|
+
org_account_id: string;
|
|
986
|
+
is_owner: boolean;
|
|
987
|
+
}, {
|
|
988
|
+
created_at: string;
|
|
989
|
+
account_id: string;
|
|
990
|
+
org_id: string;
|
|
991
|
+
org_account_id: string;
|
|
992
|
+
is_owner?: boolean | undefined;
|
|
993
|
+
}>;
|
|
994
|
+
type OrgAccount = z.infer<typeof orgAccountSchema>;
|
|
904
995
|
|
|
905
996
|
declare const createDatabase: ({ seed }?: {
|
|
906
997
|
seed?: boolean;
|
|
@@ -947,6 +1038,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
947
1038
|
circuit_json_build_in_progress: boolean;
|
|
948
1039
|
circuit_json_build_logs: any[];
|
|
949
1040
|
circuit_json_build_is_stale: boolean;
|
|
1041
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
1042
|
+
image_generation_in_progress: boolean;
|
|
1043
|
+
image_generation_logs: any[] | null;
|
|
1044
|
+
image_generation_is_stale: boolean;
|
|
950
1045
|
ai_review_requested: boolean;
|
|
951
1046
|
is_pr_preview: boolean;
|
|
952
1047
|
ai_review_text?: string | null | undefined;
|
|
@@ -961,6 +1056,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
961
1056
|
transpilation_completed_at?: string | null | undefined;
|
|
962
1057
|
circuit_json_build_started_at?: string | null | undefined;
|
|
963
1058
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1059
|
+
image_generation_started_at?: string | null | undefined;
|
|
1060
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1061
|
+
image_generation_error?: string | null | undefined;
|
|
1062
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
964
1063
|
ai_review_started_at?: string | null | undefined;
|
|
965
1064
|
ai_review_completed_at?: string | null | undefined;
|
|
966
1065
|
ai_review_error?: any;
|
|
@@ -998,6 +1097,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
998
1097
|
accounts: {
|
|
999
1098
|
account_id: string;
|
|
1000
1099
|
github_username: string;
|
|
1100
|
+
is_tscircuit_staff: boolean;
|
|
1001
1101
|
shippingInfo?: {
|
|
1002
1102
|
firstName: string;
|
|
1003
1103
|
lastName: string;
|
|
@@ -1010,6 +1110,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1010
1110
|
companyName?: string | undefined;
|
|
1011
1111
|
apartment?: string | undefined;
|
|
1012
1112
|
} | undefined;
|
|
1113
|
+
personal_org_id?: string | undefined;
|
|
1013
1114
|
}[];
|
|
1014
1115
|
packages: {
|
|
1015
1116
|
name: string;
|
|
@@ -1061,6 +1162,22 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1061
1162
|
completed_at: string | null;
|
|
1062
1163
|
circuit_json?: any;
|
|
1063
1164
|
}[];
|
|
1165
|
+
organizations: {
|
|
1166
|
+
created_at: string;
|
|
1167
|
+
org_id: string;
|
|
1168
|
+
owner_account_id: string;
|
|
1169
|
+
is_personal_org: boolean;
|
|
1170
|
+
org_name: string;
|
|
1171
|
+
github_handle?: string | undefined;
|
|
1172
|
+
org_display_name?: string | undefined;
|
|
1173
|
+
}[];
|
|
1174
|
+
orgAccounts: {
|
|
1175
|
+
created_at: string;
|
|
1176
|
+
account_id: string;
|
|
1177
|
+
org_id: string;
|
|
1178
|
+
org_account_id: string;
|
|
1179
|
+
is_owner: boolean;
|
|
1180
|
+
}[];
|
|
1064
1181
|
orderFiles: {
|
|
1065
1182
|
order_id: string;
|
|
1066
1183
|
order_file_id: string;
|
|
@@ -1192,6 +1309,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1192
1309
|
transpilation_logs: any[];
|
|
1193
1310
|
circuit_json_build_in_progress: boolean;
|
|
1194
1311
|
circuit_json_build_logs: any[];
|
|
1312
|
+
image_generation_in_progress: boolean;
|
|
1313
|
+
image_generation_logs: any[];
|
|
1195
1314
|
package_build_id: string;
|
|
1196
1315
|
build_in_progress: boolean;
|
|
1197
1316
|
build_error_last_updated_at: string;
|
|
@@ -1201,13 +1320,16 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1201
1320
|
transpilation_completed_at?: string | null | undefined;
|
|
1202
1321
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1203
1322
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1323
|
+
image_generation_started_at?: string | null | undefined;
|
|
1324
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1325
|
+
image_generation_error?: string | null | undefined;
|
|
1204
1326
|
build_started_at?: string | null | undefined;
|
|
1205
1327
|
build_completed_at?: string | null | undefined;
|
|
1206
1328
|
build_error?: string | null | undefined;
|
|
1207
1329
|
preview_url?: string | null | undefined;
|
|
1208
1330
|
build_logs?: string | null | undefined;
|
|
1209
1331
|
}[];
|
|
1210
|
-
}, "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"> & {
|
|
1332
|
+
}, "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"> & {
|
|
1211
1333
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
1212
1334
|
getOrderById: (orderId: string) => Order | undefined;
|
|
1213
1335
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -1224,7 +1346,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1224
1346
|
updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
|
|
1225
1347
|
addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
|
|
1226
1348
|
getOrderFileById: (orderFileId: string) => OrderFile | undefined;
|
|
1227
|
-
addAccount: (account: Omit<Account, "account_id"> & Partial<Pick<Account, "account_id">>) => {
|
|
1349
|
+
addAccount: (account: Omit<Account, "account_id" | "is_tscircuit_staff"> & Partial<Pick<Account, "account_id" | "is_tscircuit_staff">>) => {
|
|
1350
|
+
is_tscircuit_staff: boolean;
|
|
1228
1351
|
github_username: string;
|
|
1229
1352
|
shippingInfo?: {
|
|
1230
1353
|
firstName: string;
|
|
@@ -1238,6 +1361,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1238
1361
|
companyName?: string | undefined;
|
|
1239
1362
|
apartment?: string | undefined;
|
|
1240
1363
|
} | undefined;
|
|
1364
|
+
personal_org_id?: string | undefined;
|
|
1241
1365
|
account_id: string;
|
|
1242
1366
|
};
|
|
1243
1367
|
addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
|
|
@@ -1306,10 +1430,85 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1306
1430
|
is_popular?: boolean;
|
|
1307
1431
|
}) => Datasheet[];
|
|
1308
1432
|
updateDatasheet: (datasheetId: string, updates: Partial<Datasheet>) => Datasheet | undefined;
|
|
1309
|
-
addPackageBuild: (packageBuild: Omit<
|
|
1433
|
+
addPackageBuild: (packageBuild: Omit<z.input<typeof packageBuildSchema>, "package_build_id">) => PackageBuild;
|
|
1310
1434
|
getPackageBuildById: (packageBuildId: string) => PackageBuild | undefined;
|
|
1311
1435
|
getPackageBuildsByReleaseId: (packageReleaseId: string) => PackageBuild[];
|
|
1312
1436
|
updatePackageBuild: (packageBuildId: string, updates: Partial<PackageBuild>) => PackageBuild | undefined;
|
|
1437
|
+
addOrganization: (organization: {
|
|
1438
|
+
name: string;
|
|
1439
|
+
org_id?: string;
|
|
1440
|
+
is_personal_org?: boolean;
|
|
1441
|
+
owner_account_id: string;
|
|
1442
|
+
github_handle?: string;
|
|
1443
|
+
}) => {
|
|
1444
|
+
created_at: string;
|
|
1445
|
+
org_id: string;
|
|
1446
|
+
owner_account_id: string;
|
|
1447
|
+
is_personal_org: boolean;
|
|
1448
|
+
org_name: string;
|
|
1449
|
+
github_handle?: string | undefined;
|
|
1450
|
+
org_display_name?: string | undefined;
|
|
1451
|
+
};
|
|
1452
|
+
getOrgs: (filters?: {
|
|
1453
|
+
owner_account_id?: string;
|
|
1454
|
+
github_handle?: string;
|
|
1455
|
+
name?: string;
|
|
1456
|
+
}, auth?: {
|
|
1457
|
+
account_id?: string;
|
|
1458
|
+
}) => {
|
|
1459
|
+
member_count: number;
|
|
1460
|
+
package_count: number;
|
|
1461
|
+
can_manage_org: boolean;
|
|
1462
|
+
created_at: string;
|
|
1463
|
+
org_id: string;
|
|
1464
|
+
owner_account_id: string;
|
|
1465
|
+
is_personal_org: boolean;
|
|
1466
|
+
org_name: string;
|
|
1467
|
+
github_handle?: string | undefined;
|
|
1468
|
+
org_display_name?: string | undefined;
|
|
1469
|
+
}[];
|
|
1470
|
+
getOrg: (filters: {
|
|
1471
|
+
org_id?: string;
|
|
1472
|
+
org_name?: string;
|
|
1473
|
+
github_handle?: string;
|
|
1474
|
+
}, auth?: {
|
|
1475
|
+
account_id: string;
|
|
1476
|
+
}) => {
|
|
1477
|
+
member_count: number;
|
|
1478
|
+
package_count: number;
|
|
1479
|
+
can_manage_org: boolean;
|
|
1480
|
+
created_at: string;
|
|
1481
|
+
org_id: string;
|
|
1482
|
+
owner_account_id: string;
|
|
1483
|
+
is_personal_org: boolean;
|
|
1484
|
+
org_name: string;
|
|
1485
|
+
github_handle?: string | undefined;
|
|
1486
|
+
org_display_name?: string | undefined;
|
|
1487
|
+
} | null;
|
|
1488
|
+
addOrganizationAccount: (organizationAccount: {
|
|
1489
|
+
org_id: string;
|
|
1490
|
+
account_id: string;
|
|
1491
|
+
is_owner?: boolean;
|
|
1492
|
+
}) => {
|
|
1493
|
+
created_at: string;
|
|
1494
|
+
account_id: string;
|
|
1495
|
+
org_id: string;
|
|
1496
|
+
org_account_id: string;
|
|
1497
|
+
is_owner: boolean;
|
|
1498
|
+
};
|
|
1499
|
+
getOrganizationAccount: (filters: {
|
|
1500
|
+
org_id?: string;
|
|
1501
|
+
account_id?: string;
|
|
1502
|
+
}) => OrgAccount | undefined;
|
|
1503
|
+
getOrganizationAccounts: (filters?: {
|
|
1504
|
+
org_id?: string;
|
|
1505
|
+
account_id?: string;
|
|
1506
|
+
}) => OrgAccount[];
|
|
1507
|
+
removeOrganizationAccount: (filters: {
|
|
1508
|
+
org_id: string;
|
|
1509
|
+
account_id: string;
|
|
1510
|
+
}) => boolean;
|
|
1511
|
+
updateOrganization: (orgId: string, updates: Partial<Organization>) => Organization | undefined;
|
|
1313
1512
|
}> & Omit<{
|
|
1314
1513
|
idCounter: number;
|
|
1315
1514
|
snippets: {
|
|
@@ -1353,6 +1552,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1353
1552
|
circuit_json_build_in_progress: boolean;
|
|
1354
1553
|
circuit_json_build_logs: any[];
|
|
1355
1554
|
circuit_json_build_is_stale: boolean;
|
|
1555
|
+
image_generation_display_status: "error" | "pending" | "building" | "complete";
|
|
1556
|
+
image_generation_in_progress: boolean;
|
|
1557
|
+
image_generation_logs: any[] | null;
|
|
1558
|
+
image_generation_is_stale: boolean;
|
|
1356
1559
|
ai_review_requested: boolean;
|
|
1357
1560
|
is_pr_preview: boolean;
|
|
1358
1561
|
ai_review_text?: string | null | undefined;
|
|
@@ -1367,6 +1570,10 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1367
1570
|
transpilation_completed_at?: string | null | undefined;
|
|
1368
1571
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1369
1572
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1573
|
+
image_generation_started_at?: string | null | undefined;
|
|
1574
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1575
|
+
image_generation_error?: string | null | undefined;
|
|
1576
|
+
image_generation_error_last_updated_at?: string | null | undefined;
|
|
1370
1577
|
ai_review_started_at?: string | null | undefined;
|
|
1371
1578
|
ai_review_completed_at?: string | null | undefined;
|
|
1372
1579
|
ai_review_error?: any;
|
|
@@ -1404,6 +1611,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1404
1611
|
accounts: {
|
|
1405
1612
|
account_id: string;
|
|
1406
1613
|
github_username: string;
|
|
1614
|
+
is_tscircuit_staff: boolean;
|
|
1407
1615
|
shippingInfo?: {
|
|
1408
1616
|
firstName: string;
|
|
1409
1617
|
lastName: string;
|
|
@@ -1416,6 +1624,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1416
1624
|
companyName?: string | undefined;
|
|
1417
1625
|
apartment?: string | undefined;
|
|
1418
1626
|
} | undefined;
|
|
1627
|
+
personal_org_id?: string | undefined;
|
|
1419
1628
|
}[];
|
|
1420
1629
|
packages: {
|
|
1421
1630
|
name: string;
|
|
@@ -1467,6 +1676,22 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1467
1676
|
completed_at: string | null;
|
|
1468
1677
|
circuit_json?: any;
|
|
1469
1678
|
}[];
|
|
1679
|
+
organizations: {
|
|
1680
|
+
created_at: string;
|
|
1681
|
+
org_id: string;
|
|
1682
|
+
owner_account_id: string;
|
|
1683
|
+
is_personal_org: boolean;
|
|
1684
|
+
org_name: string;
|
|
1685
|
+
github_handle?: string | undefined;
|
|
1686
|
+
org_display_name?: string | undefined;
|
|
1687
|
+
}[];
|
|
1688
|
+
orgAccounts: {
|
|
1689
|
+
created_at: string;
|
|
1690
|
+
account_id: string;
|
|
1691
|
+
org_id: string;
|
|
1692
|
+
org_account_id: string;
|
|
1693
|
+
is_owner: boolean;
|
|
1694
|
+
}[];
|
|
1470
1695
|
orderFiles: {
|
|
1471
1696
|
order_id: string;
|
|
1472
1697
|
order_file_id: string;
|
|
@@ -1598,6 +1823,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1598
1823
|
transpilation_logs: any[];
|
|
1599
1824
|
circuit_json_build_in_progress: boolean;
|
|
1600
1825
|
circuit_json_build_logs: any[];
|
|
1826
|
+
image_generation_in_progress: boolean;
|
|
1827
|
+
image_generation_logs: any[];
|
|
1601
1828
|
package_build_id: string;
|
|
1602
1829
|
build_in_progress: boolean;
|
|
1603
1830
|
build_error_last_updated_at: string;
|
|
@@ -1607,13 +1834,16 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1607
1834
|
transpilation_completed_at?: string | null | undefined;
|
|
1608
1835
|
circuit_json_build_started_at?: string | null | undefined;
|
|
1609
1836
|
circuit_json_build_completed_at?: string | null | undefined;
|
|
1837
|
+
image_generation_started_at?: string | null | undefined;
|
|
1838
|
+
image_generation_completed_at?: string | null | undefined;
|
|
1839
|
+
image_generation_error?: string | null | undefined;
|
|
1610
1840
|
build_started_at?: string | null | undefined;
|
|
1611
1841
|
build_completed_at?: string | null | undefined;
|
|
1612
1842
|
build_error?: string | null | undefined;
|
|
1613
1843
|
preview_url?: string | null | undefined;
|
|
1614
1844
|
build_logs?: string | null | undefined;
|
|
1615
1845
|
}[];
|
|
1616
|
-
}, "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"> & {
|
|
1846
|
+
}, "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"> & {
|
|
1617
1847
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
1618
1848
|
getOrderById: (orderId: string) => Order | undefined;
|
|
1619
1849
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -1630,7 +1860,8 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1630
1860
|
updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
|
|
1631
1861
|
addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
|
|
1632
1862
|
getOrderFileById: (orderFileId: string) => OrderFile | undefined;
|
|
1633
|
-
addAccount: (account: Omit<Account, "account_id"> & Partial<Pick<Account, "account_id">>) => {
|
|
1863
|
+
addAccount: (account: Omit<Account, "account_id" | "is_tscircuit_staff"> & Partial<Pick<Account, "account_id" | "is_tscircuit_staff">>) => {
|
|
1864
|
+
is_tscircuit_staff: boolean;
|
|
1634
1865
|
github_username: string;
|
|
1635
1866
|
shippingInfo?: {
|
|
1636
1867
|
firstName: string;
|
|
@@ -1644,6 +1875,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1644
1875
|
companyName?: string | undefined;
|
|
1645
1876
|
apartment?: string | undefined;
|
|
1646
1877
|
} | undefined;
|
|
1878
|
+
personal_org_id?: string | undefined;
|
|
1647
1879
|
account_id: string;
|
|
1648
1880
|
};
|
|
1649
1881
|
addAccountPackage: (accountPackage: Omit<AccountPackage, "account_package_id">) => AccountPackage;
|
|
@@ -1712,10 +1944,85 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1712
1944
|
is_popular?: boolean;
|
|
1713
1945
|
}) => Datasheet[];
|
|
1714
1946
|
updateDatasheet: (datasheetId: string, updates: Partial<Datasheet>) => Datasheet | undefined;
|
|
1715
|
-
addPackageBuild: (packageBuild: Omit<
|
|
1947
|
+
addPackageBuild: (packageBuild: Omit<z.input<typeof packageBuildSchema>, "package_build_id">) => PackageBuild;
|
|
1716
1948
|
getPackageBuildById: (packageBuildId: string) => PackageBuild | undefined;
|
|
1717
1949
|
getPackageBuildsByReleaseId: (packageReleaseId: string) => PackageBuild[];
|
|
1718
1950
|
updatePackageBuild: (packageBuildId: string, updates: Partial<PackageBuild>) => PackageBuild | undefined;
|
|
1951
|
+
addOrganization: (organization: {
|
|
1952
|
+
name: string;
|
|
1953
|
+
org_id?: string;
|
|
1954
|
+
is_personal_org?: boolean;
|
|
1955
|
+
owner_account_id: string;
|
|
1956
|
+
github_handle?: string;
|
|
1957
|
+
}) => {
|
|
1958
|
+
created_at: string;
|
|
1959
|
+
org_id: string;
|
|
1960
|
+
owner_account_id: string;
|
|
1961
|
+
is_personal_org: boolean;
|
|
1962
|
+
org_name: string;
|
|
1963
|
+
github_handle?: string | undefined;
|
|
1964
|
+
org_display_name?: string | undefined;
|
|
1965
|
+
};
|
|
1966
|
+
getOrgs: (filters?: {
|
|
1967
|
+
owner_account_id?: string;
|
|
1968
|
+
github_handle?: string;
|
|
1969
|
+
name?: string;
|
|
1970
|
+
}, auth?: {
|
|
1971
|
+
account_id?: string;
|
|
1972
|
+
}) => {
|
|
1973
|
+
member_count: number;
|
|
1974
|
+
package_count: number;
|
|
1975
|
+
can_manage_org: boolean;
|
|
1976
|
+
created_at: string;
|
|
1977
|
+
org_id: string;
|
|
1978
|
+
owner_account_id: string;
|
|
1979
|
+
is_personal_org: boolean;
|
|
1980
|
+
org_name: string;
|
|
1981
|
+
github_handle?: string | undefined;
|
|
1982
|
+
org_display_name?: string | undefined;
|
|
1983
|
+
}[];
|
|
1984
|
+
getOrg: (filters: {
|
|
1985
|
+
org_id?: string;
|
|
1986
|
+
org_name?: string;
|
|
1987
|
+
github_handle?: string;
|
|
1988
|
+
}, auth?: {
|
|
1989
|
+
account_id: string;
|
|
1990
|
+
}) => {
|
|
1991
|
+
member_count: number;
|
|
1992
|
+
package_count: number;
|
|
1993
|
+
can_manage_org: boolean;
|
|
1994
|
+
created_at: string;
|
|
1995
|
+
org_id: string;
|
|
1996
|
+
owner_account_id: string;
|
|
1997
|
+
is_personal_org: boolean;
|
|
1998
|
+
org_name: string;
|
|
1999
|
+
github_handle?: string | undefined;
|
|
2000
|
+
org_display_name?: string | undefined;
|
|
2001
|
+
} | null;
|
|
2002
|
+
addOrganizationAccount: (organizationAccount: {
|
|
2003
|
+
org_id: string;
|
|
2004
|
+
account_id: string;
|
|
2005
|
+
is_owner?: boolean;
|
|
2006
|
+
}) => {
|
|
2007
|
+
created_at: string;
|
|
2008
|
+
account_id: string;
|
|
2009
|
+
org_id: string;
|
|
2010
|
+
org_account_id: string;
|
|
2011
|
+
is_owner: boolean;
|
|
2012
|
+
};
|
|
2013
|
+
getOrganizationAccount: (filters: {
|
|
2014
|
+
org_id?: string;
|
|
2015
|
+
account_id?: string;
|
|
2016
|
+
}) => OrgAccount | undefined;
|
|
2017
|
+
getOrganizationAccounts: (filters?: {
|
|
2018
|
+
org_id?: string;
|
|
2019
|
+
account_id?: string;
|
|
2020
|
+
}) => OrgAccount[];
|
|
2021
|
+
removeOrganizationAccount: (filters: {
|
|
2022
|
+
org_id: string;
|
|
2023
|
+
account_id: string;
|
|
2024
|
+
}) => boolean;
|
|
2025
|
+
updateOrganization: (orgId: string, updates: Partial<Organization>) => Organization | undefined;
|
|
1719
2026
|
};
|
|
1720
2027
|
type DbClient = ReturnType<typeof createDatabase>;
|
|
1721
2028
|
|