@constructive-io/sdk 0.5.2 → 0.6.0

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.
@@ -162,6 +162,13 @@ export interface InternetAddressFilter {
162
162
  export interface FullTextFilter {
163
163
  matches?: string;
164
164
  }
165
+ export interface VectorFilter {
166
+ isNull?: boolean;
167
+ equalTo?: number[];
168
+ notEqualTo?: number[];
169
+ distinctFrom?: number[];
170
+ notDistinctFrom?: number[];
171
+ }
165
172
  export interface StringListFilter {
166
173
  isNull?: boolean;
167
174
  equalTo?: string[];
@@ -1421,286 +1428,6 @@ export interface OrgInviteFilter {
1421
1428
  or?: OrgInviteFilter[];
1422
1429
  not?: OrgInviteFilter;
1423
1430
  }
1424
- export interface OrgGetManagersRecordCondition {
1425
- userId?: string | null;
1426
- depth?: number | null;
1427
- }
1428
- export interface OrgGetSubordinatesRecordCondition {
1429
- userId?: string | null;
1430
- depth?: number | null;
1431
- }
1432
- export interface AppPermissionCondition {
1433
- id?: string | null;
1434
- name?: string | null;
1435
- bitnum?: number | null;
1436
- bitstr?: string | null;
1437
- description?: string | null;
1438
- }
1439
- export interface OrgPermissionCondition {
1440
- id?: string | null;
1441
- name?: string | null;
1442
- bitnum?: number | null;
1443
- bitstr?: string | null;
1444
- description?: string | null;
1445
- }
1446
- export interface AppLevelRequirementCondition {
1447
- id?: string | null;
1448
- name?: string | null;
1449
- level?: string | null;
1450
- description?: string | null;
1451
- requiredCount?: number | null;
1452
- priority?: number | null;
1453
- createdAt?: string | null;
1454
- updatedAt?: string | null;
1455
- }
1456
- export interface OrgMemberCondition {
1457
- id?: string | null;
1458
- isAdmin?: boolean | null;
1459
- actorId?: string | null;
1460
- entityId?: string | null;
1461
- }
1462
- export interface AppPermissionDefaultCondition {
1463
- id?: string | null;
1464
- permissions?: string | null;
1465
- }
1466
- export interface OrgPermissionDefaultCondition {
1467
- id?: string | null;
1468
- permissions?: string | null;
1469
- entityId?: string | null;
1470
- }
1471
- export interface AppAdminGrantCondition {
1472
- id?: string | null;
1473
- isGrant?: boolean | null;
1474
- actorId?: string | null;
1475
- grantorId?: string | null;
1476
- createdAt?: string | null;
1477
- updatedAt?: string | null;
1478
- }
1479
- export interface AppOwnerGrantCondition {
1480
- id?: string | null;
1481
- isGrant?: boolean | null;
1482
- actorId?: string | null;
1483
- grantorId?: string | null;
1484
- createdAt?: string | null;
1485
- updatedAt?: string | null;
1486
- }
1487
- export interface OrgAdminGrantCondition {
1488
- id?: string | null;
1489
- isGrant?: boolean | null;
1490
- actorId?: string | null;
1491
- entityId?: string | null;
1492
- grantorId?: string | null;
1493
- createdAt?: string | null;
1494
- updatedAt?: string | null;
1495
- }
1496
- export interface OrgOwnerGrantCondition {
1497
- id?: string | null;
1498
- isGrant?: boolean | null;
1499
- actorId?: string | null;
1500
- entityId?: string | null;
1501
- grantorId?: string | null;
1502
- createdAt?: string | null;
1503
- updatedAt?: string | null;
1504
- }
1505
- export interface AppLimitDefaultCondition {
1506
- id?: string | null;
1507
- name?: string | null;
1508
- max?: number | null;
1509
- }
1510
- export interface OrgLimitDefaultCondition {
1511
- id?: string | null;
1512
- name?: string | null;
1513
- max?: number | null;
1514
- }
1515
- export interface MembershipTypeCondition {
1516
- id?: number | null;
1517
- name?: string | null;
1518
- description?: string | null;
1519
- prefix?: string | null;
1520
- }
1521
- export interface OrgChartEdgeGrantCondition {
1522
- id?: string | null;
1523
- entityId?: string | null;
1524
- childId?: string | null;
1525
- parentId?: string | null;
1526
- grantorId?: string | null;
1527
- isGrant?: boolean | null;
1528
- positionTitle?: string | null;
1529
- positionLevel?: number | null;
1530
- createdAt?: string | null;
1531
- }
1532
- export interface AppLimitCondition {
1533
- id?: string | null;
1534
- name?: string | null;
1535
- actorId?: string | null;
1536
- num?: number | null;
1537
- max?: number | null;
1538
- }
1539
- export interface AppAchievementCondition {
1540
- id?: string | null;
1541
- actorId?: string | null;
1542
- name?: string | null;
1543
- count?: number | null;
1544
- createdAt?: string | null;
1545
- updatedAt?: string | null;
1546
- }
1547
- export interface AppStepCondition {
1548
- id?: string | null;
1549
- actorId?: string | null;
1550
- name?: string | null;
1551
- count?: number | null;
1552
- createdAt?: string | null;
1553
- updatedAt?: string | null;
1554
- }
1555
- export interface ClaimedInviteCondition {
1556
- id?: string | null;
1557
- data?: unknown | null;
1558
- senderId?: string | null;
1559
- receiverId?: string | null;
1560
- createdAt?: string | null;
1561
- updatedAt?: string | null;
1562
- }
1563
- export interface AppGrantCondition {
1564
- id?: string | null;
1565
- permissions?: string | null;
1566
- isGrant?: boolean | null;
1567
- actorId?: string | null;
1568
- grantorId?: string | null;
1569
- createdAt?: string | null;
1570
- updatedAt?: string | null;
1571
- }
1572
- export interface AppMembershipDefaultCondition {
1573
- id?: string | null;
1574
- createdAt?: string | null;
1575
- updatedAt?: string | null;
1576
- createdBy?: string | null;
1577
- updatedBy?: string | null;
1578
- isApproved?: boolean | null;
1579
- isVerified?: boolean | null;
1580
- }
1581
- export interface OrgLimitCondition {
1582
- id?: string | null;
1583
- name?: string | null;
1584
- actorId?: string | null;
1585
- num?: number | null;
1586
- max?: number | null;
1587
- entityId?: string | null;
1588
- }
1589
- export interface OrgClaimedInviteCondition {
1590
- id?: string | null;
1591
- data?: unknown | null;
1592
- senderId?: string | null;
1593
- receiverId?: string | null;
1594
- createdAt?: string | null;
1595
- updatedAt?: string | null;
1596
- entityId?: string | null;
1597
- }
1598
- export interface OrgGrantCondition {
1599
- id?: string | null;
1600
- permissions?: string | null;
1601
- isGrant?: boolean | null;
1602
- actorId?: string | null;
1603
- entityId?: string | null;
1604
- grantorId?: string | null;
1605
- createdAt?: string | null;
1606
- updatedAt?: string | null;
1607
- }
1608
- export interface OrgChartEdgeCondition {
1609
- id?: string | null;
1610
- createdAt?: string | null;
1611
- updatedAt?: string | null;
1612
- entityId?: string | null;
1613
- childId?: string | null;
1614
- parentId?: string | null;
1615
- positionTitle?: string | null;
1616
- positionLevel?: number | null;
1617
- }
1618
- export interface OrgMembershipDefaultCondition {
1619
- id?: string | null;
1620
- createdAt?: string | null;
1621
- updatedAt?: string | null;
1622
- createdBy?: string | null;
1623
- updatedBy?: string | null;
1624
- isApproved?: boolean | null;
1625
- entityId?: string | null;
1626
- deleteMemberCascadeGroups?: boolean | null;
1627
- createGroupsCascadeMembers?: boolean | null;
1628
- }
1629
- export interface InviteCondition {
1630
- id?: string | null;
1631
- email?: unknown | null;
1632
- senderId?: string | null;
1633
- inviteToken?: string | null;
1634
- inviteValid?: boolean | null;
1635
- inviteLimit?: number | null;
1636
- inviteCount?: number | null;
1637
- multiple?: boolean | null;
1638
- data?: unknown | null;
1639
- expiresAt?: string | null;
1640
- createdAt?: string | null;
1641
- updatedAt?: string | null;
1642
- }
1643
- export interface AppLevelCondition {
1644
- id?: string | null;
1645
- name?: string | null;
1646
- description?: string | null;
1647
- image?: unknown | null;
1648
- ownerId?: string | null;
1649
- createdAt?: string | null;
1650
- updatedAt?: string | null;
1651
- }
1652
- export interface AppMembershipCondition {
1653
- id?: string | null;
1654
- createdAt?: string | null;
1655
- updatedAt?: string | null;
1656
- createdBy?: string | null;
1657
- updatedBy?: string | null;
1658
- isApproved?: boolean | null;
1659
- isBanned?: boolean | null;
1660
- isDisabled?: boolean | null;
1661
- isVerified?: boolean | null;
1662
- isActive?: boolean | null;
1663
- isOwner?: boolean | null;
1664
- isAdmin?: boolean | null;
1665
- permissions?: string | null;
1666
- granted?: string | null;
1667
- actorId?: string | null;
1668
- profileId?: string | null;
1669
- }
1670
- export interface OrgMembershipCondition {
1671
- id?: string | null;
1672
- createdAt?: string | null;
1673
- updatedAt?: string | null;
1674
- createdBy?: string | null;
1675
- updatedBy?: string | null;
1676
- isApproved?: boolean | null;
1677
- isBanned?: boolean | null;
1678
- isDisabled?: boolean | null;
1679
- isActive?: boolean | null;
1680
- isOwner?: boolean | null;
1681
- isAdmin?: boolean | null;
1682
- permissions?: string | null;
1683
- granted?: string | null;
1684
- actorId?: string | null;
1685
- entityId?: string | null;
1686
- profileId?: string | null;
1687
- }
1688
- export interface OrgInviteCondition {
1689
- id?: string | null;
1690
- email?: unknown | null;
1691
- senderId?: string | null;
1692
- receiverId?: string | null;
1693
- inviteToken?: string | null;
1694
- inviteValid?: boolean | null;
1695
- inviteLimit?: number | null;
1696
- inviteCount?: number | null;
1697
- multiple?: boolean | null;
1698
- data?: unknown | null;
1699
- expiresAt?: string | null;
1700
- createdAt?: string | null;
1701
- updatedAt?: string | null;
1702
- entityId?: string | null;
1703
- }
1704
1431
  export type OrgGetManagersRecordsOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'USER_ID_ASC' | 'USER_ID_DESC' | 'DEPTH_ASC' | 'DEPTH_DESC';
1705
1432
  export type OrgGetSubordinatesRecordsOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'USER_ID_ASC' | 'USER_ID_DESC' | 'DEPTH_ASC' | 'DEPTH_DESC';
1706
1433
  export type AppPermissionOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'BITNUM_ASC' | 'BITNUM_DESC' | 'BITSTR_ASC' | 'BITSTR_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC';
@@ -34,21 +34,23 @@ export declare class QueryBuilder<TResult> {
34
34
  getVariables(): Record<string, unknown> | undefined;
35
35
  }
36
36
  export declare function buildSelections(select: Record<string, unknown> | undefined, connectionFieldsMap?: Record<string, Record<string, string>>, entityType?: string): FieldNode[];
37
- export declare function buildFindManyDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
37
+ export declare function buildFindManyDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
38
38
  where?: TWhere;
39
+ condition?: TCondition;
39
40
  orderBy?: string[];
40
41
  first?: number;
41
42
  last?: number;
42
43
  after?: string;
43
44
  before?: string;
44
45
  offset?: number;
45
- }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
46
+ }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
46
47
  document: string;
47
48
  variables: Record<string, unknown>;
48
49
  };
49
- export declare function buildFindFirstDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
50
+ export declare function buildFindFirstDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
50
51
  where?: TWhere;
51
- }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
52
+ condition?: TCondition;
53
+ }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
52
54
  document: string;
53
55
  variables: Record<string, unknown>;
54
56
  };
@@ -131,13 +131,18 @@ export function buildSelections(select, connectionFieldsMap, entityType) {
131
131
  // ============================================================================
132
132
  // Document Builders
133
133
  // ============================================================================
134
- export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
134
+ export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap, conditionTypeName) {
135
135
  const selections = select
136
136
  ? buildSelections(select, connectionFieldsMap, operationName)
137
137
  : [t.field({ name: 'id' })];
138
138
  const variableDefinitions = [];
139
139
  const queryArgs = [];
140
140
  const variables = {};
141
+ addVariable({
142
+ varName: 'condition',
143
+ typeName: conditionTypeName,
144
+ value: args.condition,
145
+ }, variableDefinitions, queryArgs, variables);
141
146
  addVariable({
142
147
  varName: 'where',
143
148
  argName: 'filter',
@@ -176,7 +181,7 @@ export function buildFindManyDocument(operationName, queryField, select, args, f
176
181
  });
177
182
  return { document: print(document), variables };
178
183
  }
179
- export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap) {
184
+ export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap, conditionTypeName) {
180
185
  const selections = select
181
186
  ? buildSelections(select, connectionFieldsMap, operationName)
182
187
  : [t.field({ name: 'id' })];
@@ -185,6 +190,11 @@ export function buildFindFirstDocument(operationName, queryField, select, args,
185
190
  const variables = {};
186
191
  // Always add first: 1 for findFirst
187
192
  addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables);
193
+ addVariable({
194
+ varName: 'condition',
195
+ typeName: conditionTypeName,
196
+ value: args.condition,
197
+ }, variableDefinitions, queryArgs, variables);
188
198
  addVariable({
189
199
  varName: 'where',
190
200
  argName: 'filter',
@@ -519,7 +529,7 @@ function buildInputMutationDocument(config) {
519
529
  return print(document);
520
530
  }
521
531
  function addVariable(spec, definitions, args, variables) {
522
- if (spec.value === undefined)
532
+ if (spec.value === undefined || !spec.typeName)
523
533
  return;
524
534
  definitions.push(t.variableDefinition({
525
535
  variable: t.variable({ name: spec.varName }),
@@ -14,9 +14,10 @@ export interface PageInfo {
14
14
  startCursor?: string | null;
15
15
  endCursor?: string | null;
16
16
  }
17
- export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
17
+ export interface FindManyArgs<TSelect, TWhere, TCondition = never, TOrderBy = never> {
18
18
  select?: TSelect;
19
19
  where?: TWhere;
20
+ condition?: TCondition;
20
21
  orderBy?: TOrderBy[];
21
22
  first?: number;
22
23
  last?: number;
@@ -24,9 +25,10 @@ export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
24
25
  before?: string;
25
26
  offset?: number;
26
27
  }
27
- export interface FindFirstArgs<TSelect, TWhere> {
28
+ export interface FindFirstArgs<TSelect, TWhere, TCondition = never> {
28
29
  select?: TSelect;
29
30
  where?: TWhere;
31
+ condition?: TCondition;
30
32
  }
31
33
  export interface CreateArgs<TSelect, TData> {
32
34
  data: TData;
@@ -162,6 +162,13 @@ export interface InternetAddressFilter {
162
162
  export interface FullTextFilter {
163
163
  matches?: string;
164
164
  }
165
+ export interface VectorFilter {
166
+ isNull?: boolean;
167
+ equalTo?: number[];
168
+ notEqualTo?: number[];
169
+ distinctFrom?: number[];
170
+ notDistinctFrom?: number[];
171
+ }
165
172
  export interface StringListFilter {
166
173
  isNull?: boolean;
167
174
  equalTo?: string[];
@@ -518,69 +525,6 @@ export interface UserFilter {
518
525
  or?: UserFilter[];
519
526
  not?: UserFilter;
520
527
  }
521
- export interface RoleTypeCondition {
522
- id?: number | null;
523
- name?: string | null;
524
- }
525
- export interface CryptoAddressCondition {
526
- id?: string | null;
527
- ownerId?: string | null;
528
- address?: string | null;
529
- isVerified?: boolean | null;
530
- isPrimary?: boolean | null;
531
- createdAt?: string | null;
532
- updatedAt?: string | null;
533
- }
534
- export interface PhoneNumberCondition {
535
- id?: string | null;
536
- ownerId?: string | null;
537
- cc?: string | null;
538
- number?: string | null;
539
- isVerified?: boolean | null;
540
- isPrimary?: boolean | null;
541
- createdAt?: string | null;
542
- updatedAt?: string | null;
543
- }
544
- export interface ConnectedAccountCondition {
545
- id?: string | null;
546
- ownerId?: string | null;
547
- service?: string | null;
548
- identifier?: string | null;
549
- details?: unknown | null;
550
- isVerified?: boolean | null;
551
- createdAt?: string | null;
552
- updatedAt?: string | null;
553
- }
554
- export interface AuditLogCondition {
555
- id?: string | null;
556
- event?: string | null;
557
- actorId?: string | null;
558
- origin?: unknown | null;
559
- userAgent?: string | null;
560
- ipAddress?: string | null;
561
- success?: boolean | null;
562
- createdAt?: string | null;
563
- }
564
- export interface EmailCondition {
565
- id?: string | null;
566
- ownerId?: string | null;
567
- email?: unknown | null;
568
- isVerified?: boolean | null;
569
- isPrimary?: boolean | null;
570
- createdAt?: string | null;
571
- updatedAt?: string | null;
572
- }
573
- export interface UserCondition {
574
- id?: string | null;
575
- username?: string | null;
576
- displayName?: string | null;
577
- profilePicture?: unknown | null;
578
- searchTsv?: string | null;
579
- type?: number | null;
580
- createdAt?: string | null;
581
- updatedAt?: string | null;
582
- searchTsvRank?: number | null;
583
- }
584
528
  export type RoleTypeOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC';
585
529
  export type CryptoAddressOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'OWNER_ID_ASC' | 'OWNER_ID_DESC' | 'ADDRESS_ASC' | 'ADDRESS_DESC' | 'IS_VERIFIED_ASC' | 'IS_VERIFIED_DESC' | 'IS_PRIMARY_ASC' | 'IS_PRIMARY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
586
530
  export type PhoneNumberOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'OWNER_ID_ASC' | 'OWNER_ID_DESC' | 'CC_ASC' | 'CC_DESC' | 'NUMBER_ASC' | 'NUMBER_DESC' | 'IS_VERIFIED_ASC' | 'IS_VERIFIED_DESC' | 'IS_PRIMARY_ASC' | 'IS_PRIMARY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
@@ -34,21 +34,23 @@ export declare class QueryBuilder<TResult> {
34
34
  getVariables(): Record<string, unknown> | undefined;
35
35
  }
36
36
  export declare function buildSelections(select: Record<string, unknown> | undefined, connectionFieldsMap?: Record<string, Record<string, string>>, entityType?: string): FieldNode[];
37
- export declare function buildFindManyDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
37
+ export declare function buildFindManyDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
38
38
  where?: TWhere;
39
+ condition?: TCondition;
39
40
  orderBy?: string[];
40
41
  first?: number;
41
42
  last?: number;
42
43
  after?: string;
43
44
  before?: string;
44
45
  offset?: number;
45
- }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
46
+ }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
46
47
  document: string;
47
48
  variables: Record<string, unknown>;
48
49
  };
49
- export declare function buildFindFirstDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
50
+ export declare function buildFindFirstDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
50
51
  where?: TWhere;
51
- }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
52
+ condition?: TCondition;
53
+ }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
52
54
  document: string;
53
55
  variables: Record<string, unknown>;
54
56
  };
@@ -131,13 +131,18 @@ export function buildSelections(select, connectionFieldsMap, entityType) {
131
131
  // ============================================================================
132
132
  // Document Builders
133
133
  // ============================================================================
134
- export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
134
+ export function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap, conditionTypeName) {
135
135
  const selections = select
136
136
  ? buildSelections(select, connectionFieldsMap, operationName)
137
137
  : [t.field({ name: 'id' })];
138
138
  const variableDefinitions = [];
139
139
  const queryArgs = [];
140
140
  const variables = {};
141
+ addVariable({
142
+ varName: 'condition',
143
+ typeName: conditionTypeName,
144
+ value: args.condition,
145
+ }, variableDefinitions, queryArgs, variables);
141
146
  addVariable({
142
147
  varName: 'where',
143
148
  argName: 'filter',
@@ -176,7 +181,7 @@ export function buildFindManyDocument(operationName, queryField, select, args, f
176
181
  });
177
182
  return { document: print(document), variables };
178
183
  }
179
- export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap) {
184
+ export function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, connectionFieldsMap, conditionTypeName) {
180
185
  const selections = select
181
186
  ? buildSelections(select, connectionFieldsMap, operationName)
182
187
  : [t.field({ name: 'id' })];
@@ -185,6 +190,11 @@ export function buildFindFirstDocument(operationName, queryField, select, args,
185
190
  const variables = {};
186
191
  // Always add first: 1 for findFirst
187
192
  addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables);
193
+ addVariable({
194
+ varName: 'condition',
195
+ typeName: conditionTypeName,
196
+ value: args.condition,
197
+ }, variableDefinitions, queryArgs, variables);
188
198
  addVariable({
189
199
  varName: 'where',
190
200
  argName: 'filter',
@@ -519,7 +529,7 @@ function buildInputMutationDocument(config) {
519
529
  return print(document);
520
530
  }
521
531
  function addVariable(spec, definitions, args, variables) {
522
- if (spec.value === undefined)
532
+ if (spec.value === undefined || !spec.typeName)
523
533
  return;
524
534
  definitions.push(t.variableDefinition({
525
535
  variable: t.variable({ name: spec.varName }),
@@ -14,9 +14,10 @@ export interface PageInfo {
14
14
  startCursor?: string | null;
15
15
  endCursor?: string | null;
16
16
  }
17
- export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
17
+ export interface FindManyArgs<TSelect, TWhere, TCondition = never, TOrderBy = never> {
18
18
  select?: TSelect;
19
19
  where?: TWhere;
20
+ condition?: TCondition;
20
21
  orderBy?: TOrderBy[];
21
22
  first?: number;
22
23
  last?: number;
@@ -24,9 +25,10 @@ export interface FindManyArgs<TSelect, TWhere, TOrderBy> {
24
25
  before?: string;
25
26
  offset?: number;
26
27
  }
27
- export interface FindFirstArgs<TSelect, TWhere> {
28
+ export interface FindFirstArgs<TSelect, TWhere, TCondition = never> {
28
29
  select?: TSelect;
29
30
  where?: TWhere;
31
+ condition?: TCondition;
30
32
  }
31
33
  export interface CreateArgs<TSelect, TData> {
32
34
  data: TData;
@@ -162,6 +162,13 @@ export interface InternetAddressFilter {
162
162
  export interface FullTextFilter {
163
163
  matches?: string;
164
164
  }
165
+ export interface VectorFilter {
166
+ isNull?: boolean;
167
+ equalTo?: number[];
168
+ notEqualTo?: number[];
169
+ distinctFrom?: number[];
170
+ notDistinctFrom?: number[];
171
+ }
165
172
  export interface StringListFilter {
166
173
  isNull?: boolean;
167
174
  equalTo?: string[];
@@ -396,45 +403,6 @@ export interface CommitFilter {
396
403
  or?: CommitFilter[];
397
404
  not?: CommitFilter;
398
405
  }
399
- export interface GetAllRecordCondition {
400
- path?: string | null;
401
- data?: unknown | null;
402
- }
403
- export interface ObjectCondition {
404
- hashUuid?: string | null;
405
- id?: string | null;
406
- databaseId?: string | null;
407
- kids?: string | null;
408
- ktree?: string | null;
409
- data?: unknown | null;
410
- frzn?: boolean | null;
411
- createdAt?: string | null;
412
- }
413
- export interface RefCondition {
414
- id?: string | null;
415
- name?: string | null;
416
- databaseId?: string | null;
417
- storeId?: string | null;
418
- commitId?: string | null;
419
- }
420
- export interface StoreCondition {
421
- id?: string | null;
422
- name?: string | null;
423
- databaseId?: string | null;
424
- hash?: string | null;
425
- createdAt?: string | null;
426
- }
427
- export interface CommitCondition {
428
- id?: string | null;
429
- message?: string | null;
430
- databaseId?: string | null;
431
- storeId?: string | null;
432
- parentIds?: string | null;
433
- authorId?: string | null;
434
- committerId?: string | null;
435
- treeId?: string | null;
436
- date?: string | null;
437
- }
438
406
  export type GetAllRecordsOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'PATH_ASC' | 'PATH_DESC' | 'DATA_ASC' | 'DATA_DESC';
439
407
  export type ObjectOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'HASH_UUID_ASC' | 'HASH_UUID_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'KIDS_ASC' | 'KIDS_DESC' | 'KTREE_ASC' | 'KTREE_DESC' | 'DATA_ASC' | 'DATA_DESC' | 'FRZN_ASC' | 'FRZN_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC';
440
408
  export type RefOrderBy = 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' | 'COMMIT_ID_ASC' | 'COMMIT_ID_DESC';
@@ -34,21 +34,23 @@ export declare class QueryBuilder<TResult> {
34
34
  getVariables(): Record<string, unknown> | undefined;
35
35
  }
36
36
  export declare function buildSelections(select: Record<string, unknown> | undefined, connectionFieldsMap?: Record<string, Record<string, string>>, entityType?: string): FieldNode[];
37
- export declare function buildFindManyDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
37
+ export declare function buildFindManyDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
38
38
  where?: TWhere;
39
+ condition?: TCondition;
39
40
  orderBy?: string[];
40
41
  first?: number;
41
42
  last?: number;
42
43
  after?: string;
43
44
  before?: string;
44
45
  offset?: number;
45
- }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
46
+ }, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
46
47
  document: string;
47
48
  variables: Record<string, unknown>;
48
49
  };
49
- export declare function buildFindFirstDocument<TSelect, TWhere>(operationName: string, queryField: string, select: TSelect, args: {
50
+ export declare function buildFindFirstDocument<TSelect, TWhere, TCondition = never>(operationName: string, queryField: string, select: TSelect, args: {
50
51
  where?: TWhere;
51
- }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>): {
52
+ condition?: TCondition;
53
+ }, filterTypeName: string, connectionFieldsMap?: Record<string, Record<string, string>>, conditionTypeName?: string): {
52
54
  document: string;
53
55
  variables: Record<string, unknown>;
54
56
  };