@juit/pgproxy-model 0.0.0 → 1.4.3

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/search.d.ts CHANGED
@@ -98,7 +98,7 @@ export type SearchFilter<Schema, Table extends string & keyof Schema> = Prettify
98
98
  /**
99
99
  * Base interface for querying results via our {@link Search}.
100
100
  */
101
- export type SearchQuery<Schema, Table extends string & keyof Schema, Joins extends SearchJoins<Schema>> = Prettify<{
101
+ export type SearchQuery<Schema, Table extends string & keyof Schema, Joins extends SearchJoins<Schema>, TextSearch extends boolean> = Prettify<{
102
102
  /** An optional set of filters to apply */
103
103
  filters?: Prettify<SearchFilter<Schema, Table>[]>;
104
104
  /** An optional column to sort by */
@@ -106,12 +106,12 @@ export type SearchQuery<Schema, Table extends string & keyof Schema, Joins exten
106
106
  /** The order to sort by (if `sort` is specified, default: 'asc') */
107
107
  order?: 'asc' | 'desc';
108
108
  /** An optional full-text search query, available for full-text search */
109
- q?: string;
109
+ q?: TextSearch extends true ? string : never;
110
110
  }>;
111
111
  /**
112
112
  * Full options for querying a limited set of results via our {@link Search}.
113
113
  */
114
- export type SearchOptions<Schema, Table extends string & keyof Schema, Joins extends SearchJoins<Schema>> = Prettify<SearchQuery<Schema, Table, Joins> & {
114
+ export type SearchOptions<Schema, Table extends string & keyof Schema, Joins extends SearchJoins<Schema>, TextSearch extends boolean> = Prettify<SearchQuery<Schema, Table, Joins, TextSearch> & {
115
115
  /** Offset to start returning rows from (default: 0) */
116
116
  offset?: number;
117
117
  /** Maximum number of rows to return (default: 20, unlimited if 0) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juit/pgproxy-model",
3
- "version": "0.0.0",
3
+ "version": "1.4.3",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
package/src/search.ts CHANGED
@@ -130,6 +130,7 @@ export type SearchQuery<
130
130
  Schema,
131
131
  Table extends string & keyof Schema,
132
132
  Joins extends SearchJoins<Schema>,
133
+ TextSearch extends boolean,
133
134
  > = Prettify<{
134
135
  /** An optional set of filters to apply */
135
136
  filters?: Prettify<SearchFilter<Schema, Table>[]>
@@ -138,7 +139,7 @@ export type SearchQuery<
138
139
  /** The order to sort by (if `sort` is specified, default: 'asc') */
139
140
  order?: 'asc' | 'desc'
140
141
  /** An optional full-text search query, available for full-text search */
141
- q?: string
142
+ q?: TextSearch extends true ? string : never
142
143
  }>
143
144
 
144
145
  /**
@@ -148,7 +149,8 @@ export type SearchOptions<
148
149
  Schema,
149
150
  Table extends string & keyof Schema,
150
151
  Joins extends SearchJoins<Schema>,
151
- > = Prettify<SearchQuery<Schema, Table, Joins> & {
152
+ TextSearch extends boolean,
153
+ > = Prettify<SearchQuery<Schema, Table, Joins, TextSearch> & {
152
154
  /** Offset to start returning rows from (default: 0) */
153
155
  offset?: number
154
156
  /** Maximum number of rows to return (default: 20, unlimited if 0) */