@tscircuit/fake-snippets 0.0.208 → 0.0.211
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/dist/bundle.js +1061 -1275
- package/dist/index.d.ts +42 -178
- package/dist/index.js +8 -71
- package/dist/schema.d.ts +65 -267
- package/dist/schema.js +8 -38
- package/package.json +11 -7
package/dist/index.d.ts
CHANGED
|
@@ -200,6 +200,14 @@ type Account = z.infer<typeof accountSchema>;
|
|
|
200
200
|
declare const orderSchema: z.ZodObject<{
|
|
201
201
|
order_id: z.ZodString;
|
|
202
202
|
account_id: z.ZodNullable<z.ZodString>;
|
|
203
|
+
submitted_package_release_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
adapted_package_release_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
stripe_checkout_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
stripe_checkout_session_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
is_stripe_checkout_session_complete: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
is_stripe_checkout_session_expired: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
is_stripe_checkout_session_open: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
is_stripe_payment_paid: z.ZodOptional<z.ZodBoolean>;
|
|
203
211
|
is_running: z.ZodBoolean;
|
|
204
212
|
is_started: z.ZodBoolean;
|
|
205
213
|
is_finished: z.ZodBoolean;
|
|
@@ -233,6 +241,14 @@ declare const orderSchema: z.ZodObject<{
|
|
|
233
241
|
started_at: string | null;
|
|
234
242
|
completed_at: string | null;
|
|
235
243
|
circuit_json?: any;
|
|
244
|
+
submitted_package_release_id?: string | null | undefined;
|
|
245
|
+
adapted_package_release_id?: string | null | undefined;
|
|
246
|
+
stripe_checkout_session_id?: string | null | undefined;
|
|
247
|
+
stripe_checkout_session_url?: string | null | undefined;
|
|
248
|
+
is_stripe_checkout_session_complete?: boolean | undefined;
|
|
249
|
+
is_stripe_checkout_session_expired?: boolean | undefined;
|
|
250
|
+
is_stripe_checkout_session_open?: boolean | undefined;
|
|
251
|
+
is_stripe_payment_paid?: boolean | undefined;
|
|
236
252
|
}, {
|
|
237
253
|
error: z.objectInputType<{
|
|
238
254
|
error_code: z.ZodString;
|
|
@@ -248,6 +264,14 @@ declare const orderSchema: z.ZodObject<{
|
|
|
248
264
|
started_at: string | null;
|
|
249
265
|
completed_at: string | null;
|
|
250
266
|
circuit_json?: any;
|
|
267
|
+
submitted_package_release_id?: string | null | undefined;
|
|
268
|
+
adapted_package_release_id?: string | null | undefined;
|
|
269
|
+
stripe_checkout_session_id?: string | null | undefined;
|
|
270
|
+
stripe_checkout_session_url?: string | null | undefined;
|
|
271
|
+
is_stripe_checkout_session_complete?: boolean | undefined;
|
|
272
|
+
is_stripe_checkout_session_expired?: boolean | undefined;
|
|
273
|
+
is_stripe_checkout_session_open?: boolean | undefined;
|
|
274
|
+
is_stripe_payment_paid?: boolean | undefined;
|
|
251
275
|
}>;
|
|
252
276
|
type Order = z.infer<typeof orderSchema>;
|
|
253
277
|
declare const orderFileSchema: z.ZodObject<{
|
|
@@ -905,106 +929,6 @@ declare const packageSchema: z.ZodObject<{
|
|
|
905
929
|
latest_cad_preview_image_url?: string | null | undefined;
|
|
906
930
|
}>;
|
|
907
931
|
type Package = z.infer<typeof packageSchema>;
|
|
908
|
-
declare const jlcpcbOrderStateSchema: z.ZodObject<{
|
|
909
|
-
jlcpcb_order_state_id: z.ZodString;
|
|
910
|
-
order_id: z.ZodString;
|
|
911
|
-
are_gerbers_uploaded: z.ZodDefault<z.ZodBoolean>;
|
|
912
|
-
is_gerber_analyzed: z.ZodDefault<z.ZodBoolean>;
|
|
913
|
-
are_initial_costs_calculated: z.ZodDefault<z.ZodBoolean>;
|
|
914
|
-
is_pcb_added_to_cart: z.ZodDefault<z.ZodBoolean>;
|
|
915
|
-
is_bom_uploaded: z.ZodDefault<z.ZodBoolean>;
|
|
916
|
-
is_pnp_uploaded: z.ZodDefault<z.ZodBoolean>;
|
|
917
|
-
is_bom_pnp_analyzed: z.ZodDefault<z.ZodBoolean>;
|
|
918
|
-
is_bom_parsing_complete: z.ZodDefault<z.ZodBoolean>;
|
|
919
|
-
are_components_available: z.ZodDefault<z.ZodBoolean>;
|
|
920
|
-
is_patch_map_generated: z.ZodDefault<z.ZodBoolean>;
|
|
921
|
-
is_json_merge_file_created: z.ZodDefault<z.ZodBoolean>;
|
|
922
|
-
is_dfm_result_generated: z.ZodDefault<z.ZodBoolean>;
|
|
923
|
-
are_files_downloaded: z.ZodDefault<z.ZodBoolean>;
|
|
924
|
-
are_product_categories_fetched: z.ZodDefault<z.ZodBoolean>;
|
|
925
|
-
are_final_costs_calculated: z.ZodDefault<z.ZodBoolean>;
|
|
926
|
-
is_json_merge_file_updated: z.ZodDefault<z.ZodBoolean>;
|
|
927
|
-
is_added_to_cart: z.ZodDefault<z.ZodBoolean>;
|
|
928
|
-
uploaded_gerber_metadata: z.ZodDefault<z.ZodNullable<z.ZodAny>>;
|
|
929
|
-
gerber_analysis: z.ZodDefault<z.ZodNullable<z.ZodAny>>;
|
|
930
|
-
created_at: z.ZodString;
|
|
931
|
-
are_gerbers_generated: z.ZodDefault<z.ZodBoolean>;
|
|
932
|
-
current_step: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
933
|
-
}, "strip", z.ZodTypeAny, {
|
|
934
|
-
created_at: string;
|
|
935
|
-
order_id: string;
|
|
936
|
-
jlcpcb_order_state_id: string;
|
|
937
|
-
are_gerbers_uploaded: boolean;
|
|
938
|
-
is_gerber_analyzed: boolean;
|
|
939
|
-
are_initial_costs_calculated: boolean;
|
|
940
|
-
is_pcb_added_to_cart: boolean;
|
|
941
|
-
is_bom_uploaded: boolean;
|
|
942
|
-
is_pnp_uploaded: boolean;
|
|
943
|
-
is_bom_pnp_analyzed: boolean;
|
|
944
|
-
is_bom_parsing_complete: boolean;
|
|
945
|
-
are_components_available: boolean;
|
|
946
|
-
is_patch_map_generated: boolean;
|
|
947
|
-
is_json_merge_file_created: boolean;
|
|
948
|
-
is_dfm_result_generated: boolean;
|
|
949
|
-
are_files_downloaded: boolean;
|
|
950
|
-
are_product_categories_fetched: boolean;
|
|
951
|
-
are_final_costs_calculated: boolean;
|
|
952
|
-
is_json_merge_file_updated: boolean;
|
|
953
|
-
is_added_to_cart: boolean;
|
|
954
|
-
are_gerbers_generated: boolean;
|
|
955
|
-
current_step: string | null;
|
|
956
|
-
uploaded_gerber_metadata?: any;
|
|
957
|
-
gerber_analysis?: any;
|
|
958
|
-
}, {
|
|
959
|
-
created_at: string;
|
|
960
|
-
order_id: string;
|
|
961
|
-
jlcpcb_order_state_id: string;
|
|
962
|
-
are_gerbers_uploaded?: boolean | undefined;
|
|
963
|
-
is_gerber_analyzed?: boolean | undefined;
|
|
964
|
-
are_initial_costs_calculated?: boolean | undefined;
|
|
965
|
-
is_pcb_added_to_cart?: boolean | undefined;
|
|
966
|
-
is_bom_uploaded?: boolean | undefined;
|
|
967
|
-
is_pnp_uploaded?: boolean | undefined;
|
|
968
|
-
is_bom_pnp_analyzed?: boolean | undefined;
|
|
969
|
-
is_bom_parsing_complete?: boolean | undefined;
|
|
970
|
-
are_components_available?: boolean | undefined;
|
|
971
|
-
is_patch_map_generated?: boolean | undefined;
|
|
972
|
-
is_json_merge_file_created?: boolean | undefined;
|
|
973
|
-
is_dfm_result_generated?: boolean | undefined;
|
|
974
|
-
are_files_downloaded?: boolean | undefined;
|
|
975
|
-
are_product_categories_fetched?: boolean | undefined;
|
|
976
|
-
are_final_costs_calculated?: boolean | undefined;
|
|
977
|
-
is_json_merge_file_updated?: boolean | undefined;
|
|
978
|
-
is_added_to_cart?: boolean | undefined;
|
|
979
|
-
uploaded_gerber_metadata?: any;
|
|
980
|
-
gerber_analysis?: any;
|
|
981
|
-
are_gerbers_generated?: boolean | undefined;
|
|
982
|
-
current_step?: string | null | undefined;
|
|
983
|
-
}>;
|
|
984
|
-
type JlcpcbOrderState = z.infer<typeof jlcpcbOrderStateSchema>;
|
|
985
|
-
declare const jlcpcbOrderStepRunSchema: z.ZodObject<{
|
|
986
|
-
jlcpcb_order_step_run_id: z.ZodString;
|
|
987
|
-
is_running: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
988
|
-
step_function_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
989
|
-
jlcpcb_order_state_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
990
|
-
error_message: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
991
|
-
created_at: z.ZodString;
|
|
992
|
-
}, "strip", z.ZodTypeAny, {
|
|
993
|
-
created_at: string;
|
|
994
|
-
is_running: boolean | null;
|
|
995
|
-
jlcpcb_order_state_id: string | null;
|
|
996
|
-
jlcpcb_order_step_run_id: string;
|
|
997
|
-
step_function_name: string | null;
|
|
998
|
-
error_message: string | null;
|
|
999
|
-
}, {
|
|
1000
|
-
created_at: string;
|
|
1001
|
-
jlcpcb_order_step_run_id: string;
|
|
1002
|
-
is_running?: boolean | null | undefined;
|
|
1003
|
-
jlcpcb_order_state_id?: string | null | undefined;
|
|
1004
|
-
step_function_name?: string | null | undefined;
|
|
1005
|
-
error_message?: string | null | undefined;
|
|
1006
|
-
}>;
|
|
1007
|
-
type JlcpcbOrderStepRun = z.infer<typeof jlcpcbOrderStepRunSchema>;
|
|
1008
932
|
declare const packageBuildSchema: z.ZodObject<{
|
|
1009
933
|
package_build_id: z.ZodString;
|
|
1010
934
|
package_release_id: z.ZodString;
|
|
@@ -1480,6 +1404,14 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1480
1404
|
started_at: string | null;
|
|
1481
1405
|
completed_at: string | null;
|
|
1482
1406
|
circuit_json?: any;
|
|
1407
|
+
submitted_package_release_id?: string | null | undefined;
|
|
1408
|
+
adapted_package_release_id?: string | null | undefined;
|
|
1409
|
+
stripe_checkout_session_id?: string | null | undefined;
|
|
1410
|
+
stripe_checkout_session_url?: string | null | undefined;
|
|
1411
|
+
is_stripe_checkout_session_complete?: boolean | undefined;
|
|
1412
|
+
is_stripe_checkout_session_expired?: boolean | undefined;
|
|
1413
|
+
is_stripe_checkout_session_open?: boolean | undefined;
|
|
1414
|
+
is_stripe_payment_paid?: boolean | undefined;
|
|
1483
1415
|
}[];
|
|
1484
1416
|
organizations: {
|
|
1485
1417
|
created_at: string;
|
|
@@ -1540,40 +1472,6 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1540
1472
|
account_package_id: string;
|
|
1541
1473
|
package_id: string;
|
|
1542
1474
|
}[];
|
|
1543
|
-
jlcpcbOrderState: {
|
|
1544
|
-
created_at: string;
|
|
1545
|
-
order_id: string;
|
|
1546
|
-
jlcpcb_order_state_id: string;
|
|
1547
|
-
are_gerbers_uploaded: boolean;
|
|
1548
|
-
is_gerber_analyzed: boolean;
|
|
1549
|
-
are_initial_costs_calculated: boolean;
|
|
1550
|
-
is_pcb_added_to_cart: boolean;
|
|
1551
|
-
is_bom_uploaded: boolean;
|
|
1552
|
-
is_pnp_uploaded: boolean;
|
|
1553
|
-
is_bom_pnp_analyzed: boolean;
|
|
1554
|
-
is_bom_parsing_complete: boolean;
|
|
1555
|
-
are_components_available: boolean;
|
|
1556
|
-
is_patch_map_generated: boolean;
|
|
1557
|
-
is_json_merge_file_created: boolean;
|
|
1558
|
-
is_dfm_result_generated: boolean;
|
|
1559
|
-
are_files_downloaded: boolean;
|
|
1560
|
-
are_product_categories_fetched: boolean;
|
|
1561
|
-
are_final_costs_calculated: boolean;
|
|
1562
|
-
is_json_merge_file_updated: boolean;
|
|
1563
|
-
is_added_to_cart: boolean;
|
|
1564
|
-
are_gerbers_generated: boolean;
|
|
1565
|
-
current_step: string | null;
|
|
1566
|
-
uploaded_gerber_metadata?: any;
|
|
1567
|
-
gerber_analysis?: any;
|
|
1568
|
-
}[];
|
|
1569
|
-
jlcpcbOrderStepRuns: {
|
|
1570
|
-
created_at: string;
|
|
1571
|
-
is_running: boolean | null;
|
|
1572
|
-
jlcpcb_order_state_id: string | null;
|
|
1573
|
-
jlcpcb_order_step_run_id: string;
|
|
1574
|
-
step_function_name: string | null;
|
|
1575
|
-
error_message: string | null;
|
|
1576
|
-
}[];
|
|
1577
1475
|
orderQuotes: {
|
|
1578
1476
|
error: z.objectOutputType<{
|
|
1579
1477
|
error_code: z.ZodString;
|
|
@@ -1716,7 +1614,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1716
1614
|
org_domain_id: string;
|
|
1717
1615
|
package_release_id?: string | null | undefined;
|
|
1718
1616
|
}[];
|
|
1719
|
-
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "
|
|
1617
|
+
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "updateOrder" | "addOrderFile" | "getOrderFileById" | "addBugReport" | "getBugReportById" | "addBugReportFile" | "getBugReportFilesByBugReportId" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "searchOrgs" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "deleteSession" | "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" | "updateOrganizationAccount" | "updateOrganization" | "deleteOrganization" | "deleteAccount" | "addOrgInvitation" | "getOrgInvitationByToken" | "listOrgInvitations" | "updateOrgInvitation" | "addPackageDomain" | "getPackageDomainById" | "getPackageDomainByFQDN" | "addOrgDomain" | "getOrgDomainById" | "getOrgDomainByFQDN" | "listOrgDomains" | "updateOrgDomain" | "addOrgDomainLinkedPackage" | "getOrgDomainLinkedPackageById" | "listOrgDomainLinkedPackages" | "removeOrgDomainLinkedPackage" | "deletePackageDomain" | "updatePackageDomain"> & {
|
|
1720
1618
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
1721
1619
|
getOrderById: (orderId: string) => Order | undefined;
|
|
1722
1620
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -1726,11 +1624,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
1726
1624
|
vendor_name: string;
|
|
1727
1625
|
}) => string;
|
|
1728
1626
|
getOrderQuoteById: (orderQuoteId: string) => OrderQuote | undefined;
|
|
1729
|
-
getJlcpcbOrderStatesByOrderId: (orderId: string) => JlcpcbOrderState | undefined;
|
|
1730
|
-
getJlcpcbOrderStepRunsByJlcpcbOrderStateId: (jlcpcbOrderStateId: string) => JlcpcbOrderStepRun[];
|
|
1731
1627
|
updateOrder: (orderId: string, updates: Partial<Order>) => void;
|
|
1732
|
-
addJlcpcbOrderState: (orderState: Omit<JlcpcbOrderState, "jlcpcb_order_state_id">) => JlcpcbOrderState;
|
|
1733
|
-
updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
|
|
1734
1628
|
addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
|
|
1735
1629
|
getOrderFileById: (orderFileId: string) => OrderFile | undefined;
|
|
1736
1630
|
addBugReport: ({ reporter_account_id, text, is_auto_deleted, delete_at, }: {
|
|
@@ -2162,6 +2056,14 @@ declare const createDatabase: ({ seed }?: {
|
|
|
2162
2056
|
started_at: string | null;
|
|
2163
2057
|
completed_at: string | null;
|
|
2164
2058
|
circuit_json?: any;
|
|
2059
|
+
submitted_package_release_id?: string | null | undefined;
|
|
2060
|
+
adapted_package_release_id?: string | null | undefined;
|
|
2061
|
+
stripe_checkout_session_id?: string | null | undefined;
|
|
2062
|
+
stripe_checkout_session_url?: string | null | undefined;
|
|
2063
|
+
is_stripe_checkout_session_complete?: boolean | undefined;
|
|
2064
|
+
is_stripe_checkout_session_expired?: boolean | undefined;
|
|
2065
|
+
is_stripe_checkout_session_open?: boolean | undefined;
|
|
2066
|
+
is_stripe_payment_paid?: boolean | undefined;
|
|
2165
2067
|
}[];
|
|
2166
2068
|
organizations: {
|
|
2167
2069
|
created_at: string;
|
|
@@ -2222,40 +2124,6 @@ declare const createDatabase: ({ seed }?: {
|
|
|
2222
2124
|
account_package_id: string;
|
|
2223
2125
|
package_id: string;
|
|
2224
2126
|
}[];
|
|
2225
|
-
jlcpcbOrderState: {
|
|
2226
|
-
created_at: string;
|
|
2227
|
-
order_id: string;
|
|
2228
|
-
jlcpcb_order_state_id: string;
|
|
2229
|
-
are_gerbers_uploaded: boolean;
|
|
2230
|
-
is_gerber_analyzed: boolean;
|
|
2231
|
-
are_initial_costs_calculated: boolean;
|
|
2232
|
-
is_pcb_added_to_cart: boolean;
|
|
2233
|
-
is_bom_uploaded: boolean;
|
|
2234
|
-
is_pnp_uploaded: boolean;
|
|
2235
|
-
is_bom_pnp_analyzed: boolean;
|
|
2236
|
-
is_bom_parsing_complete: boolean;
|
|
2237
|
-
are_components_available: boolean;
|
|
2238
|
-
is_patch_map_generated: boolean;
|
|
2239
|
-
is_json_merge_file_created: boolean;
|
|
2240
|
-
is_dfm_result_generated: boolean;
|
|
2241
|
-
are_files_downloaded: boolean;
|
|
2242
|
-
are_product_categories_fetched: boolean;
|
|
2243
|
-
are_final_costs_calculated: boolean;
|
|
2244
|
-
is_json_merge_file_updated: boolean;
|
|
2245
|
-
is_added_to_cart: boolean;
|
|
2246
|
-
are_gerbers_generated: boolean;
|
|
2247
|
-
current_step: string | null;
|
|
2248
|
-
uploaded_gerber_metadata?: any;
|
|
2249
|
-
gerber_analysis?: any;
|
|
2250
|
-
}[];
|
|
2251
|
-
jlcpcbOrderStepRuns: {
|
|
2252
|
-
created_at: string;
|
|
2253
|
-
is_running: boolean | null;
|
|
2254
|
-
jlcpcb_order_state_id: string | null;
|
|
2255
|
-
jlcpcb_order_step_run_id: string;
|
|
2256
|
-
step_function_name: string | null;
|
|
2257
|
-
error_message: string | null;
|
|
2258
|
-
}[];
|
|
2259
2127
|
orderQuotes: {
|
|
2260
2128
|
error: z.objectOutputType<{
|
|
2261
2129
|
error_code: z.ZodString;
|
|
@@ -2398,7 +2266,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
2398
2266
|
org_domain_id: string;
|
|
2399
2267
|
package_release_id?: string | null | undefined;
|
|
2400
2268
|
}[];
|
|
2401
|
-
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "
|
|
2269
|
+
}, "addOrder" | "getOrderById" | "getOrderFilesByOrderId" | "addOrderQuote" | "getOrderQuoteById" | "updateOrder" | "addOrderFile" | "getOrderFileById" | "addBugReport" | "getBugReportById" | "addBugReportFile" | "getBugReportFilesByBugReportId" | "addAccount" | "addAccountPackage" | "getAccountPackageById" | "updateAccountPackage" | "deleteAccountPackage" | "addSnippet" | "getLatestSnippets" | "getTrendingSnippets" | "getPackagesByAuthor" | "getSnippetByAuthorAndName" | "updateSnippet" | "getSnippetById" | "searchSnippets" | "searchPackages" | "searchAccounts" | "searchOrgs" | "deleteSnippet" | "addSession" | "getSessions" | "createLoginPage" | "getLoginPage" | "updateLoginPage" | "getAccount" | "updateAccount" | "createSession" | "deleteSession" | "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" | "updateOrganizationAccount" | "updateOrganization" | "deleteOrganization" | "deleteAccount" | "addOrgInvitation" | "getOrgInvitationByToken" | "listOrgInvitations" | "updateOrgInvitation" | "addPackageDomain" | "getPackageDomainById" | "getPackageDomainByFQDN" | "addOrgDomain" | "getOrgDomainById" | "getOrgDomainByFQDN" | "listOrgDomains" | "updateOrgDomain" | "addOrgDomainLinkedPackage" | "getOrgDomainLinkedPackageById" | "listOrgDomainLinkedPackages" | "removeOrgDomainLinkedPackage" | "deletePackageDomain" | "updatePackageDomain"> & {
|
|
2402
2270
|
addOrder: (order: Omit<Order, "order_id">) => Order;
|
|
2403
2271
|
getOrderById: (orderId: string) => Order | undefined;
|
|
2404
2272
|
getOrderFilesByOrderId: (orderId: string) => OrderFile[];
|
|
@@ -2408,11 +2276,7 @@ declare const createDatabase: ({ seed }?: {
|
|
|
2408
2276
|
vendor_name: string;
|
|
2409
2277
|
}) => string;
|
|
2410
2278
|
getOrderQuoteById: (orderQuoteId: string) => OrderQuote | undefined;
|
|
2411
|
-
getJlcpcbOrderStatesByOrderId: (orderId: string) => JlcpcbOrderState | undefined;
|
|
2412
|
-
getJlcpcbOrderStepRunsByJlcpcbOrderStateId: (jlcpcbOrderStateId: string) => JlcpcbOrderStepRun[];
|
|
2413
2279
|
updateOrder: (orderId: string, updates: Partial<Order>) => void;
|
|
2414
|
-
addJlcpcbOrderState: (orderState: Omit<JlcpcbOrderState, "jlcpcb_order_state_id">) => JlcpcbOrderState;
|
|
2415
|
-
updateJlcpcbOrderState: (orderId: string, updates: Partial<JlcpcbOrderState>) => void;
|
|
2416
2280
|
addOrderFile: (orderFile: Omit<OrderFile, "order_file_id">) => OrderFile;
|
|
2417
2281
|
getOrderFileById: (orderFileId: string) => OrderFile | undefined;
|
|
2418
2282
|
addBugReport: ({ reporter_account_id, text, is_auto_deleted, delete_at, }: {
|
package/dist/index.js
CHANGED
|
@@ -84,6 +84,14 @@ var publicAccountSchema = z.object({
|
|
|
84
84
|
var orderSchema = z.object({
|
|
85
85
|
order_id: z.string(),
|
|
86
86
|
account_id: z.string().nullable(),
|
|
87
|
+
submitted_package_release_id: z.string().nullable().optional(),
|
|
88
|
+
adapted_package_release_id: z.string().nullable().optional(),
|
|
89
|
+
stripe_checkout_session_id: z.string().nullable().optional(),
|
|
90
|
+
stripe_checkout_session_url: z.string().nullable().optional(),
|
|
91
|
+
is_stripe_checkout_session_complete: z.boolean().optional(),
|
|
92
|
+
is_stripe_checkout_session_expired: z.boolean().optional(),
|
|
93
|
+
is_stripe_checkout_session_open: z.boolean().optional(),
|
|
94
|
+
is_stripe_payment_paid: z.boolean().optional(),
|
|
87
95
|
is_running: z.boolean(),
|
|
88
96
|
is_started: z.boolean(),
|
|
89
97
|
is_finished: z.boolean(),
|
|
@@ -390,40 +398,6 @@ var packageSchema = z.object({
|
|
|
390
398
|
latest_cad_preview_image_url: z.string().nullable().optional(),
|
|
391
399
|
github_installation_id: z.string().nullable().optional()
|
|
392
400
|
});
|
|
393
|
-
var jlcpcbOrderStateSchema = z.object({
|
|
394
|
-
jlcpcb_order_state_id: z.string(),
|
|
395
|
-
order_id: z.string(),
|
|
396
|
-
are_gerbers_uploaded: z.boolean().default(false),
|
|
397
|
-
is_gerber_analyzed: z.boolean().default(false),
|
|
398
|
-
are_initial_costs_calculated: z.boolean().default(false),
|
|
399
|
-
is_pcb_added_to_cart: z.boolean().default(false),
|
|
400
|
-
is_bom_uploaded: z.boolean().default(false),
|
|
401
|
-
is_pnp_uploaded: z.boolean().default(false),
|
|
402
|
-
is_bom_pnp_analyzed: z.boolean().default(false),
|
|
403
|
-
is_bom_parsing_complete: z.boolean().default(false),
|
|
404
|
-
are_components_available: z.boolean().default(false),
|
|
405
|
-
is_patch_map_generated: z.boolean().default(false),
|
|
406
|
-
is_json_merge_file_created: z.boolean().default(false),
|
|
407
|
-
is_dfm_result_generated: z.boolean().default(false),
|
|
408
|
-
are_files_downloaded: z.boolean().default(false),
|
|
409
|
-
are_product_categories_fetched: z.boolean().default(false),
|
|
410
|
-
are_final_costs_calculated: z.boolean().default(false),
|
|
411
|
-
is_json_merge_file_updated: z.boolean().default(false),
|
|
412
|
-
is_added_to_cart: z.boolean().default(false),
|
|
413
|
-
uploaded_gerber_metadata: z.any().nullable().default(null),
|
|
414
|
-
gerber_analysis: z.any().nullable().default(null),
|
|
415
|
-
created_at: z.string(),
|
|
416
|
-
are_gerbers_generated: z.boolean().default(false),
|
|
417
|
-
current_step: z.string().nullable().default(null)
|
|
418
|
-
});
|
|
419
|
-
var jlcpcbOrderStepRunSchema = z.object({
|
|
420
|
-
jlcpcb_order_step_run_id: z.string(),
|
|
421
|
-
is_running: z.boolean().nullable().default(null),
|
|
422
|
-
step_function_name: z.string().nullable().default(null),
|
|
423
|
-
jlcpcb_order_state_id: z.string().nullable().default(null),
|
|
424
|
-
error_message: z.string().nullable().default(null),
|
|
425
|
-
created_at: z.string()
|
|
426
|
-
});
|
|
427
401
|
var packageBuildSchema = z.object({
|
|
428
402
|
package_build_id: z.string().uuid(),
|
|
429
403
|
package_release_id: z.string(),
|
|
@@ -588,8 +562,6 @@ var databaseSchema = z.object({
|
|
|
588
562
|
orderFiles: z.array(orderFileSchema).default([]),
|
|
589
563
|
accountSnippets: z.array(accountSnippetSchema).default([]),
|
|
590
564
|
accountPackages: z.array(accountPackageSchema).default([]),
|
|
591
|
-
jlcpcbOrderState: z.array(jlcpcbOrderStateSchema).default([]),
|
|
592
|
-
jlcpcbOrderStepRuns: z.array(jlcpcbOrderStepRunSchema).default([]),
|
|
593
565
|
orderQuotes: z.array(orderQuoteSchema).default([]),
|
|
594
566
|
aiReviews: z.array(aiReviewSchema).default([]),
|
|
595
567
|
datasheets: z.array(datasheetSchema).default([]),
|
|
@@ -3750,21 +3722,6 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
|
|
|
3750
3722
|
(quote) => quote.order_quote_id === orderQuoteId
|
|
3751
3723
|
);
|
|
3752
3724
|
},
|
|
3753
|
-
getJlcpcbOrderStatesByOrderId: (orderId) => {
|
|
3754
|
-
const state = get();
|
|
3755
|
-
return state.jlcpcbOrderState.find((state2) => state2.order_id === orderId);
|
|
3756
|
-
},
|
|
3757
|
-
getJlcpcbOrderStepRunsByJlcpcbOrderStateId: (jlcpcbOrderStateId) => {
|
|
3758
|
-
const state = get();
|
|
3759
|
-
return state.jlcpcbOrderStepRuns.filter((stepRun) => {
|
|
3760
|
-
const orderState = state.jlcpcbOrderState.find(
|
|
3761
|
-
(state2) => state2.jlcpcb_order_state_id === stepRun.jlcpcb_order_state_id
|
|
3762
|
-
);
|
|
3763
|
-
return orderState?.order_id === jlcpcbOrderStateId;
|
|
3764
|
-
}).sort(
|
|
3765
|
-
(a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()
|
|
3766
|
-
);
|
|
3767
|
-
},
|
|
3768
3725
|
updateOrder: (orderId, updates) => {
|
|
3769
3726
|
set((state) => ({
|
|
3770
3727
|
orders: state.orders.map(
|
|
@@ -3772,26 +3729,6 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
|
|
|
3772
3729
|
)
|
|
3773
3730
|
}));
|
|
3774
3731
|
},
|
|
3775
|
-
addJlcpcbOrderState: (orderState) => {
|
|
3776
|
-
const newOrderState = {
|
|
3777
|
-
jlcpcb_order_state_id: `order_state_${get().idCounter + 1}`,
|
|
3778
|
-
...orderState
|
|
3779
|
-
};
|
|
3780
|
-
set((state) => {
|
|
3781
|
-
return {
|
|
3782
|
-
jlcpcbOrderState: [...state.jlcpcbOrderState, newOrderState],
|
|
3783
|
-
idCounter: state.idCounter + 1
|
|
3784
|
-
};
|
|
3785
|
-
});
|
|
3786
|
-
return newOrderState;
|
|
3787
|
-
},
|
|
3788
|
-
updateJlcpcbOrderState: (orderId, updates) => {
|
|
3789
|
-
set((state) => ({
|
|
3790
|
-
jlcpcbOrderState: state.jlcpcbOrderState.map(
|
|
3791
|
-
(orderState) => orderState.order_id === orderId ? { ...orderState, ...updates } : orderState
|
|
3792
|
-
)
|
|
3793
|
-
}));
|
|
3794
|
-
},
|
|
3795
3732
|
addOrderFile: (orderFile) => {
|
|
3796
3733
|
const newOrderFile = {
|
|
3797
3734
|
order_file_id: `order_file_${get().idCounter + 1}`,
|