@d-mok/quasar-app-extension-quasar-axe 3.1.71 → 4.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-mok/quasar-app-extension-quasar-axe",
3
- "version": "3.1.71",
3
+ "version": "4.0.2",
4
4
  "description": "A Quasar App Extension",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -132,13 +132,19 @@ export function ORM<
132
132
  return entities
133
133
  }
134
134
 
135
- async read(query: (q: Filter) => Filter = q => q): Promise<R[]> {
135
+ async read(
136
+ query: ((q: Filter) => Filter) | Partial<R> = q => q
137
+ ): Promise<R[]> {
136
138
  const q = supabase.from(tableName).select(fields)
137
- return await query(q).then(handleError)
139
+ if (typeof query === 'function') {
140
+ return await query(q).then(handleError)
141
+ } else {
142
+ return await q.match(query).then(handleError)
143
+ }
138
144
  }
139
145
 
140
146
  async select(
141
- query: (q: Filter) => Filter = q => q,
147
+ query: ((q: Filter) => Filter) | Partial<R> = q => q,
142
148
  options?: selectOptions
143
149
  ): Promise<void> {
144
150
  await this.wrapper('select', options, async () => {
@@ -298,10 +304,10 @@ if (process.env.DEBUGGING) {
298
304
  type uiOptions = {
299
305
  confirm?: [string, string]
300
306
  notify?: string | false
301
- loading?: boolean
307
+ loading?: false
302
308
  }
303
309
 
304
310
  type selectOptions = {
305
- loading?: boolean
311
+ loading?: false
306
312
  patch?: true
307
313
  }
@@ -58,6 +58,7 @@ let ss = new StudentTable()
58
58
  let x1 = await ss.read()
59
59
 
60
60
  ss.select(q => q.eq('name', 'a').eq('num', 3).limit(100).order('class'))
61
+ ss.select({ name: 'a', num: 3 })
61
62
  // @ts-expect-error
62
63
  ss.select(q => q.eq('isPrefect', 'a'))
63
64
  ss.selectIn('num', [1, 2, 3])