@tscircuit/fake-snippets 0.0.143 → 0.0.144

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
@@ -1649,6 +1649,7 @@ declare const createDatabase: ({ seed }?: {
1649
1649
  };
1650
1650
  getOrgs: (filters?: {
1651
1651
  owner_account_id?: string;
1652
+ account_id?: string;
1652
1653
  github_handle?: string;
1653
1654
  tscircuit_handle?: string;
1654
1655
  name?: string;
@@ -2237,6 +2238,7 @@ declare const createDatabase: ({ seed }?: {
2237
2238
  };
2238
2239
  getOrgs: (filters?: {
2239
2240
  owner_account_id?: string;
2241
+ account_id?: string;
2240
2242
  github_handle?: string;
2241
2243
  tscircuit_handle?: string;
2242
2244
  name?: string;
package/dist/index.js CHANGED
@@ -3868,13 +3868,21 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
3868
3868
  return newOrganization;
3869
3869
  },
3870
3870
  getOrgs: (filters, auth) => {
3871
- console.log(filters);
3872
3871
  let orgs = get().organizations;
3873
3872
  if (filters?.owner_account_id) {
3874
3873
  orgs = orgs.filter(
3875
3874
  (org) => org.owner_account_id === filters.owner_account_id
3876
3875
  );
3877
3876
  }
3877
+ if (filters?.account_id) {
3878
+ orgs = orgs.filter((org) => {
3879
+ const isMemberViaOrgAccounts = get().orgAccounts.some(
3880
+ (oa) => oa.org_id === org.org_id && oa.account_id === filters.account_id
3881
+ );
3882
+ const isPersonalOrg = org.is_personal_org && org.owner_account_id === filters.account_id;
3883
+ return isMemberViaOrgAccounts || isPersonalOrg;
3884
+ });
3885
+ }
3878
3886
  if (filters?.github_handle) {
3879
3887
  orgs = orgs.filter((org) => {
3880
3888
  const account = get().accounts.find(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/fake-snippets",
3
- "version": "0.0.143",
3
+ "version": "0.0.144",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",