@tscircuit/fake-snippets 0.0.134 → 0.0.136

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/index.d.ts CHANGED
@@ -116,6 +116,7 @@ type LoginPage = z.infer<typeof loginPageSchema>;
116
116
  declare const accountSchema: z.ZodObject<{
117
117
  account_id: z.ZodString;
118
118
  github_username: z.ZodString;
119
+ tscircuit_handle: z.ZodNullable<z.ZodString>;
119
120
  shippingInfo: z.ZodOptional<z.ZodObject<{
120
121
  firstName: z.ZodString;
121
122
  lastName: z.ZodString;
@@ -155,6 +156,7 @@ declare const accountSchema: z.ZodObject<{
155
156
  }, "strip", z.ZodTypeAny, {
156
157
  account_id: string;
157
158
  github_username: string;
159
+ tscircuit_handle: string | null;
158
160
  is_tscircuit_staff: boolean;
159
161
  shippingInfo?: {
160
162
  firstName: string;
@@ -172,6 +174,7 @@ declare const accountSchema: z.ZodObject<{
172
174
  }, {
173
175
  account_id: string;
174
176
  github_username: string;
177
+ tscircuit_handle: string | null;
175
178
  shippingInfo?: {
176
179
  firstName: string;
177
180
  lastName: string;
@@ -571,7 +574,16 @@ declare const packageReleaseSchema: z.ZodObject<{
571
574
  user_code_started_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
572
575
  user_code_completed_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
573
576
  user_code_build_logs: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
574
- user_code_error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
577
+ user_code_error: z.ZodDefault<z.ZodNullable<z.ZodObject<{
578
+ error_code: z.ZodString;
579
+ message: z.ZodString;
580
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
581
+ error_code: z.ZodString;
582
+ message: z.ZodString;
583
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
584
+ error_code: z.ZodString;
585
+ message: z.ZodString;
586
+ }, z.ZodTypeAny, "passthrough">>>>;
575
587
  user_code_log_stream_url: z.ZodDefault<z.ZodNullable<z.ZodString>>;
576
588
  circuit_json_build_display_status: z.ZodDefault<z.ZodEnum<["pending", "building", "complete", "error"]>>;
577
589
  circuit_json_build_in_progress: z.ZodDefault<z.ZodBoolean>;
@@ -619,7 +631,10 @@ declare const packageReleaseSchema: z.ZodObject<{
619
631
  user_code_started_at: string | null;
620
632
  user_code_completed_at: string | null;
621
633
  user_code_build_logs: any[] | null;
622
- user_code_error: string | null;
634
+ user_code_error: z.objectOutputType<{
635
+ error_code: z.ZodString;
636
+ message: z.ZodString;
637
+ }, z.ZodTypeAny, "passthrough"> | null;
623
638
  user_code_log_stream_url: string | null;
624
639
  circuit_json_build_display_status: "error" | "pending" | "building" | "complete";
625
640
  circuit_json_build_in_progress: boolean;
@@ -686,7 +701,10 @@ declare const packageReleaseSchema: z.ZodObject<{
686
701
  user_code_started_at?: string | null | undefined;
687
702
  user_code_completed_at?: string | null | undefined;
688
703
  user_code_build_logs?: any[] | null | undefined;
689
- user_code_error?: string | null | undefined;
704
+ user_code_error?: z.objectInputType<{
705
+ error_code: z.ZodString;
706
+ message: z.ZodString;
707
+ }, z.ZodTypeAny, "passthrough"> | null | undefined;
690
708
  user_code_log_stream_url?: string | null | undefined;
691
709
  circuit_json_build_display_status?: "error" | "pending" | "building" | "complete" | undefined;
692
710
  circuit_json_build_in_progress?: boolean | undefined;
@@ -1039,26 +1057,29 @@ declare const packageBuildSchema: z.ZodObject<{
1039
1057
  type PackageBuild = z.infer<typeof packageBuildSchema>;
1040
1058
  declare const orgSchema: z.ZodObject<{
1041
1059
  org_id: z.ZodString;
1042
- github_handle: z.ZodOptional<z.ZodString>;
1043
1060
  owner_account_id: z.ZodString;
1044
1061
  is_personal_org: z.ZodDefault<z.ZodBoolean>;
1045
1062
  created_at: z.ZodString;
1046
1063
  org_display_name: z.ZodOptional<z.ZodString>;
1064
+ github_handle: z.ZodNullable<z.ZodString>;
1065
+ tscircuit_handle: z.ZodNullable<z.ZodString>;
1047
1066
  org_name: z.ZodString;
1048
1067
  }, "strip", z.ZodTypeAny, {
1049
1068
  created_at: string;
1069
+ tscircuit_handle: string | null;
1050
1070
  org_id: string;
1051
1071
  owner_account_id: string;
1052
1072
  is_personal_org: boolean;
1073
+ github_handle: string | null;
1053
1074
  org_name: string;
1054
- github_handle?: string | undefined;
1055
1075
  org_display_name?: string | undefined;
1056
1076
  }, {
1057
1077
  created_at: string;
1078
+ tscircuit_handle: string | null;
1058
1079
  org_id: string;
1059
1080
  owner_account_id: string;
1081
+ github_handle: string | null;
1060
1082
  org_name: string;
1061
- github_handle?: string | undefined;
1062
1083
  is_personal_org?: boolean | undefined;
1063
1084
  org_display_name?: string | undefined;
1064
1085
  }>;
@@ -1143,7 +1164,10 @@ declare const createDatabase: ({ seed }?: {
1143
1164
  user_code_started_at: string | null;
1144
1165
  user_code_completed_at: string | null;
1145
1166
  user_code_build_logs: any[] | null;
1146
- user_code_error: string | null;
1167
+ user_code_error: z.objectOutputType<{
1168
+ error_code: z.ZodString;
1169
+ message: z.ZodString;
1170
+ }, z.ZodTypeAny, "passthrough"> | null;
1147
1171
  user_code_log_stream_url: string | null;
1148
1172
  circuit_json_build_display_status: "error" | "pending" | "building" | "complete";
1149
1173
  circuit_json_build_in_progress: boolean;
@@ -1211,6 +1235,7 @@ declare const createDatabase: ({ seed }?: {
1211
1235
  accounts: {
1212
1236
  account_id: string;
1213
1237
  github_username: string;
1238
+ tscircuit_handle: string | null;
1214
1239
  is_tscircuit_staff: boolean;
1215
1240
  shippingInfo?: {
1216
1241
  firstName: string;
@@ -1281,11 +1306,12 @@ declare const createDatabase: ({ seed }?: {
1281
1306
  }[];
1282
1307
  organizations: {
1283
1308
  created_at: string;
1309
+ tscircuit_handle: string | null;
1284
1310
  org_id: string;
1285
1311
  owner_account_id: string;
1286
1312
  is_personal_org: boolean;
1313
+ github_handle: string | null;
1287
1314
  org_name: string;
1288
- github_handle?: string | undefined;
1289
1315
  org_display_name?: string | undefined;
1290
1316
  }[];
1291
1317
  orgAccounts: {
@@ -1502,6 +1528,7 @@ declare const createDatabase: ({ seed }?: {
1502
1528
  addAccount: (account: Omit<Account, "account_id" | "is_tscircuit_staff"> & Partial<Pick<Account, "account_id" | "is_tscircuit_staff">>) => {
1503
1529
  is_tscircuit_staff: boolean;
1504
1530
  github_username: string;
1531
+ tscircuit_handle: string | null;
1505
1532
  shippingInfo?: {
1506
1533
  firstName: string;
1507
1534
  lastName: string;
@@ -1595,18 +1622,21 @@ declare const createDatabase: ({ seed }?: {
1595
1622
  owner_account_id: string;
1596
1623
  github_handle?: string;
1597
1624
  org_display_name?: string;
1625
+ tscircuit_handle?: string;
1598
1626
  }) => {
1599
1627
  created_at: string;
1628
+ tscircuit_handle: string | null;
1600
1629
  org_id: string;
1601
1630
  owner_account_id: string;
1602
1631
  is_personal_org: boolean;
1632
+ github_handle: string | null;
1603
1633
  org_name: string;
1604
- github_handle?: string | undefined;
1605
1634
  org_display_name?: string | undefined;
1606
1635
  };
1607
1636
  getOrgs: (filters?: {
1608
1637
  owner_account_id?: string;
1609
1638
  github_handle?: string;
1639
+ tscircuit_handle?: string;
1610
1640
  name?: string;
1611
1641
  }, auth?: {
1612
1642
  account_id?: string;
@@ -1615,17 +1645,19 @@ declare const createDatabase: ({ seed }?: {
1615
1645
  package_count: number;
1616
1646
  can_manage_org: boolean;
1617
1647
  created_at: string;
1648
+ tscircuit_handle: string | null;
1618
1649
  org_id: string;
1619
1650
  owner_account_id: string;
1620
1651
  is_personal_org: boolean;
1652
+ github_handle: string | null;
1621
1653
  org_name: string;
1622
- github_handle?: string | undefined;
1623
1654
  org_display_name?: string | undefined;
1624
1655
  }[];
1625
1656
  getOrg: (filters: {
1626
1657
  org_id?: string;
1627
1658
  org_name?: string;
1628
1659
  github_handle?: string;
1660
+ tscircuit_handle?: string;
1629
1661
  }, auth?: {
1630
1662
  account_id: string;
1631
1663
  }) => {
@@ -1633,11 +1665,12 @@ declare const createDatabase: ({ seed }?: {
1633
1665
  package_count: number;
1634
1666
  can_manage_org: boolean;
1635
1667
  created_at: string;
1668
+ tscircuit_handle: string | null;
1636
1669
  org_id: string;
1637
1670
  owner_account_id: string;
1638
1671
  is_personal_org: boolean;
1672
+ github_handle: string | null;
1639
1673
  org_name: string;
1640
- github_handle?: string | undefined;
1641
1674
  org_display_name?: string | undefined;
1642
1675
  } | null;
1643
1676
  addOrganizationAccount: (organizationAccount: {
@@ -1714,7 +1747,10 @@ declare const createDatabase: ({ seed }?: {
1714
1747
  user_code_started_at: string | null;
1715
1748
  user_code_completed_at: string | null;
1716
1749
  user_code_build_logs: any[] | null;
1717
- user_code_error: string | null;
1750
+ user_code_error: z.objectOutputType<{
1751
+ error_code: z.ZodString;
1752
+ message: z.ZodString;
1753
+ }, z.ZodTypeAny, "passthrough"> | null;
1718
1754
  user_code_log_stream_url: string | null;
1719
1755
  circuit_json_build_display_status: "error" | "pending" | "building" | "complete";
1720
1756
  circuit_json_build_in_progress: boolean;
@@ -1782,6 +1818,7 @@ declare const createDatabase: ({ seed }?: {
1782
1818
  accounts: {
1783
1819
  account_id: string;
1784
1820
  github_username: string;
1821
+ tscircuit_handle: string | null;
1785
1822
  is_tscircuit_staff: boolean;
1786
1823
  shippingInfo?: {
1787
1824
  firstName: string;
@@ -1852,11 +1889,12 @@ declare const createDatabase: ({ seed }?: {
1852
1889
  }[];
1853
1890
  organizations: {
1854
1891
  created_at: string;
1892
+ tscircuit_handle: string | null;
1855
1893
  org_id: string;
1856
1894
  owner_account_id: string;
1857
1895
  is_personal_org: boolean;
1896
+ github_handle: string | null;
1858
1897
  org_name: string;
1859
- github_handle?: string | undefined;
1860
1898
  org_display_name?: string | undefined;
1861
1899
  }[];
1862
1900
  orgAccounts: {
@@ -2073,6 +2111,7 @@ declare const createDatabase: ({ seed }?: {
2073
2111
  addAccount: (account: Omit<Account, "account_id" | "is_tscircuit_staff"> & Partial<Pick<Account, "account_id" | "is_tscircuit_staff">>) => {
2074
2112
  is_tscircuit_staff: boolean;
2075
2113
  github_username: string;
2114
+ tscircuit_handle: string | null;
2076
2115
  shippingInfo?: {
2077
2116
  firstName: string;
2078
2117
  lastName: string;
@@ -2166,18 +2205,21 @@ declare const createDatabase: ({ seed }?: {
2166
2205
  owner_account_id: string;
2167
2206
  github_handle?: string;
2168
2207
  org_display_name?: string;
2208
+ tscircuit_handle?: string;
2169
2209
  }) => {
2170
2210
  created_at: string;
2211
+ tscircuit_handle: string | null;
2171
2212
  org_id: string;
2172
2213
  owner_account_id: string;
2173
2214
  is_personal_org: boolean;
2215
+ github_handle: string | null;
2174
2216
  org_name: string;
2175
- github_handle?: string | undefined;
2176
2217
  org_display_name?: string | undefined;
2177
2218
  };
2178
2219
  getOrgs: (filters?: {
2179
2220
  owner_account_id?: string;
2180
2221
  github_handle?: string;
2222
+ tscircuit_handle?: string;
2181
2223
  name?: string;
2182
2224
  }, auth?: {
2183
2225
  account_id?: string;
@@ -2186,17 +2228,19 @@ declare const createDatabase: ({ seed }?: {
2186
2228
  package_count: number;
2187
2229
  can_manage_org: boolean;
2188
2230
  created_at: string;
2231
+ tscircuit_handle: string | null;
2189
2232
  org_id: string;
2190
2233
  owner_account_id: string;
2191
2234
  is_personal_org: boolean;
2235
+ github_handle: string | null;
2192
2236
  org_name: string;
2193
- github_handle?: string | undefined;
2194
2237
  org_display_name?: string | undefined;
2195
2238
  }[];
2196
2239
  getOrg: (filters: {
2197
2240
  org_id?: string;
2198
2241
  org_name?: string;
2199
2242
  github_handle?: string;
2243
+ tscircuit_handle?: string;
2200
2244
  }, auth?: {
2201
2245
  account_id: string;
2202
2246
  }) => {
@@ -2204,11 +2248,12 @@ declare const createDatabase: ({ seed }?: {
2204
2248
  package_count: number;
2205
2249
  can_manage_org: boolean;
2206
2250
  created_at: string;
2251
+ tscircuit_handle: string | null;
2207
2252
  org_id: string;
2208
2253
  owner_account_id: string;
2209
2254
  is_personal_org: boolean;
2255
+ github_handle: string | null;
2210
2256
  org_name: string;
2211
- github_handle?: string | undefined;
2212
2257
  org_display_name?: string | undefined;
2213
2258
  } | null;
2214
2259
  addOrganizationAccount: (organizationAccount: {
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ var shippingInfoSchema = z.object({
66
66
  var accountSchema = z.object({
67
67
  account_id: z.string(),
68
68
  github_username: z.string(),
69
+ tscircuit_handle: z.string().nullable(),
69
70
  shippingInfo: shippingInfoSchema.optional(),
70
71
  personal_org_id: z.string().optional(),
71
72
  is_tscircuit_staff: z.boolean().default(false)
@@ -227,7 +228,7 @@ var packageReleaseSchema = z.object({
227
228
  user_code_started_at: z.string().datetime().nullable().default(null),
228
229
  user_code_completed_at: z.string().datetime().nullable().default(null),
229
230
  user_code_build_logs: z.array(z.any()).nullable().default(null),
230
- user_code_error: z.string().nullable().default(null),
231
+ user_code_error: errorSchema.nullable().default(null),
231
232
  user_code_log_stream_url: z.string().nullable().default(null),
232
233
  // Circuit JSON Build Process
233
234
  circuit_json_build_display_status: z.enum(["pending", "building", "complete", "error"]).default("pending"),
@@ -375,11 +376,12 @@ var packageBuildSchema = z.object({
375
376
  });
376
377
  var orgSchema = z.object({
377
378
  org_id: z.string(),
378
- github_handle: z.string().optional(),
379
379
  owner_account_id: z.string(),
380
380
  is_personal_org: z.boolean().default(false),
381
381
  created_at: z.string().datetime(),
382
382
  org_display_name: z.string().optional(),
383
+ github_handle: z.string().nullable(),
384
+ tscircuit_handle: z.string().nullable(),
383
385
  org_name: z.string()
384
386
  });
385
387
  var orgAccountSchema = z.object({
@@ -404,7 +406,8 @@ var publicOrgSchema = z.object({
404
406
  is_personal_org: z.boolean(),
405
407
  display_name: z.string().optional(),
406
408
  package_count: z.number(),
407
- github_handle: z.string().optional(),
409
+ github_handle: z.string().nullable(),
410
+ tscircuit_handle: z.string().nullable(),
408
411
  created_at: z.string(),
409
412
  user_permissions: userPermissionsSchema.optional()
410
413
  });
@@ -623,6 +626,7 @@ var seed = (db) => {
623
626
  account_id: "account-1234",
624
627
  personal_org_id: "org-1234",
625
628
  github_username: "testuser",
629
+ tscircuit_handle: "testuser",
626
630
  shippingInfo: {
627
631
  firstName: "Test",
628
632
  lastName: "User",
@@ -637,7 +641,8 @@ var seed = (db) => {
637
641
  }
638
642
  });
639
643
  const seveibarAcc = db.addAccount({
640
- github_username: "seveibar"
644
+ github_username: "seveibar",
645
+ tscircuit_handle: "seveibar"
641
646
  });
642
647
  if (process.env.AUTOLOAD_PACKAGES === "true") {
643
648
  loadAutoloadPackages(db);
@@ -3388,7 +3393,7 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3388
3393
  if (!accountsWithPublicPackages.has(account.account_id)) {
3389
3394
  return false;
3390
3395
  }
3391
- return account.github_username.toLowerCase().includes(lowercaseQuery);
3396
+ return account.github_username.toLowerCase().includes(lowercaseQuery) || (account.tscircuit_handle?.toLowerCase().includes(lowercaseQuery) ?? false);
3392
3397
  }).slice(0, limit || 50);
3393
3398
  return matchingAccounts;
3394
3399
  },
@@ -3824,10 +3829,11 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3824
3829
  const newOrganization = {
3825
3830
  org_name: organization.name,
3826
3831
  org_id: organization.org_id || `org_${get().idCounter + 1}`,
3827
- github_handle: organization.github_handle,
3832
+ github_handle: organization.github_handle ?? null,
3828
3833
  is_personal_org: organization.is_personal_org || false,
3829
3834
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
3830
3835
  org_display_name: organization.org_display_name ?? organization.name,
3836
+ tscircuit_handle: organization.tscircuit_handle ?? null,
3831
3837
  ...organization
3832
3838
  };
3833
3839
  set((state) => ({
@@ -3841,6 +3847,7 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3841
3847
  return newOrganization;
3842
3848
  },
3843
3849
  getOrgs: (filters, auth) => {
3850
+ console.log(filters);
3844
3851
  let orgs = get().organizations;
3845
3852
  if (filters?.owner_account_id) {
3846
3853
  orgs = orgs.filter(
@@ -3855,8 +3862,15 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3855
3862
  return account?.github_username === filters.github_handle;
3856
3863
  });
3857
3864
  }
3865
+ if (filters?.tscircuit_handle) {
3866
+ orgs = orgs.filter(
3867
+ (org) => org.tscircuit_handle === filters.tscircuit_handle
3868
+ );
3869
+ }
3858
3870
  if (filters?.name) {
3859
- orgs = orgs.filter((org) => org.github_handle === filters.name);
3871
+ orgs = orgs.filter(
3872
+ (org) => org.github_handle === filters.name || org.tscircuit_handle === filters.name
3873
+ );
3860
3874
  }
3861
3875
  return orgs.map((org) => {
3862
3876
  const member_count = get().accounts.filter(
@@ -3885,6 +3899,11 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3885
3899
  if (filters?.github_handle) {
3886
3900
  orgs = orgs.filter((org2) => org2.github_handle === filters.github_handle);
3887
3901
  }
3902
+ if (filters?.tscircuit_handle) {
3903
+ orgs = orgs.filter(
3904
+ (org2) => org2.tscircuit_handle === filters.tscircuit_handle
3905
+ );
3906
+ }
3888
3907
  if (orgs.length === 0) {
3889
3908
  return null;
3890
3909
  }