@codeforamerica/safety-net-openapi-california 1.0.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.
- package/dist/applications/client/client.gen.d.ts +2 -0
- package/dist/applications/client/client.gen.js +128 -0
- package/dist/applications/client/index.d.ts +8 -0
- package/dist/applications/client/index.js +6 -0
- package/dist/applications/client/types.gen.d.ts +88 -0
- package/dist/applications/client/types.gen.js +2 -0
- package/dist/applications/client/utils.gen.d.ts +14 -0
- package/dist/applications/client/utils.gen.js +171 -0
- package/dist/applications/client.gen.d.ts +12 -0
- package/dist/applications/client.gen.js +3 -0
- package/dist/applications/core/auth.gen.d.ts +18 -0
- package/dist/applications/core/auth.gen.js +14 -0
- package/dist/applications/core/bodySerializer.gen.d.ts +25 -0
- package/dist/applications/core/bodySerializer.gen.js +57 -0
- package/dist/applications/core/params.gen.d.ts +43 -0
- package/dist/applications/core/params.gen.js +100 -0
- package/dist/applications/core/pathSerializer.gen.d.ts +33 -0
- package/dist/applications/core/pathSerializer.gen.js +114 -0
- package/dist/applications/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/applications/core/queryKeySerializer.gen.js +99 -0
- package/dist/applications/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/applications/core/serverSentEvents.gen.js +137 -0
- package/dist/applications/core/types.gen.d.ts +78 -0
- package/dist/applications/core/types.gen.js +2 -0
- package/dist/applications/core/utils.gen.d.ts +19 -0
- package/dist/applications/core/utils.gen.js +87 -0
- package/dist/applications/index.d.ts +2 -0
- package/dist/applications/index.js +2 -0
- package/dist/applications/sdk.gen.d.ts +45 -0
- package/dist/applications/sdk.gen.js +70 -0
- package/dist/applications/types.gen.d.ts +34007 -0
- package/dist/applications/types.gen.js +2 -0
- package/dist/applications/zod.gen.d.ts +17374 -0
- package/dist/applications/zod.gen.js +16857 -0
- package/dist/households/client/client.gen.d.ts +2 -0
- package/dist/households/client/client.gen.js +128 -0
- package/dist/households/client/index.d.ts +8 -0
- package/dist/households/client/index.js +6 -0
- package/dist/households/client/types.gen.d.ts +88 -0
- package/dist/households/client/types.gen.js +2 -0
- package/dist/households/client/utils.gen.d.ts +14 -0
- package/dist/households/client/utils.gen.js +171 -0
- package/dist/households/client.gen.d.ts +12 -0
- package/dist/households/client.gen.js +3 -0
- package/dist/households/core/auth.gen.d.ts +18 -0
- package/dist/households/core/auth.gen.js +14 -0
- package/dist/households/core/bodySerializer.gen.d.ts +25 -0
- package/dist/households/core/bodySerializer.gen.js +57 -0
- package/dist/households/core/params.gen.d.ts +43 -0
- package/dist/households/core/params.gen.js +100 -0
- package/dist/households/core/pathSerializer.gen.d.ts +33 -0
- package/dist/households/core/pathSerializer.gen.js +114 -0
- package/dist/households/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/households/core/queryKeySerializer.gen.js +99 -0
- package/dist/households/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/households/core/serverSentEvents.gen.js +137 -0
- package/dist/households/core/types.gen.d.ts +78 -0
- package/dist/households/core/types.gen.js +2 -0
- package/dist/households/core/utils.gen.d.ts +19 -0
- package/dist/households/core/utils.gen.js +87 -0
- package/dist/households/index.d.ts +2 -0
- package/dist/households/index.js +2 -0
- package/dist/households/sdk.gen.d.ts +45 -0
- package/dist/households/sdk.gen.js +70 -0
- package/dist/households/types.gen.d.ts +1693 -0
- package/dist/households/types.gen.js +2 -0
- package/dist/households/zod.gen.d.ts +624 -0
- package/dist/households/zod.gen.js +625 -0
- package/dist/incomes/client/client.gen.d.ts +2 -0
- package/dist/incomes/client/client.gen.js +128 -0
- package/dist/incomes/client/index.d.ts +8 -0
- package/dist/incomes/client/index.js +6 -0
- package/dist/incomes/client/types.gen.d.ts +88 -0
- package/dist/incomes/client/types.gen.js +2 -0
- package/dist/incomes/client/utils.gen.d.ts +14 -0
- package/dist/incomes/client/utils.gen.js +171 -0
- package/dist/incomes/client.gen.d.ts +12 -0
- package/dist/incomes/client.gen.js +3 -0
- package/dist/incomes/core/auth.gen.d.ts +18 -0
- package/dist/incomes/core/auth.gen.js +14 -0
- package/dist/incomes/core/bodySerializer.gen.d.ts +25 -0
- package/dist/incomes/core/bodySerializer.gen.js +57 -0
- package/dist/incomes/core/params.gen.d.ts +43 -0
- package/dist/incomes/core/params.gen.js +100 -0
- package/dist/incomes/core/pathSerializer.gen.d.ts +33 -0
- package/dist/incomes/core/pathSerializer.gen.js +114 -0
- package/dist/incomes/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/incomes/core/queryKeySerializer.gen.js +99 -0
- package/dist/incomes/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/incomes/core/serverSentEvents.gen.js +137 -0
- package/dist/incomes/core/types.gen.d.ts +78 -0
- package/dist/incomes/core/types.gen.js +2 -0
- package/dist/incomes/core/utils.gen.d.ts +19 -0
- package/dist/incomes/core/utils.gen.js +87 -0
- package/dist/incomes/index.d.ts +2 -0
- package/dist/incomes/index.js +2 -0
- package/dist/incomes/sdk.gen.d.ts +47 -0
- package/dist/incomes/sdk.gen.js +72 -0
- package/dist/incomes/types.gen.d.ts +1425 -0
- package/dist/incomes/types.gen.js +2 -0
- package/dist/incomes/zod.gen.d.ts +961 -0
- package/dist/incomes/zod.gen.js +920 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/persons/client/client.gen.d.ts +2 -0
- package/dist/persons/client/client.gen.js +128 -0
- package/dist/persons/client/index.d.ts +8 -0
- package/dist/persons/client/index.js +6 -0
- package/dist/persons/client/types.gen.d.ts +88 -0
- package/dist/persons/client/types.gen.js +2 -0
- package/dist/persons/client/utils.gen.d.ts +14 -0
- package/dist/persons/client/utils.gen.js +171 -0
- package/dist/persons/client.gen.d.ts +12 -0
- package/dist/persons/client.gen.js +3 -0
- package/dist/persons/core/auth.gen.d.ts +18 -0
- package/dist/persons/core/auth.gen.js +14 -0
- package/dist/persons/core/bodySerializer.gen.d.ts +25 -0
- package/dist/persons/core/bodySerializer.gen.js +57 -0
- package/dist/persons/core/params.gen.d.ts +43 -0
- package/dist/persons/core/params.gen.js +100 -0
- package/dist/persons/core/pathSerializer.gen.d.ts +33 -0
- package/dist/persons/core/pathSerializer.gen.js +114 -0
- package/dist/persons/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/persons/core/queryKeySerializer.gen.js +99 -0
- package/dist/persons/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/persons/core/serverSentEvents.gen.js +137 -0
- package/dist/persons/core/types.gen.d.ts +78 -0
- package/dist/persons/core/types.gen.js +2 -0
- package/dist/persons/core/utils.gen.d.ts +19 -0
- package/dist/persons/core/utils.gen.js +87 -0
- package/dist/persons/index.d.ts +2 -0
- package/dist/persons/index.js +2 -0
- package/dist/persons/sdk.gen.d.ts +45 -0
- package/dist/persons/sdk.gen.js +70 -0
- package/dist/persons/types.gen.d.ts +7595 -0
- package/dist/persons/types.gen.js +2 -0
- package/dist/persons/zod.gen.d.ts +3578 -0
- package/dist/persons/zod.gen.js +3579 -0
- package/dist/search-helpers.d.ts +242 -0
- package/dist/search-helpers.js +244 -0
- package/package.json +95 -0
- package/src/applications/client/client.gen.ts +166 -0
- package/src/applications/client/index.ts +23 -0
- package/src/applications/client/types.gen.ts +197 -0
- package/src/applications/client/utils.gen.ts +213 -0
- package/src/applications/client.gen.ts +16 -0
- package/src/applications/core/auth.gen.ts +42 -0
- package/src/applications/core/bodySerializer.gen.ts +100 -0
- package/src/applications/core/params.gen.ts +176 -0
- package/src/applications/core/pathSerializer.gen.ts +181 -0
- package/src/applications/core/queryKeySerializer.gen.ts +136 -0
- package/src/applications/core/serverSentEvents.gen.ts +266 -0
- package/src/applications/core/types.gen.ts +118 -0
- package/src/applications/core/utils.gen.ts +143 -0
- package/src/applications/index.ts +4 -0
- package/src/applications/sdk.gen.ts +92 -0
- package/src/applications/types.gen.ts +34043 -0
- package/src/applications/zod.gen.ts +16877 -0
- package/src/households/client/client.gen.ts +166 -0
- package/src/households/client/index.ts +23 -0
- package/src/households/client/types.gen.ts +197 -0
- package/src/households/client/utils.gen.ts +213 -0
- package/src/households/client.gen.ts +16 -0
- package/src/households/core/auth.gen.ts +42 -0
- package/src/households/core/bodySerializer.gen.ts +100 -0
- package/src/households/core/params.gen.ts +176 -0
- package/src/households/core/pathSerializer.gen.ts +181 -0
- package/src/households/core/queryKeySerializer.gen.ts +136 -0
- package/src/households/core/serverSentEvents.gen.ts +266 -0
- package/src/households/core/types.gen.ts +118 -0
- package/src/households/core/utils.gen.ts +143 -0
- package/src/households/index.ts +4 -0
- package/src/households/sdk.gen.ts +92 -0
- package/src/households/types.gen.ts +1729 -0
- package/src/households/zod.gen.ts +645 -0
- package/src/incomes/client/client.gen.ts +166 -0
- package/src/incomes/client/index.ts +23 -0
- package/src/incomes/client/types.gen.ts +197 -0
- package/src/incomes/client/utils.gen.ts +213 -0
- package/src/incomes/client.gen.ts +16 -0
- package/src/incomes/core/auth.gen.ts +42 -0
- package/src/incomes/core/bodySerializer.gen.ts +100 -0
- package/src/incomes/core/params.gen.ts +176 -0
- package/src/incomes/core/pathSerializer.gen.ts +181 -0
- package/src/incomes/core/queryKeySerializer.gen.ts +136 -0
- package/src/incomes/core/serverSentEvents.gen.ts +266 -0
- package/src/incomes/core/types.gen.ts +118 -0
- package/src/incomes/core/utils.gen.ts +143 -0
- package/src/incomes/index.ts +4 -0
- package/src/incomes/sdk.gen.ts +94 -0
- package/src/incomes/types.gen.ts +1460 -0
- package/src/incomes/zod.gen.ts +939 -0
- package/src/index.ts +5 -0
- package/src/persons/client/client.gen.ts +166 -0
- package/src/persons/client/index.ts +23 -0
- package/src/persons/client/types.gen.ts +197 -0
- package/src/persons/client/utils.gen.ts +213 -0
- package/src/persons/client.gen.ts +16 -0
- package/src/persons/core/auth.gen.ts +42 -0
- package/src/persons/core/bodySerializer.gen.ts +100 -0
- package/src/persons/core/params.gen.ts +176 -0
- package/src/persons/core/pathSerializer.gen.ts +181 -0
- package/src/persons/core/queryKeySerializer.gen.ts +136 -0
- package/src/persons/core/serverSentEvents.gen.ts +266 -0
- package/src/persons/core/types.gen.ts +118 -0
- package/src/persons/core/utils.gen.ts +143 -0
- package/src/persons/index.ts +4 -0
- package/src/persons/sdk.gen.ts +92 -0
- package/src/persons/types.gen.ts +7631 -0
- package/src/persons/zod.gen.ts +3599 -0
- package/src/search-helpers.ts +264 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search Query Helpers for Safety Net API Clients
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for building search queries using the
|
|
5
|
+
* field:value syntax supported by all list endpoints.
|
|
6
|
+
*
|
|
7
|
+
* @module search-helpers
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* import { q, search } from '@codeforamerica/safety-net-colorado';
|
|
11
|
+
*
|
|
12
|
+
* const query = q(
|
|
13
|
+
* search.eq("status", "approved"),
|
|
14
|
+
* search.gte("income", 1000),
|
|
15
|
+
* search.in("programs", ["snap", "cash_programs"])
|
|
16
|
+
* );
|
|
17
|
+
* // => "status:approved income:>=1000 programs:snap,cash_programs"
|
|
18
|
+
*
|
|
19
|
+
* const results = await personsClient.listPersons({
|
|
20
|
+
* queries: { q: query, limit: 25 }
|
|
21
|
+
* });
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Combines multiple search conditions into a single query string.
|
|
26
|
+
*
|
|
27
|
+
* Multiple conditions are ANDed together (all must match).
|
|
28
|
+
* Use comma-separated values within a single condition for OR logic.
|
|
29
|
+
*
|
|
30
|
+
* ## Syntax Reference
|
|
31
|
+
*
|
|
32
|
+
* | Pattern | Description | Example |
|
|
33
|
+
* |---------|-------------|---------|
|
|
34
|
+
* | `term` | Full-text exact match | `john` |
|
|
35
|
+
* | `*term*` | Full-text contains | `*john*` |
|
|
36
|
+
* | `term*` | Full-text starts with | `john*` |
|
|
37
|
+
* | `*term` | Full-text ends with | `*smith` |
|
|
38
|
+
* | `field:value` | Exact match | `status:approved` |
|
|
39
|
+
* | `field:*value*` | Contains (case-insensitive) | `name:*john*` |
|
|
40
|
+
* | `field:value*` | Starts with | `name:john*` |
|
|
41
|
+
* | `field:*value` | Ends with | `email:*@example.com` |
|
|
42
|
+
* | `field:"value"` | Quoted value (for spaces) | `name:"john doe"` |
|
|
43
|
+
* | `field.nested:value` | Nested field (dot notation) | `address.state:CA` |
|
|
44
|
+
* | `field:>value` | Greater than | `income:>1000` |
|
|
45
|
+
* | `field:>=value` | Greater than or equal | `income:>=1000` |
|
|
46
|
+
* | `field:<value` | Less than | `income:<5000` |
|
|
47
|
+
* | `field:<=value` | Less than or equal | `income:<=5000` |
|
|
48
|
+
* | `field:val1,val2` | Match any value (OR) | `status:approved,pending` |
|
|
49
|
+
* | `-field:value` | Exclude / negate | `-status:denied` |
|
|
50
|
+
* | `field:*` | Field exists (not null) | `email:*` |
|
|
51
|
+
* | `-field:*` | Field does not exist | `-deletedAt:*` |
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Full-text search
|
|
55
|
+
* q("john")
|
|
56
|
+
* // => "john"
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Exact match on a field
|
|
60
|
+
* q("status:approved")
|
|
61
|
+
* // => "status:approved"
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Multiple conditions (AND)
|
|
65
|
+
* q("status:approved", "income:>=1000")
|
|
66
|
+
* // => "status:approved income:>=1000"
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Using the search builder
|
|
70
|
+
* q(search.eq("status", "approved"), search.gte("income", 1000))
|
|
71
|
+
* // => "status:approved income:>=1000"
|
|
72
|
+
*
|
|
73
|
+
* @param conditions - One or more search conditions to combine
|
|
74
|
+
* @returns A search query string to pass to the `q` parameter
|
|
75
|
+
*/
|
|
76
|
+
export function q(...conditions: string[]): string {
|
|
77
|
+
return conditions.filter(Boolean).join(" ");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Search query builder with type-safe methods for each operator.
|
|
82
|
+
*
|
|
83
|
+
* Use these methods to construct search conditions without memorizing
|
|
84
|
+
* the query syntax. All methods return strings that can be passed to `q()`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* import { q, search } from '@codeforamerica/safety-net-colorado';
|
|
88
|
+
*
|
|
89
|
+
* // Build a complex query
|
|
90
|
+
* const query = q(
|
|
91
|
+
* search.eq("status", "approved"),
|
|
92
|
+
* search.gte("income", 1000),
|
|
93
|
+
* search.in("programs", ["snap", "medical_assistance"]),
|
|
94
|
+
* search.not("state", "TX")
|
|
95
|
+
* );
|
|
96
|
+
*
|
|
97
|
+
* // Use with Zodios client
|
|
98
|
+
* const results = await personsClient.listPersons({
|
|
99
|
+
* queries: { q: query, limit: 25 }
|
|
100
|
+
* });
|
|
101
|
+
*/
|
|
102
|
+
export const search = {
|
|
103
|
+
/**
|
|
104
|
+
* Exact match: `field:value`
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* search.eq("status", "approved")
|
|
108
|
+
* // => "status:approved"
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* // Nested field
|
|
112
|
+
* search.eq("address.state", "CA")
|
|
113
|
+
* // => "address.state:CA"
|
|
114
|
+
*/
|
|
115
|
+
eq: (field: string, value: string | number | boolean): string =>
|
|
116
|
+
`${field}:${value}`,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Greater than: `field:>value`
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* search.gt("income", 1000)
|
|
123
|
+
* // => "income:>1000"
|
|
124
|
+
*/
|
|
125
|
+
gt: (field: string, value: string | number): string => `${field}:>${value}`,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Greater than or equal: `field:>=value`
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* search.gte("income", 1000)
|
|
132
|
+
* // => "income:>=1000"
|
|
133
|
+
*/
|
|
134
|
+
gte: (field: string, value: string | number): string => `${field}:>=${value}`,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Less than: `field:<value`
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* search.lt("age", 65)
|
|
141
|
+
* // => "age:<65"
|
|
142
|
+
*/
|
|
143
|
+
lt: (field: string, value: string | number): string => `${field}:<${value}`,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Less than or equal: `field:<=value`
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* search.lte("income", 5000)
|
|
150
|
+
* // => "income:<=5000"
|
|
151
|
+
*/
|
|
152
|
+
lte: (field: string, value: string | number): string => `${field}:<=${value}`,
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Match any of the values (OR): `field:val1,val2,val3`
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* search.in("status", ["approved", "pending", "under_review"])
|
|
159
|
+
* // => "status:approved,pending,under_review"
|
|
160
|
+
*/
|
|
161
|
+
in: (field: string, values: (string | number)[]): string =>
|
|
162
|
+
`${field}:${values.join(",")}`,
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Exclude / negate: `-field:value`
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* search.not("status", "denied")
|
|
169
|
+
* // => "-status:denied"
|
|
170
|
+
*/
|
|
171
|
+
not: (field: string, value: string | number): string => `-${field}:${value}`,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Field exists (is not null): `field:*`
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* search.exists("email")
|
|
178
|
+
* // => "email:*"
|
|
179
|
+
*/
|
|
180
|
+
exists: (field: string): string => `${field}:*`,
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Field does not exist (is null): `-field:*`
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* search.notExists("deletedAt")
|
|
187
|
+
* // => "-deletedAt:*"
|
|
188
|
+
*/
|
|
189
|
+
notExists: (field: string): string => `-${field}:*`,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Contains (case-insensitive): `field:*value*`
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* search.contains("name", "john")
|
|
196
|
+
* // => "name:*john*"
|
|
197
|
+
*/
|
|
198
|
+
contains: (field: string, value: string): string => `${field}:*${value}*`,
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Starts with (case-insensitive): `field:value*`
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* search.startsWith("name", "john")
|
|
205
|
+
* // => "name:john*"
|
|
206
|
+
*/
|
|
207
|
+
startsWith: (field: string, value: string): string => `${field}:${value}*`,
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Ends with (case-insensitive): `field:*value`
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* search.endsWith("email", "@example.com")
|
|
214
|
+
* // => "email:*@example.com"
|
|
215
|
+
*/
|
|
216
|
+
endsWith: (field: string, value: string): string => `${field}:*${value}`,
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Quoted value (for values containing spaces): `field:"value with spaces"`
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* search.quoted("name", "john doe")
|
|
223
|
+
* // => 'name:"john doe"'
|
|
224
|
+
*/
|
|
225
|
+
quoted: (field: string, value: string): string => `${field}:"${value}"`,
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Full-text exact match (no field specified)
|
|
229
|
+
*
|
|
230
|
+
* Searches across all searchable fields for an exact match of the term.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* search.text("john")
|
|
234
|
+
* // => "john"
|
|
235
|
+
*/
|
|
236
|
+
text: (term: string): string => term,
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Full-text contains search (no field specified)
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* search.textContains("john")
|
|
243
|
+
* // => "*john*"
|
|
244
|
+
*/
|
|
245
|
+
textContains: (term: string): string => `*${term}*`,
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Full-text starts with search (no field specified)
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* search.textStartsWith("john")
|
|
252
|
+
* // => "john*"
|
|
253
|
+
*/
|
|
254
|
+
textStartsWith: (term: string): string => `${term}*`,
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Full-text ends with search (no field specified)
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* search.textEndsWith("smith")
|
|
261
|
+
* // => "*smith"
|
|
262
|
+
*/
|
|
263
|
+
textEndsWith: (term: string): string => `*${term}`,
|
|
264
|
+
};
|