quickbase-js 1.0.1-beta.0 → 1.1.0-beta.1

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/{quickbaseClient.d.ts → quickbase.d.ts} +344 -339
  3. package/dist/{quickbaseClient.js → quickbase.js} +350 -266
  4. package/dist/quickbase.js.map +1 -0
  5. package/examples/react.js +42 -16
  6. package/examples/vanillajs.html +32 -8
  7. package/log-gen.yaml +3513 -0
  8. package/package.json +13 -9
  9. package/rollup.config.js +2 -2
  10. package/src/code-generation/fix-spec-definitions.ts +473 -66
  11. package/src/code-generation/fix-spec-paths.ts +210 -18
  12. package/src/code-generation/generate-unified-interface.ts +1 -8
  13. package/src/code-generation/output/quickbase-fixed.json +783 -1138
  14. package/src/generated-unified/QuickbaseClient.ts +10 -9
  15. package/src/log-gen.ts +82 -35
  16. package/src/quickbaseClient.ts +39 -42
  17. package/test-artifacts/test-results.json +173 -1145
  18. package/tests/playwright/qb/auth/cacheSwitching.test.ts +4 -4
  19. package/tests/playwright/qb/auth/fetchTempToken401.test.ts +2 -2
  20. package/tests/playwright/qb/auth/getAppWithUserToken.test.ts +2 -2
  21. package/tests/playwright/qb/auth/getTempToken.test.ts +2 -2
  22. package/tests/playwright/qb/auth/tokenPrefetch.test.ts +2 -2
  23. package/tests/playwright/qb/auth/tokenRenewal.test.ts +2 -2
  24. package/tests/setup.ts +37 -9
  25. package/tests/vitest/qb/apps/getApp.test.ts +37 -43
  26. package/tests/vitest/qb/fields/getFields.test.ts +3 -5
  27. package/tests/vitest/qb/records/deleteRecords.test.ts +78 -0
  28. package/tests/vitest/qb/records/runQuery.test.ts +82 -0
  29. package/tests/vitest/qb/records/upsert.test.ts +72 -0
  30. package/tests/vitest/qb/tables/createTable.test.ts +55 -0
  31. package/tests/vitest/qb/tables/deleteTable.test.ts +50 -0
  32. package/tests/vitest/qb/tables/getAppTables.test.ts +43 -64
  33. package/tests/vitest/qb/tables/getTable.test.ts +26 -0
  34. package/tests/vitest/qb/tables/updateTable.test.ts +48 -0
  35. package/tests/vitest/unit/apps/getApp.test.ts +17 -12
  36. package/tests/vitest/unit/auth/fetchTempToken401.test.ts +32 -6
  37. package/tests/vitest/unit/auth/getTempToken.test.ts +36 -24
  38. package/tests/vitest/unit/auth/retryOn401.test.ts +39 -5
  39. package/tests/vitest/unit/auth/two401s.test.ts +1 -1
  40. package/tests/vitest/unit/fields/getFields.test.ts +14 -7
  41. package/tests/vitest/unit/records/deleteRecords.test.ts +112 -0
  42. package/tests/vitest/unit/records/runQuery.test.ts +102 -0
  43. package/tests/vitest/unit/records/upsert.test.ts +218 -0
  44. package/tests/vitest/unit/tables/createTable.test.ts +70 -0
  45. package/tests/vitest/unit/tables/deleteTable.test.ts +77 -0
  46. package/tests/vitest/unit/tables/getAppTables.test.ts +41 -28
  47. package/tests/vitest/unit/tables/getTable.test.ts +233 -0
  48. package/tests/vitest/unit/tables/updateTable.test.ts +80 -0
  49. package/tsconfig.json +3 -2
  50. package/vitest.config.ts +8 -2
  51. package/dist/quickbaseClient.js.map +0 -1
  52. package/logGen.yaml +0 -1820
  53. package/src/utils.ts +0 -5
package/package.json CHANGED
@@ -1,33 +1,37 @@
1
1
  {
2
2
  "name": "quickbase-js",
3
- "main": "dist/quickbaseClient.js",
4
- "types": "dist/quickbaseClient.d.ts",
5
- "version": "1.0.1-beta.0",
3
+ "main": "dist/quickbase.js",
4
+ "types": "dist/quickbase.d.ts",
5
+ "version": "1.1.0-beta.1",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "description": "QuickBase JavaScript client for frameworks and vanilla JS",
10
- "module": "dist/quickbaseClient.js",
10
+ "module": "dist/quickbase.js",
11
11
  "type": "module",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./dist/quickbaseClient.js",
15
- "types": "./dist/quickbaseClient.d.ts"
14
+ "import": "./dist/quickbase.js",
15
+ "types": "./dist/quickbase.d.ts"
16
16
  }
17
17
  },
18
18
  "scripts": {
19
19
  "release": "standard-version",
20
20
  "release:beta": "standard-version --prerelease beta",
21
21
  "release:alpha": "standard-version --prerelease alpha",
22
+ "release:push": "npm run release:beta && git push --follow-tags origin main",
23
+ "release:publish": "npm run release:push && npm publish --tag beta",
22
24
  "fix-spec": "node --loader ts-node/esm src/code-generation/fix-spec-main.ts",
23
- "regenerate": "node --loader ts-node/esm src/code-generation/regenerate-client.ts",
24
- "generate-unified": "node --loader ts-node/esm src/code-generation/generate-unified-interface.ts",
25
+ "regenerate": "rimraf src/generated && node --loader ts-node/esm src/code-generation/regenerate-client.ts",
26
+ "regenerate-unified": "node --loader ts-node/esm src/code-generation/generate-unified-interface.ts",
27
+ "regenerate-all": "npm run fix-spec && npm run regenerate && npm run regenerate-unified",
25
28
  "log-gen": "node --loader ts-node/esm src/log-gen.ts",
26
29
  "build": "rimraf dist && rollup -c",
27
30
  "build:prod": "rm -rf dist/* && NODE_ENV=production rollup -c",
28
- "test": "vitest run tests/vitest/**/**/*.test.ts",
29
31
  "test:pw:qb:all": "playwright test tests/playwright/qb --config playwright.config.ts",
32
+ "test:vitest:all": "vitest run tests/vitest/**/**/*.test.ts",
30
33
  "test:vitest:qb": "vitest run tests/vitest/qb/**/*.test.ts",
34
+ "test:vitest:unit": "vitest run tests/vitest/unit/**/*.test.ts",
31
35
  "test:vitest:qb:apps": "vitest run tests/vitest/qb/apps/**/*.test.ts",
32
36
  "test:vitest:qb:auth": "vitest run tests/vitest/qb/auth/**/*.test.ts",
33
37
  "test:vitest:qb:fields": "vitest run tests/vitest/qb/fields/**/*.test.ts",
package/rollup.config.js CHANGED
@@ -14,7 +14,7 @@ export default [
14
14
  format: "esm",
15
15
  sourcemap: true,
16
16
  compact: isProd,
17
- entryFileNames: "quickbaseClient.js",
17
+ entryFileNames: "quickbase.js",
18
18
  },
19
19
  external: [
20
20
  "node:http",
@@ -42,7 +42,7 @@ export default [
42
42
  {
43
43
  input: "src/quickbaseClient.ts",
44
44
  output: {
45
- file: "dist/quickbaseClient.d.ts",
45
+ file: "dist/quickbase.d.ts",
46
46
  format: "esm",
47
47
  // Optional: sourcemap for .d.ts if needed for debugging
48
48
  // sourcemap: true,
@@ -1,6 +1,8 @@
1
+ // src/code-generation/fix-spec-definitions.ts
1
2
  export const definitions = {
2
3
  App: {
3
4
  type: "object",
5
+ required: ["id", "name"],
4
6
  properties: {
5
7
  id: { type: "string" },
6
8
  name: { type: "string" },
@@ -10,31 +12,137 @@ export const definitions = {
10
12
  timeZone: { type: "string" },
11
13
  dateFormat: { type: "string" },
12
14
  hasEveryoneOnTheInternet: { type: "boolean" },
15
+ memoryInfo: { $ref: "#/definitions/AppMemoryInfo" },
16
+ securityProperties: { $ref: "#/definitions/AppSecurityProperties" },
17
+ },
18
+ },
19
+ AppMemoryInfo: {
20
+ type: "object",
21
+ properties: {
22
+ estMemory: { type: "number" },
23
+ estMemoryInclDependentApps: { type: "number" },
24
+ },
25
+ },
26
+ AppSecurityProperties: {
27
+ type: "object",
28
+ properties: {
29
+ allowClone: { type: "boolean" },
30
+ allowExport: { type: "boolean" },
31
+ enableAppTokens: { type: "boolean" },
32
+ hideFromPublic: { type: "boolean" },
33
+ mustBeRealmApproved: { type: "boolean" },
34
+ useIPFilter: { type: "boolean" },
35
+ },
36
+ },
37
+ CreateAppRequest: {
38
+ type: "object",
39
+ required: ["name"],
40
+ properties: {
41
+ name: {
42
+ type: "string",
43
+ description:
44
+ "The app name. Multiple apps with the same name are allowed in the same realm.",
45
+ },
46
+ assignToken: {
47
+ type: "boolean",
48
+ description:
49
+ "Set to true to assign the app to the user token used to create it. Default is false.",
50
+ },
51
+ description: {
52
+ type: "string",
53
+ description:
54
+ "The description for the app. Defaults to blank if omitted.",
55
+ },
56
+ securityProperties: {
57
+ $ref: "#/definitions/AppSecurityProperties",
58
+ description: "Application security properties.",
59
+ },
60
+ variables: {
61
+ type: "array",
62
+ items: {
63
+ type: "object",
64
+ properties: {
65
+ name: { type: "string" },
66
+ value: { type: "string" },
67
+ },
68
+ required: ["name", "value"],
69
+ },
70
+ description:
71
+ "App variables (max 10, optional). See About Application Variables.",
72
+ },
73
+ },
74
+ },
75
+ CreateApp200Response: {
76
+ type: "object",
77
+ properties: {
78
+ id: {
79
+ type: "string",
80
+ description: "The unique identifier for this application.",
81
+ },
82
+ name: { type: "string", description: "The app name." },
83
+ description: {
84
+ type: "string",
85
+ description: "The description for the app.",
86
+ },
87
+ created: {
88
+ type: "string",
89
+ format: "date-time",
90
+ description: "The time and date the app was created (ISO 8601, UTC).",
91
+ },
92
+ updated: {
93
+ type: "string",
94
+ format: "date-time",
95
+ description:
96
+ "The time and date the app was last updated (ISO 8601, UTC).",
97
+ },
98
+ dateFormat: {
99
+ type: "string",
100
+ description:
101
+ "The format used for displaying dates in the app (e.g., MM-DD-YYYY).",
102
+ },
103
+ timeZone: {
104
+ type: "string",
105
+ description:
106
+ "The time zone used for displaying time values (e.g., (UTC-08:00) Pacific Time).",
107
+ },
13
108
  memoryInfo: {
14
- type: "object",
15
- properties: {
16
- estMemory: { type: "number" },
17
- estMemoryInclDependentApps: { type: "number" },
109
+ $ref: "#/definitions/AppMemoryInfo",
110
+ description: "Application memory information.",
111
+ },
112
+ hasEveryoneOnTheInternet: {
113
+ type: "boolean",
114
+ description:
115
+ "Indicates if the app includes Everyone On The Internet access.",
116
+ },
117
+ variables: {
118
+ type: "array",
119
+ items: {
120
+ type: "object",
121
+ properties: {
122
+ name: { type: "string" },
123
+ value: { type: "string" },
124
+ },
125
+ required: ["name", "value"],
18
126
  },
127
+ description: "The app variables.",
128
+ },
129
+ dataClassification: {
130
+ type: "string",
131
+ description:
132
+ "The Data Classification label assigned to the app (optional, may be 'None').",
19
133
  },
20
134
  securityProperties: {
21
- type: "object",
22
- properties: {
23
- allowClone: { type: "boolean" },
24
- allowExport: { type: "boolean" },
25
- enableAppTokens: { type: "boolean" },
26
- hideFromPublic: { type: "boolean" },
27
- mustBeRealmApproved: { type: "boolean" },
28
- useIPFilter: { type: "boolean" },
29
- },
135
+ $ref: "#/definitions/AppSecurityProperties",
136
+ description: "Security properties of the application.",
30
137
  },
31
138
  },
32
139
  required: ["id", "name"],
33
140
  },
34
141
  Field: {
35
142
  type: "object",
143
+ required: ["id", "label", "fieldType"],
36
144
  properties: {
37
- id: { type: "number" },
145
+ id: { type: "integer" },
38
146
  label: { type: "string" },
39
147
  fieldType: { type: "string" },
40
148
  noWrap: { type: "boolean" },
@@ -46,91 +154,390 @@ export const definitions = {
46
154
  doesDataCopy: { type: "boolean" },
47
155
  fieldHelp: { type: "string" },
48
156
  audited: { type: "boolean" },
157
+ properties: { $ref: "#/definitions/FieldProperties" },
158
+ permissions: {
159
+ type: "array",
160
+ items: { $ref: "#/definitions/FieldPermissionsInner" },
161
+ },
162
+ },
163
+ },
164
+ FieldProperties: {
165
+ type: "object",
166
+ properties: {
167
+ primaryKey: { type: "boolean" },
168
+ foreignKey: { type: "boolean" },
169
+ numLines: { type: "integer" },
170
+ maxLength: { type: "integer" },
171
+ appendOnly: { type: "boolean" },
172
+ allowHTML: { type: "boolean" },
173
+ allowMentions: { type: "boolean" },
174
+ sortAsGiven: { type: "boolean" },
175
+ carryChoices: { type: "boolean" },
176
+ allowNewChoices: { type: "boolean" },
177
+ formula: { type: "string" },
178
+ defaultValue: { type: "string" },
179
+ },
180
+ },
181
+ FieldPermissionsInner: {
182
+ type: "object",
183
+ properties: {
184
+ permissionType: { type: "string" },
185
+ role: { type: "string" },
186
+ roleId: { type: "integer" },
187
+ },
188
+ },
189
+ Table: {
190
+ type: "object",
191
+ required: ["id", "name"],
192
+ properties: {
193
+ id: {
194
+ type: "string",
195
+ description: "The unique identifier (dbid) of the table.",
196
+ },
197
+ name: { type: "string", description: "The name of the table." },
198
+ alias: {
199
+ type: "string",
200
+ description: "The automatically-created table alias for the table.",
201
+ },
202
+ description: {
203
+ type: "string",
204
+ description:
205
+ "The description of the table, as configured by an application administrator.",
206
+ },
207
+ created: {
208
+ type: "string",
209
+ format: "date-time",
210
+ description:
211
+ "The time and date when the table was created, in ISO 8601 format (UTC).",
212
+ },
213
+ updated: {
214
+ type: "string",
215
+ format: "date-time",
216
+ description:
217
+ "The time and date when the table schema or data was last updated, in ISO 8601 format (UTC).",
218
+ },
219
+ nextRecordId: {
220
+ type: "integer",
221
+ description:
222
+ "The incremental Record ID that will be used when the next record is created.",
223
+ },
224
+ nextFieldId: {
225
+ type: "integer",
226
+ description:
227
+ "The incremental Field ID that will be used when the next field is created.",
228
+ },
229
+ defaultSortFieldId: {
230
+ type: "integer",
231
+ description:
232
+ "The id of the field that is configured for default sorting.",
233
+ },
234
+ defaultSortOrder: {
235
+ type: "string",
236
+ enum: ["ASC", "DESC"],
237
+ description:
238
+ "The default sort order for the table, either ascending (ASC) or descending (DESC).",
239
+ },
240
+ keyFieldId: {
241
+ type: "integer",
242
+ description:
243
+ "The id of the field that is configured to be the key on this table, usually the Quickbase Record ID.",
244
+ },
245
+ singleRecordName: {
246
+ type: "string",
247
+ description: "The builder-configured singular noun of the table.",
248
+ },
249
+ pluralRecordName: {
250
+ type: "string",
251
+ description: "The builder-configured plural noun of the table.",
252
+ },
253
+ sizeLimit: {
254
+ type: "string",
255
+ description: "The size limit for the table (e.g., '150 MB').",
256
+ },
257
+ spaceUsed: {
258
+ type: "string",
259
+ description:
260
+ "The amount of space currently being used by the table (e.g., '17 MB').",
261
+ },
262
+ spaceRemaining: {
263
+ type: "string",
264
+ description:
265
+ "The amount of space remaining for use by the table (e.g., '133 MB').",
266
+ },
267
+ },
268
+ },
269
+ UpdateTableRequest: {
270
+ type: "object",
271
+ properties: {
272
+ name: { type: "string", description: "The new name for the table." },
273
+ singleRecordName: {
274
+ type: "string",
275
+ description:
276
+ "The new singular noun for records in the table. Defaults to 'Record' if not provided.",
277
+ },
278
+ pluralRecordName: {
279
+ type: "string",
280
+ description:
281
+ "The new plural noun for records in the table. Defaults to 'Records' if not provided.",
282
+ },
283
+ description: {
284
+ type: "string",
285
+ description:
286
+ "The new description for the table. Defaults to blank if not provided.",
287
+ },
288
+ },
289
+ description:
290
+ "Request body for updating table properties. At least one property must be provided.",
291
+ },
292
+ DeleteTableResponse: {
293
+ type: "object",
294
+ properties: {
295
+ deletedTableId: { type: "string", description: "The deleted table id." },
296
+ },
297
+ },
298
+ Record: {
299
+ type: "object",
300
+ properties: {
301
+ _dummy: {
302
+ type: "string",
303
+ description: "Unused dummy property to force model generation.",
304
+ nullable: true,
305
+ },
306
+ },
307
+ additionalProperties: {
308
+ type: "object",
49
309
  properties: {
310
+ value: {
311
+ type: ["string", "number", "boolean", "object", "array", "null"],
312
+ },
313
+ },
314
+ description: "The value object for a field ID key.",
315
+ },
316
+ description:
317
+ "A record with field ID keys (e.g., '6') and value objects (e.g., { value: 'data' }).",
318
+ },
319
+ UpsertRequest: {
320
+ type: "object",
321
+ required: ["to"],
322
+ properties: {
323
+ to: { type: "string", description: "The table identifier (dbid)." },
324
+ data: {
325
+ type: "array",
326
+ items: { $ref: "#/definitions/Record" },
327
+ description: "Array of records to upsert.",
328
+ },
329
+ mergeFieldId: {
330
+ type: "integer",
331
+ description: "The field ID to merge on (optional).",
332
+ },
333
+ fieldsToReturn: {
334
+ type: "array",
335
+ items: { type: "integer" },
336
+ description: "Field IDs to return in the response (optional).",
337
+ },
338
+ },
339
+ },
340
+ Upsert200Response: {
341
+ type: "object",
342
+ properties: {
343
+ data: {
344
+ type: "array",
345
+ items: {
346
+ type: "object",
347
+ additionalProperties: {
348
+ type: "object",
349
+ properties: { value: { type: "any" } },
350
+ },
351
+ },
352
+ description: "Array of upserted records with field IDs and values.",
353
+ },
354
+ metadata: {
50
355
  type: "object",
51
356
  properties: {
52
- primaryKey: { type: "boolean" },
53
- foreignKey: { type: "boolean" },
54
- numLines: { type: "number" },
55
- maxLength: { type: "number" },
56
- appendOnly: { type: "boolean" },
57
- allowHTML: { type: "boolean" },
58
- allowMentions: { type: "boolean" },
59
- sortAsGiven: { type: "boolean" },
60
- carryChoices: { type: "boolean" },
61
- allowNewChoices: { type: "boolean" },
62
- formula: { type: "string" },
63
- defaultValue: { type: "string" },
357
+ createdRecordIds: {
358
+ type: "array",
359
+ items: { type: "integer" },
360
+ description: "IDs of newly created records.",
361
+ },
362
+ updatedRecordIds: {
363
+ type: "array",
364
+ items: { type: "integer" },
365
+ description: "IDs of updated records.",
366
+ },
367
+ unchangedRecordIds: {
368
+ type: "array",
369
+ items: { type: "integer" },
370
+ description: "IDs of unchanged records.",
371
+ },
372
+ totalNumberOfRecordsProcessed: {
373
+ type: "integer",
374
+ description: "Total records processed.",
375
+ },
64
376
  },
377
+ required: ["totalNumberOfRecordsProcessed"],
65
378
  },
66
- permissions: {
379
+ },
380
+ },
381
+ Upsert207Response: {
382
+ type: "object",
383
+ properties: {
384
+ data: {
67
385
  type: "array",
68
386
  items: {
69
387
  type: "object",
70
- properties: {
71
- permissionType: { type: "string" },
72
- role: { type: "string" },
73
- roleId: { type: "number" },
388
+ additionalProperties: {
389
+ type: "object",
390
+ properties: { value: { type: "any" } },
74
391
  },
75
392
  },
393
+ description: "Array of successfully upserted records (may be empty).",
394
+ },
395
+ metadata: {
396
+ type: "object",
397
+ properties: {
398
+ createdRecordIds: { type: "array", items: { type: "integer" } },
399
+ updatedRecordIds: { type: "array", items: { type: "integer" } },
400
+ unchangedRecordIds: { type: "array", items: { type: "integer" } },
401
+ lineErrors: {
402
+ type: "object",
403
+ additionalProperties: { type: "array", items: { type: "string" } },
404
+ description: "Errors by line number (1-based index).",
405
+ },
406
+ totalNumberOfRecordsProcessed: { type: "integer" },
407
+ },
408
+ required: ["totalNumberOfRecordsProcessed"],
76
409
  },
77
410
  },
78
- required: ["id", "label", "fieldType"],
79
411
  },
80
- Table: {
412
+ ReportRunResponse: {
81
413
  type: "object",
82
414
  properties: {
83
415
  id: { type: "string" },
84
- name: { type: "string" },
85
- alias: { type: "string" },
86
- created: { type: "string", format: "date-time" },
87
- defaultSortFieldId: { type: "number" },
88
- defaultSortOrder: { type: "string" },
89
- description: { type: "string" },
90
- keyFieldId: { type: "number" },
91
- nextFieldId: { type: "number" },
92
- nextRecordId: { type: "number" },
93
- pluralRecordName: { type: "string" },
94
- singleRecordName: { type: "string" },
95
- sizeLimit: { type: "string" },
96
- spaceRemaining: { type: "string" },
97
- spaceUsed: { type: "string" },
98
- updated: { type: "string", format: "date-time" },
416
+ data: { type: "object" },
99
417
  },
100
- required: ["id", "name"],
101
418
  },
102
- Record: {
419
+ GetTempTokenDBID200Response: {
103
420
  type: "object",
421
+ required: ["temporaryAuthorization"],
104
422
  properties: {
105
- id: { type: "number" },
106
- fields: {
107
- type: "object",
108
- additionalProperties: { type: "string" },
423
+ temporaryAuthorization: { type: "string" },
424
+ },
425
+ },
426
+ DeleteRecordsRequest: {
427
+ type: "object",
428
+ required: ["from", "where"],
429
+ properties: {
430
+ from: {
431
+ type: "string",
432
+ description:
433
+ "The table identifier (dbid) from which to delete records.",
434
+ },
435
+ where: {
436
+ type: "string",
437
+ description:
438
+ "A QuickBase query string specifying which records to delete.",
109
439
  },
110
440
  },
111
- required: ["id"],
441
+ description:
442
+ "Request body for deleting records from a table using a query.",
112
443
  },
113
- Upsert200Response: {
444
+ DeleteRecords200Response: {
114
445
  type: "object",
115
446
  properties: {
116
- id: { type: "number" },
117
- status: { type: "string" },
447
+ numberDeleted: {
448
+ type: "integer",
449
+ description: "The number of records successfully deleted.",
450
+ },
118
451
  },
119
- required: ["id"],
452
+ required: ["numberDeleted"],
453
+ description: "Response body for successful deletion of records.",
120
454
  },
121
- ReportRunResponse: {
455
+ RunQueryRequest: {
122
456
  type: "object",
457
+ required: ["from"],
123
458
  properties: {
124
- id: { type: "string" },
125
- data: { type: "object" }, // Placeholder
459
+ from: { type: "string", description: "Table ID (dbid)" },
460
+ select: {
461
+ type: "array",
462
+ items: { type: "integer" },
463
+ description: "Field IDs to return",
464
+ },
465
+ where: { type: "string", description: "Query string" },
466
+ sortBy: {
467
+ type: "array",
468
+ items: {
469
+ type: "object",
470
+ properties: {
471
+ fieldId: { type: "integer" },
472
+ order: { type: "string", enum: ["ASC", "DESC"] },
473
+ },
474
+ },
475
+ description: "Sort criteria",
476
+ },
477
+ groupBy: {
478
+ type: "array",
479
+ items: {
480
+ type: "object",
481
+ properties: {
482
+ fieldId: { type: "integer" },
483
+ grouping: { type: "string", enum: ["equal-values"] },
484
+ },
485
+ },
486
+ description: "Grouping criteria",
487
+ },
488
+ options: {
489
+ type: "object",
490
+ properties: {
491
+ skip: { type: "integer", description: "Number of records to skip" },
492
+ top: {
493
+ type: "integer",
494
+ description: "Max number of records to return",
495
+ },
496
+ compareWithAppLocalTime: {
497
+ type: "boolean",
498
+ description: "Compare times with app local time",
499
+ },
500
+ },
501
+ },
126
502
  },
127
- required: ["id"],
128
503
  },
129
- GetTempTokenDBID200Response: {
504
+ RunQueryResponse: {
130
505
  type: "object",
131
506
  properties: {
132
- temporaryAuthorization: { type: "string" },
507
+ data: {
508
+ type: "array",
509
+ items: {
510
+ type: "object",
511
+ additionalProperties: {
512
+ type: "object",
513
+ properties: { value: { type: "any" } },
514
+ },
515
+ },
516
+ description: "Array of record data with field IDs as keys",
517
+ },
518
+ fields: {
519
+ type: "array",
520
+ items: {
521
+ type: "object",
522
+ properties: {
523
+ id: { type: "integer" },
524
+ label: { type: "string" },
525
+ type: { type: "string" },
526
+ },
527
+ },
528
+ description: "Field metadata",
529
+ },
530
+ metadata: {
531
+ type: "object",
532
+ properties: {
533
+ numFields: { type: "integer" },
534
+ numRecords: { type: "integer" },
535
+ skip: { type: "integer" },
536
+ top: { type: "integer" },
537
+ totalRecords: { type: "integer" },
538
+ },
539
+ description: "Query metadata",
540
+ },
133
541
  },
134
- required: ["temporaryAuthorization"],
135
542
  },
136
543
  };