Skip to content

Commit 5d51903

Browse files
committed
chore: regenerate SDK CLI and React hooks with generic type params + condition default false
Regenerated using updated codegen that: - Uses proper generic type parameters instead of as any - Makes select required via intersection type - Defaults condition to false (where/filter is first-class)
1 parent 2ae00f5 commit 5d51903

155 files changed

Lines changed: 2861 additions & 455 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/constructive-cli/src/admin/cli/commands/app-achievement.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppAchievementInput, AppAchievementPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppAchievementInput,
12+
AppAchievementPatch,
13+
AppAchievementSelect,
14+
AppAchievementFilter,
15+
AppAchievementOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
actorId: 'uuid',
@@ -74,7 +81,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7481
createdAt: true,
7582
updatedAt: true,
7683
};
77-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
84+
const findManyArgs = parseFindManyArgs<
85+
FindManyArgs<AppAchievementSelect, AppAchievementFilter, never, AppAchievementOrderBy> & {
86+
select: AppAchievementSelect;
87+
}
88+
>(argv, defaultSelect);
7889
const client = getClient();
7990
const result = await client.appAchievement.findMany(findManyArgs).execute();
8091
console.log(JSON.stringify(result, null, 2));
@@ -96,7 +107,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
96107
createdAt: true,
97108
updatedAt: true,
98109
};
99-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
110+
const findFirstArgs = parseFindFirstArgs<
111+
FindFirstArgs<AppAchievementSelect, AppAchievementFilter, never> & {
112+
select: AppAchievementSelect;
113+
}
114+
>(argv, defaultSelect);
100115
const client = getClient();
101116
const result = await client.appAchievement.findFirst(findFirstArgs).execute();
102117
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-admin-grant.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppAdminGrantInput, AppAdminGrantPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppAdminGrantInput,
12+
AppAdminGrantPatch,
13+
AppAdminGrantSelect,
14+
AppAdminGrantFilter,
15+
AppAdminGrantOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
isGrant: 'boolean',
@@ -74,7 +81,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7481
createdAt: true,
7582
updatedAt: true,
7683
};
77-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
84+
const findManyArgs = parseFindManyArgs<
85+
FindManyArgs<AppAdminGrantSelect, AppAdminGrantFilter, never, AppAdminGrantOrderBy> & {
86+
select: AppAdminGrantSelect;
87+
}
88+
>(argv, defaultSelect);
7889
const client = getClient();
7990
const result = await client.appAdminGrant.findMany(findManyArgs).execute();
8091
console.log(JSON.stringify(result, null, 2));
@@ -96,7 +107,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
96107
createdAt: true,
97108
updatedAt: true,
98109
};
99-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
110+
const findFirstArgs = parseFindFirstArgs<
111+
FindFirstArgs<AppAdminGrantSelect, AppAdminGrantFilter, never> & {
112+
select: AppAdminGrantSelect;
113+
}
114+
>(argv, defaultSelect);
100115
const client = getClient();
101116
const result = await client.appAdminGrant.findFirst(findFirstArgs).execute();
102117
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-grant.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppGrantInput, AppGrantPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppGrantInput,
12+
AppGrantPatch,
13+
AppGrantSelect,
14+
AppGrantFilter,
15+
AppGrantOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
permissions: 'string',
@@ -76,7 +83,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7683
createdAt: true,
7784
updatedAt: true,
7885
};
79-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
86+
const findManyArgs = parseFindManyArgs<
87+
FindManyArgs<AppGrantSelect, AppGrantFilter, never, AppGrantOrderBy> & {
88+
select: AppGrantSelect;
89+
}
90+
>(argv, defaultSelect);
8091
const client = getClient();
8192
const result = await client.appGrant.findMany(findManyArgs).execute();
8293
console.log(JSON.stringify(result, null, 2));
@@ -99,7 +110,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
99110
createdAt: true,
100111
updatedAt: true,
101112
};
102-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
113+
const findFirstArgs = parseFindFirstArgs<
114+
FindFirstArgs<AppGrantSelect, AppGrantFilter, never> & {
115+
select: AppGrantSelect;
116+
}
117+
>(argv, defaultSelect);
103118
const client = getClient();
104119
const result = await client.appGrant.findFirst(findFirstArgs).execute();
105120
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-level-requirement.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import type { FieldSchema } from '../utils';
1010
import type {
1111
CreateAppLevelRequirementInput,
1212
AppLevelRequirementPatch,
13+
AppLevelRequirementSelect,
14+
AppLevelRequirementFilter,
15+
AppLevelRequirementOrderBy,
1316
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1418
const fieldSchema: FieldSchema = {
1519
id: 'uuid',
1620
name: 'string',
@@ -81,7 +85,16 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
8185
createdAt: true,
8286
updatedAt: true,
8387
};
84-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
88+
const findManyArgs = parseFindManyArgs<
89+
FindManyArgs<
90+
AppLevelRequirementSelect,
91+
AppLevelRequirementFilter,
92+
never,
93+
AppLevelRequirementOrderBy
94+
> & {
95+
select: AppLevelRequirementSelect;
96+
}
97+
>(argv, defaultSelect);
8598
const client = getClient();
8699
const result = await client.appLevelRequirement.findMany(findManyArgs).execute();
87100
console.log(JSON.stringify(result, null, 2));
@@ -105,7 +118,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
105118
createdAt: true,
106119
updatedAt: true,
107120
};
108-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
121+
const findFirstArgs = parseFindFirstArgs<
122+
FindFirstArgs<AppLevelRequirementSelect, AppLevelRequirementFilter, never> & {
123+
select: AppLevelRequirementSelect;
124+
}
125+
>(argv, defaultSelect);
109126
const client = getClient();
110127
const result = await client.appLevelRequirement.findFirst(findFirstArgs).execute();
111128
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-level.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppLevelInput, AppLevelPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppLevelInput,
12+
AppLevelPatch,
13+
AppLevelSelect,
14+
AppLevelFilter,
15+
AppLevelOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
name: 'string',
@@ -76,7 +83,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7683
createdAt: true,
7784
updatedAt: true,
7885
};
79-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
86+
const findManyArgs = parseFindManyArgs<
87+
FindManyArgs<AppLevelSelect, AppLevelFilter, never, AppLevelOrderBy> & {
88+
select: AppLevelSelect;
89+
}
90+
>(argv, defaultSelect);
8091
const client = getClient();
8192
const result = await client.appLevel.findMany(findManyArgs).execute();
8293
console.log(JSON.stringify(result, null, 2));
@@ -99,7 +110,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
99110
createdAt: true,
100111
updatedAt: true,
101112
};
102-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
113+
const findFirstArgs = parseFindFirstArgs<
114+
FindFirstArgs<AppLevelSelect, AppLevelFilter, never> & {
115+
select: AppLevelSelect;
116+
}
117+
>(argv, defaultSelect);
103118
const client = getClient();
104119
const result = await client.appLevel.findFirst(findFirstArgs).execute();
105120
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-limit-default.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppLimitDefaultInput, AppLimitDefaultPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppLimitDefaultInput,
12+
AppLimitDefaultPatch,
13+
AppLimitDefaultSelect,
14+
AppLimitDefaultFilter,
15+
AppLimitDefaultOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
name: 'string',
@@ -68,7 +75,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
6875
name: true,
6976
max: true,
7077
};
71-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
78+
const findManyArgs = parseFindManyArgs<
79+
FindManyArgs<AppLimitDefaultSelect, AppLimitDefaultFilter, never, AppLimitDefaultOrderBy> & {
80+
select: AppLimitDefaultSelect;
81+
}
82+
>(argv, defaultSelect);
7283
const client = getClient();
7384
const result = await client.appLimitDefault.findMany(findManyArgs).execute();
7485
console.log(JSON.stringify(result, null, 2));
@@ -87,7 +98,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
8798
name: true,
8899
max: true,
89100
};
90-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
101+
const findFirstArgs = parseFindFirstArgs<
102+
FindFirstArgs<AppLimitDefaultSelect, AppLimitDefaultFilter, never> & {
103+
select: AppLimitDefaultSelect;
104+
}
105+
>(argv, defaultSelect);
91106
const client = getClient();
92107
const result = await client.appLimitDefault.findFirst(findFirstArgs).execute();
93108
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-limit.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppLimitInput, AppLimitPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppLimitInput,
12+
AppLimitPatch,
13+
AppLimitSelect,
14+
AppLimitFilter,
15+
AppLimitOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
name: 'string',
@@ -72,7 +79,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7279
num: true,
7380
max: true,
7481
};
75-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
82+
const findManyArgs = parseFindManyArgs<
83+
FindManyArgs<AppLimitSelect, AppLimitFilter, never, AppLimitOrderBy> & {
84+
select: AppLimitSelect;
85+
}
86+
>(argv, defaultSelect);
7687
const client = getClient();
7788
const result = await client.appLimit.findMany(findManyArgs).execute();
7889
console.log(JSON.stringify(result, null, 2));
@@ -93,7 +104,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
93104
num: true,
94105
max: true,
95106
};
96-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
107+
const findFirstArgs = parseFindFirstArgs<
108+
FindFirstArgs<AppLimitSelect, AppLimitFilter, never> & {
109+
select: AppLimitSelect;
110+
}
111+
>(argv, defaultSelect);
97112
const client = getClient();
98113
const result = await client.appLimit.findFirst(findFirstArgs).execute();
99114
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-membership-default.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import type { FieldSchema } from '../utils';
1010
import type {
1111
CreateAppMembershipDefaultInput,
1212
AppMembershipDefaultPatch,
13+
AppMembershipDefaultSelect,
14+
AppMembershipDefaultFilter,
15+
AppMembershipDefaultOrderBy,
1316
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1418
const fieldSchema: FieldSchema = {
1519
id: 'uuid',
1620
createdAt: 'string',
@@ -79,7 +83,16 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
7983
isApproved: true,
8084
isVerified: true,
8185
};
82-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
86+
const findManyArgs = parseFindManyArgs<
87+
FindManyArgs<
88+
AppMembershipDefaultSelect,
89+
AppMembershipDefaultFilter,
90+
never,
91+
AppMembershipDefaultOrderBy
92+
> & {
93+
select: AppMembershipDefaultSelect;
94+
}
95+
>(argv, defaultSelect);
8396
const client = getClient();
8497
const result = await client.appMembershipDefault.findMany(findManyArgs).execute();
8598
console.log(JSON.stringify(result, null, 2));
@@ -102,7 +115,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
102115
isApproved: true,
103116
isVerified: true,
104117
};
105-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
118+
const findFirstArgs = parseFindFirstArgs<
119+
FindFirstArgs<AppMembershipDefaultSelect, AppMembershipDefaultFilter, never> & {
120+
select: AppMembershipDefaultSelect;
121+
}
122+
>(argv, defaultSelect);
106123
const client = getClient();
107124
const result = await client.appMembershipDefault.findFirst(findFirstArgs).execute();
108125
console.log(JSON.stringify(result, null, 2));

sdk/constructive-cli/src/admin/cli/commands/app-membership.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer';
77
import { getClient } from '../executor';
88
import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils';
99
import type { FieldSchema } from '../utils';
10-
import type { CreateAppMembershipInput, AppMembershipPatch } from '../../orm/input-types';
10+
import type {
11+
CreateAppMembershipInput,
12+
AppMembershipPatch,
13+
AppMembershipSelect,
14+
AppMembershipFilter,
15+
AppMembershipOrderBy,
16+
} from '../../orm/input-types';
17+
import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types';
1118
const fieldSchema: FieldSchema = {
1219
id: 'uuid',
1320
createdAt: 'string',
@@ -94,7 +101,11 @@ async function handleList(argv: Partial<Record<string, unknown>>, _prompter: Inq
94101
actorId: true,
95102
profileId: true,
96103
};
97-
const findManyArgs = parseFindManyArgs(argv, defaultSelect);
104+
const findManyArgs = parseFindManyArgs<
105+
FindManyArgs<AppMembershipSelect, AppMembershipFilter, never, AppMembershipOrderBy> & {
106+
select: AppMembershipSelect;
107+
}
108+
>(argv, defaultSelect);
98109
const client = getClient();
99110
const result = await client.appMembership.findMany(findManyArgs).execute();
100111
console.log(JSON.stringify(result, null, 2));
@@ -126,7 +137,11 @@ async function handleFindFirst(argv: Partial<Record<string, unknown>>, _prompter
126137
actorId: true,
127138
profileId: true,
128139
};
129-
const findFirstArgs = parseFindFirstArgs(argv, defaultSelect);
140+
const findFirstArgs = parseFindFirstArgs<
141+
FindFirstArgs<AppMembershipSelect, AppMembershipFilter, never> & {
142+
select: AppMembershipSelect;
143+
}
144+
>(argv, defaultSelect);
130145
const client = getClient();
131146
const result = await client.appMembership.findFirst(findFirstArgs).execute();
132147
console.log(JSON.stringify(result, null, 2));

0 commit comments

Comments
 (0)