quickbase-js 1.2.0 → 2.0.0-alpha.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.
Files changed (95) hide show
  1. package/README.md +351 -227
  2. package/dist/auth/index.d.ts +15 -0
  3. package/dist/auth/index.d.ts.map +1 -0
  4. package/dist/auth/index.js +29 -0
  5. package/dist/auth/index.js.map +1 -0
  6. package/dist/auth/sso-token.d.ts +28 -0
  7. package/dist/auth/sso-token.d.ts.map +1 -0
  8. package/dist/auth/sso-token.js +108 -0
  9. package/dist/auth/sso-token.js.map +1 -0
  10. package/dist/auth/temp-token.d.ts +31 -0
  11. package/dist/auth/temp-token.d.ts.map +1 -0
  12. package/dist/auth/temp-token.js +121 -0
  13. package/dist/auth/temp-token.js.map +1 -0
  14. package/dist/auth/token-cache.d.ts +44 -0
  15. package/dist/auth/token-cache.d.ts.map +1 -0
  16. package/dist/auth/token-cache.js +84 -0
  17. package/dist/auth/token-cache.js.map +1 -0
  18. package/dist/auth/types.d.ts +44 -0
  19. package/dist/auth/types.d.ts.map +1 -0
  20. package/dist/auth/types.js +5 -0
  21. package/dist/auth/types.js.map +1 -0
  22. package/dist/auth/user-token.d.ts +17 -0
  23. package/dist/auth/user-token.d.ts.map +1 -0
  24. package/dist/auth/user-token.js +30 -0
  25. package/dist/auth/user-token.js.map +1 -0
  26. package/dist/client/index.d.ts +12 -0
  27. package/dist/client/index.d.ts.map +1 -0
  28. package/dist/client/index.js +8 -0
  29. package/dist/client/index.js.map +1 -0
  30. package/dist/client/pagination.d.ts +131 -0
  31. package/dist/client/pagination.d.ts.map +1 -0
  32. package/dist/client/pagination.js +226 -0
  33. package/dist/client/pagination.js.map +1 -0
  34. package/dist/client/request.d.ts +40 -0
  35. package/dist/client/request.d.ts.map +1 -0
  36. package/dist/client/request.js +194 -0
  37. package/dist/client/request.js.map +1 -0
  38. package/dist/client/retry.d.ts +41 -0
  39. package/dist/client/retry.d.ts.map +1 -0
  40. package/dist/client/retry.js +122 -0
  41. package/dist/client/retry.js.map +1 -0
  42. package/dist/client/throttle.d.ts +46 -0
  43. package/dist/client/throttle.d.ts.map +1 -0
  44. package/dist/client/throttle.js +85 -0
  45. package/dist/client/throttle.js.map +1 -0
  46. package/dist/core/config.d.ts +13 -0
  47. package/dist/core/config.d.ts.map +1 -0
  48. package/dist/core/config.js +120 -0
  49. package/dist/core/config.js.map +1 -0
  50. package/dist/core/dates.d.ts +18 -0
  51. package/dist/core/dates.d.ts.map +1 -0
  52. package/dist/core/dates.js +58 -0
  53. package/dist/core/dates.js.map +1 -0
  54. package/dist/core/errors.d.ts +134 -0
  55. package/dist/core/errors.d.ts.map +1 -0
  56. package/dist/core/errors.js +185 -0
  57. package/dist/core/errors.js.map +1 -0
  58. package/dist/core/index.d.ts +10 -0
  59. package/dist/core/index.d.ts.map +1 -0
  60. package/dist/core/index.js +9 -0
  61. package/dist/core/index.js.map +1 -0
  62. package/dist/core/logger.d.ts +41 -0
  63. package/dist/core/logger.d.ts.map +1 -0
  64. package/dist/core/logger.js +96 -0
  65. package/dist/core/logger.js.map +1 -0
  66. package/dist/core/types.d.ts +154 -0
  67. package/dist/core/types.d.ts.map +1 -0
  68. package/dist/core/types.js +23 -0
  69. package/dist/core/types.js.map +1 -0
  70. package/dist/generated/client.d.ts +18 -0
  71. package/dist/generated/client.d.ts.map +1 -0
  72. package/dist/generated/client.js +1390 -0
  73. package/dist/generated/client.js.map +1 -0
  74. package/dist/generated/types.d.ts +3827 -0
  75. package/dist/generated/types.d.ts.map +1 -0
  76. package/dist/generated/types.js +8 -0
  77. package/dist/generated/types.js.map +1 -0
  78. package/dist/index.d.ts +89 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +99 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/quickbase.esm.js +7 -0
  83. package/dist/quickbase.esm.js.map +7 -0
  84. package/dist/quickbase.min.js +7 -0
  85. package/dist/quickbase.min.js.map +7 -0
  86. package/package.json +57 -86
  87. package/dist/esm/quickbase.d.ts +0 -8094
  88. package/dist/esm/quickbase.js +0 -8333
  89. package/dist/esm/quickbase.js.map +0 -1
  90. package/dist/esm/quickbase.min.js +0 -2
  91. package/dist/esm/quickbase.min.js.map +0 -1
  92. package/dist/umd/quickbase.umd.js +0 -8909
  93. package/dist/umd/quickbase.umd.js.map +0 -1
  94. package/dist/umd/quickbase.umd.min.js +0 -2
  95. package/dist/umd/quickbase.umd.min.js.map +0 -1
@@ -0,0 +1,1390 @@
1
+ /**
2
+ * Auto-generated QuickBase API client implementation
3
+ * DO NOT EDIT - Regenerate with: npm run spec:generate
4
+ */
5
+ import { createPaginatedRequest } from '../client/pagination.js';
6
+ /**
7
+ * Create typed API methods from a request function
8
+ * @param request - The request executor function
9
+ * @param autoPaginate - Default auto-pagination behavior (default: false)
10
+ */
11
+ export function createApiMethods(request, autoPaginate = false) {
12
+ return {
13
+ /**
14
+ * Create an app
15
+ *
16
+ * Creates an application in an account. You must have application creation rights in the respective account. Main properties and application variables can be set with this API.
17
+ *
18
+ * @param body - Request body
19
+ * @param body.assignToken - Set to true if you would like to assign the app to the user token you used to create the application. The default is false. (optional)
20
+ * @param body.variables - The app variables. A maximum of 10 variables can be inserted at a time. See [About Application Variables](https://help.quickbase.com/user-assistance/variables.html) (optional)
21
+ * @param body.name - The app name. You are allowed to create multiple apps with the same name, in the same realm, because they will have different dbid values. We urge you to be careful about doing this.
22
+ * @param body.securityProperties - Application security properties. (optional)
23
+ * @param body.description - The description for the app. If this property is left out, the app description will be blank. (optional)
24
+ *
25
+ * @returns Success
26
+ *
27
+ * @see https://developer.quickbase.com/operation/createApp
28
+ */
29
+ createApp(body) {
30
+ return request({
31
+ method: 'POST',
32
+ path: '/apps',
33
+ body,
34
+ });
35
+ },
36
+ /**
37
+ * Get an app
38
+ *
39
+ * Returns the main properties of an application, including application variables.
40
+ *
41
+ * @param params.appId - The unique identifier of an app
42
+ *
43
+ * @returns Success
44
+ *
45
+ * @see https://developer.quickbase.com/operation/getApp
46
+ */
47
+ getApp(params) {
48
+ return request({
49
+ method: 'GET',
50
+ path: `/apps/${params.appId}`,
51
+ });
52
+ },
53
+ /**
54
+ * Update an app
55
+ *
56
+ * Updates the main properties and/or application variables for a specific application. Any properties of the app that you do not specify in the request body will remain unchanged.
57
+ *
58
+ * @param params.appId - The unique identifier of an app
59
+ *
60
+ * @param body - Request body (optional)
61
+ * @param body.variables - The app variables. A maximum of 10 variables can be updated at a time. See [About Application Variables](https://help.quickbase.com/user-assistance/variables.html) (optional)
62
+ * @param body.name - The name for the app. (optional)
63
+ * @param body.securityProperties - Security properties of the application (optional)
64
+ * @param body.description - The description for the app. (optional)
65
+ *
66
+ * @returns Success
67
+ *
68
+ * @see https://developer.quickbase.com/operation/updateApp
69
+ */
70
+ updateApp(params, body) {
71
+ return request({
72
+ method: 'POST',
73
+ path: `/apps/${params.appId}`,
74
+ body,
75
+ });
76
+ },
77
+ /**
78
+ * Delete an app
79
+ *
80
+ * Deletes an entire application, including all of the tables and data.
81
+ *
82
+ * @param params.appId - The unique identifier of an app
83
+ *
84
+ * @param body - Request body
85
+ * @param body.name - To confirm application deletion we ask for application name.
86
+ *
87
+ * @returns Success
88
+ *
89
+ * @see https://developer.quickbase.com/operation/deleteApp
90
+ */
91
+ deleteApp(params, body) {
92
+ return request({
93
+ method: 'DELETE',
94
+ path: `/apps/${params.appId}`,
95
+ body,
96
+ });
97
+ },
98
+ /**
99
+ * Get app events
100
+ *
101
+ * Get a list of events that can be triggered based on data or user actions in this application, includes: Email notification, Reminders, Subscriptions, QB Actions, Webhooks, record change triggered Automations (does not include scheduled).
102
+ *
103
+ * @param params.appId - The unique identifier of an app
104
+ *
105
+ * @returns Success
106
+ *
107
+ * @see https://developer.quickbase.com/operation/getAppEvents
108
+ */
109
+ getAppEvents(params) {
110
+ return request({
111
+ method: 'GET',
112
+ path: `/apps/${params.appId}/events`,
113
+ });
114
+ },
115
+ /**
116
+ * Copy an app
117
+ *
118
+ * Copies the specified application. The new application will have the same schema as the original. See below for additional copy options.
119
+ *
120
+ * @param params.appId - The unique identifier of an app
121
+ *
122
+ * @param body - Request body
123
+ * @param body.name - The name of the newly copied app
124
+ * @param body.description - The description of the newly copied app (optional)
125
+ * @param body.properties - The configuration properties for performing the app copy (optional)
126
+ *
127
+ * @returns Success
128
+ *
129
+ * @see https://developer.quickbase.com/operation/copyApp
130
+ */
131
+ copyApp(params, body) {
132
+ return request({
133
+ method: 'POST',
134
+ path: `/apps/${params.appId}/copy`,
135
+ body,
136
+ });
137
+ },
138
+ /**
139
+ * Get tables for an app
140
+ *
141
+ * Gets a list of all the tables that exist in a specific application. The properties for each table are the same as what is returned in Get table.
142
+ *
143
+ * @param params.appId - The unique identifier of an app
144
+ *
145
+ * @returns Success
146
+ *
147
+ * @see https://developer.quickbase.com/operation/getAppTables
148
+ */
149
+ getAppTables(params) {
150
+ return request({
151
+ method: 'GET',
152
+ path: '/tables',
153
+ query: { appId: params.appId },
154
+ });
155
+ },
156
+ /**
157
+ * Create a table
158
+ *
159
+ * Creates a table in an application.
160
+ *
161
+ * @param params.appId - The unique identifier of an app
162
+ *
163
+ * @param body - Request body
164
+ * @param body.name - The name for the table.
165
+ * @param body.pluralRecordName - The plural noun for records in the table. If this value is not passed the default value is 'Records'. (optional)
166
+ * @param body.singleRecordName - The singular noun for records in the table. If this value is not passed the default value is 'Record'. (optional)
167
+ * @param body.description - The description for the table. If this value is not passed the default value is blank. (optional)
168
+ *
169
+ * @returns Success
170
+ *
171
+ * @see https://developer.quickbase.com/operation/createTable
172
+ */
173
+ createTable(params, body) {
174
+ return request({
175
+ method: 'POST',
176
+ path: '/tables',
177
+ query: { appId: params.appId },
178
+ body,
179
+ });
180
+ },
181
+ /**
182
+ * Get a table
183
+ *
184
+ * Gets the properties of an individual table that is part of an application.
185
+ *
186
+ * @param params.appId - The unique identifier of an app
187
+ * @param params.tableId - The unique identifier (dbid) of the table.
188
+ *
189
+ * @returns Success
190
+ *
191
+ * @see https://developer.quickbase.com/operation/getTable
192
+ */
193
+ getTable(params) {
194
+ return request({
195
+ method: 'GET',
196
+ path: `/tables/${params.tableId}`,
197
+ query: { appId: params.appId },
198
+ });
199
+ },
200
+ /**
201
+ * Update a table
202
+ *
203
+ * Updates the main properties of a specific table. Any properties of the table that you do not specify in the request body will remain unchanged.
204
+ *
205
+ * @param params.appId - The unique identifier of an app
206
+ * @param params.tableId - The unique identifier (dbid) of the table.
207
+ *
208
+ * @param body - Request body (optional)
209
+ * @param body.name - The name for the table. (optional)
210
+ * @param body.pluralRecordName - The plural noun for records in the table. If this value is not passed the default value is 'Records'. (optional)
211
+ * @param body.singleRecordName - The singular noun for records in the table. If this value is not passed the default value is 'Record'. (optional)
212
+ * @param body.description - The description for the table. If this value is not passed the default value is blank. (optional)
213
+ *
214
+ * @returns Success
215
+ *
216
+ * @see https://developer.quickbase.com/operation/updateTable
217
+ */
218
+ updateTable(params, body) {
219
+ return request({
220
+ method: 'POST',
221
+ path: `/tables/${params.tableId}`,
222
+ query: { appId: params.appId },
223
+ body,
224
+ });
225
+ },
226
+ /**
227
+ * Delete a table
228
+ *
229
+ * Deletes a specific table in an application, including all of the data within it.
230
+ *
231
+ * @param params.appId - The unique identifier of an app
232
+ * @param params.tableId - The unique identifier (dbid) of the table.
233
+ *
234
+ * @returns Success
235
+ *
236
+ * @see https://developer.quickbase.com/operation/deleteTable
237
+ */
238
+ deleteTable(params) {
239
+ return request({
240
+ method: 'DELETE',
241
+ path: `/tables/${params.tableId}`,
242
+ query: { appId: params.appId },
243
+ });
244
+ },
245
+ /**
246
+ * Get all relationships
247
+ *
248
+ * Get a list of all relationships, and their definitions, for a specific table. Details are provided for the child side of relationships within a given application. Limited details are returned for cross-application relationships.
249
+ *
250
+ * @param params.skip - The number of relationships to skip. (optional)
251
+ * @param params.tableId - The unique identifier (dbid) of the child table.
252
+ *
253
+ * @returns Success
254
+ *
255
+ * @see https://developer.quickbase.com/operation/getRelationships
256
+ */
257
+ getRelationships(params) {
258
+ const executor = () => {
259
+ return request({
260
+ method: 'GET',
261
+ path: `/tables/${params.tableId}/relationships`,
262
+ query: { skip: params.skip },
263
+ });
264
+ };
265
+ const paginatedExecutor = (paginationParams) => {
266
+ return request({
267
+ method: 'GET',
268
+ path: `/tables/${params.tableId}/relationships`,
269
+ query: { skip: params.skip, ...paginationParams },
270
+ });
271
+ };
272
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
273
+ },
274
+ /**
275
+ * Create a relationship
276
+ *
277
+ * Creates a relationship in a table as well as lookup/summary fields. Relationships can only be created for tables within the same app.
278
+ *
279
+ * @param params.tableId - The unique identifier (dbid) of the table. This will be the child table.
280
+ *
281
+ * @param body - Request body
282
+ * @param body.summaryFields - Array of summary field objects which will turn into summary fields in the parent table. When you specify the 'COUNT' accumulation type, you have to specify 0 as the summaryFid (or not set it in the request). 'DISTINCT-COUNT' requires that summaryFid be set to an actual fid. (optional)
283
+ * @param body.lookupFieldIds - Array of field ids in the parent table that will become lookup fields in the child table. (optional)
284
+ * @param body.parentTableId - The parent table id for the relationship.
285
+ * @param body.foreignKeyField - This property is optional. If it is not provided, the foreign key field will be created with the label ‘Related <record>’, where <record> is the name of a record in the parent table. (optional)
286
+ *
287
+ * @returns Success
288
+ *
289
+ * @see https://developer.quickbase.com/operation/createRelationship
290
+ */
291
+ createRelationship(params, body) {
292
+ return request({
293
+ method: 'POST',
294
+ path: `/tables/${params.tableId}/relationship`,
295
+ body,
296
+ });
297
+ },
298
+ /**
299
+ * Update a relationship
300
+ *
301
+ * Use this endpoint to add lookup fields and summary fields to an existing relationship. Updating a relationship will not delete existing lookup/summary fields.
302
+ *
303
+ * @param params.tableId - The unique identifier (dbid) of the table. This will be the child table.
304
+ * @param params.relationshipId - The relationship id. This is the field id of the reference field on the child table.
305
+ *
306
+ * @param body - Request body (optional)
307
+ * @param body.summaryFields - An array of objects, each representing a configuration of one field from the child table, that will become summary fields on the parent table. When you specify the 'COUNT' accumulation type, you have to specify 0 as the summaryFid (or not set it in the request). 'DISTINCT-COUNT' requires that summaryFid be set to an actual fid. (optional)
308
+ * @param body.lookupFieldIds - An array of field ids on the parent table that will become lookup fields on the child table. (optional)
309
+ *
310
+ * @returns Success
311
+ *
312
+ * @see https://developer.quickbase.com/operation/updateRelationship
313
+ */
314
+ updateRelationship(params, body) {
315
+ return request({
316
+ method: 'POST',
317
+ path: `/tables/${params.tableId}/relationship/${params.relationshipId}`,
318
+ body,
319
+ });
320
+ },
321
+ /**
322
+ * Delete a relationship
323
+ *
324
+ * Use this endpoint to delete an entire relationship, including all lookup and summary fields. The reference field in the relationship will not be deleted.
325
+ *
326
+ * @param params.tableId - The unique identifier (dbid) of the table. This will be the child table.
327
+ * @param params.relationshipId - The relationship id. This is the field id of the reference field on the child table.
328
+ *
329
+ * @returns Success
330
+ *
331
+ * @see https://developer.quickbase.com/operation/deleteRelationship
332
+ */
333
+ deleteRelationship(params) {
334
+ return request({
335
+ method: 'DELETE',
336
+ path: `/tables/${params.tableId}/relationship/${params.relationshipId}`,
337
+ });
338
+ },
339
+ /**
340
+ * Get reports for a table
341
+ *
342
+ * Get the schema (properties) of all reports for a table. If the user running the API is an application administrator, the API will also return all personal reports with owner's user id.
343
+ *
344
+ * @param params.tableId - The unique identifier of the table.
345
+ *
346
+ * @returns Success
347
+ *
348
+ * @see https://developer.quickbase.com/operation/getTableReports
349
+ */
350
+ getTableReports(params) {
351
+ return request({
352
+ method: 'GET',
353
+ path: '/reports',
354
+ query: { tableId: params.tableId },
355
+ });
356
+ },
357
+ /**
358
+ * Get a report
359
+ *
360
+ * Get the schema (properties) of an individual report.
361
+ *
362
+ * @param params.tableId - The unique identifier of table.
363
+ * @param params.reportId - The identifier of the report, unique to the table.
364
+ *
365
+ * @returns Success
366
+ *
367
+ * @see https://developer.quickbase.com/operation/getReport
368
+ */
369
+ getReport(params) {
370
+ return request({
371
+ method: 'GET',
372
+ path: `/reports/${params.reportId}`,
373
+ query: { tableId: params.tableId },
374
+ });
375
+ },
376
+ /**
377
+ * Run a report
378
+ *
379
+ * Runs a report, based on an ID and returns the underlying data associated with it. The format of the data will vary based on the report type. Reports that focus on record-level data (table, calendar, etc.) return the individual records. Aggregate reports (summary, chart) will return the summarized information as configured in the report. UI-specific elements are not returned, such as totals, averages and visualizations. Returns data with intelligent pagination based on the approximate size of each record. The metadata object will include the necessary information to iterate over the response and gather more data.
380
+ *
381
+ * @param params.tableId - The identifier of the table for the report.
382
+ * @param params.skip - The number of records to skip. You can set this value when paginating through a set of results. (optional)
383
+ * @param params.top - The maximum number of records to return. You can override the default Quickbase pagination to get more or fewer results. If your requested value here exceeds the dynamic maximums, we will return a subset of results and the rest can be gathered in subsequent API calls. (optional)
384
+ * @param params.reportId - The identifier of the report, unique to the table.
385
+ *
386
+ * @param body - Request body (optional)
387
+ *
388
+ * @returns Success
389
+ *
390
+ * @see https://developer.quickbase.com/operation/runReport
391
+ */
392
+ runReport(params, body) {
393
+ const executor = () => {
394
+ return request({
395
+ method: 'POST',
396
+ path: `/reports/${params.reportId}/run`,
397
+ query: { tableId: params.tableId, skip: params.skip, top: params.top },
398
+ body,
399
+ });
400
+ };
401
+ const paginatedExecutor = (paginationParams) => {
402
+ const bodyRecord = body;
403
+ const paginatedBody = paginationParams.skip !== undefined || paginationParams.nextPageToken || paginationParams.nextToken
404
+ ? {
405
+ ...(bodyRecord || {}),
406
+ options: {
407
+ ...(bodyRecord?.options || {}),
408
+ ...(paginationParams.skip !== undefined ? { skip: paginationParams.skip } : {}),
409
+ },
410
+ ...(paginationParams.nextPageToken ? { nextPageToken: paginationParams.nextPageToken } : {}),
411
+ ...(paginationParams.nextToken ? { nextToken: paginationParams.nextToken } : {}),
412
+ }
413
+ : body;
414
+ return request({
415
+ method: 'POST',
416
+ path: `/reports/${params.reportId}/run`,
417
+ query: { tableId: params.tableId, skip: params.skip, top: params.top },
418
+ body: paginatedBody,
419
+ });
420
+ };
421
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
422
+ },
423
+ /**
424
+ * Get fields for a table
425
+ *
426
+ * Gets the properties for all fields in a specific table. The properties for each field are the same as in Get field.
427
+ *
428
+ * @param params.tableId - The unique identifier (dbid) of the table.
429
+ * @param params.includeFieldPerms - Set to 'true' if you'd like to get back the custom permissions for the field(s). (optional)
430
+ *
431
+ * @returns Success
432
+ *
433
+ * @see https://developer.quickbase.com/operation/getFields
434
+ */
435
+ getFields(params) {
436
+ return request({
437
+ method: 'GET',
438
+ path: '/fields',
439
+ query: { tableId: params.tableId, includeFieldPerms: params.includeFieldPerms },
440
+ });
441
+ },
442
+ /**
443
+ * Create a field
444
+ *
445
+ * Creates a field within a table, including the custom permissions of that field.
446
+ *
447
+ * @param params.tableId - The unique identifier of the table.
448
+ *
449
+ * @param body - Request body
450
+ * @param body.audited - Indicates if the field is being tracked as part of Quickbase Audit Logs. You can only set this property to "true" if the app has audit logs enabled. See Enable data change logs under [Quickbase Audit Logs](https://help.quickbase.com/user-assistance/audit_logs.html). Defaults to false. (optional)
451
+ * @param body.fieldHelp - The configured help text shown to users within the product. (optional)
452
+ * @param body.bold - Indicates if the field is configured to display in bold in the product. Defaults to false. (optional)
453
+ * @param body.properties - Specific field properties. (optional)
454
+ * @param body.appearsByDefault - Indicates if the field is marked as a default in reports. Defaults to true. (optional)
455
+ * @param body.fieldType - The [field types](https://help.quickbase.com/user-assistance/field_types.html), click on any of the field type links for more info.
456
+ * @param body.permissions - Field Permissions for different roles. (optional)
457
+ * @param body.addToForms - Whether the field you are adding should appear on forms. Defaults to false. (optional)
458
+ * @param body.label - The label (name) of the field.
459
+ * @param body.findEnabled - Indicates if the field is marked as searchable. Defaults to true. (optional)
460
+ * @param body.noWrap - Indicates if the field is configured to not wrap when displayed in the product. Defaults to false. (optional)
461
+ *
462
+ * @returns Success
463
+ *
464
+ * @see https://developer.quickbase.com/operation/createField
465
+ */
466
+ createField(params, body) {
467
+ return request({
468
+ method: 'POST',
469
+ path: '/fields',
470
+ query: { tableId: params.tableId },
471
+ body,
472
+ });
473
+ },
474
+ /**
475
+ * Delete field(s)
476
+ *
477
+ * Deletes one or many fields in a table, based on field id. This will also permanently delete any data or calculations in that field.
478
+ *
479
+ * @param params.tableId - The unique identifier of the table.
480
+ *
481
+ * @param body - Request body
482
+ * @param body.fieldIds - List of field ids to be deleted.
483
+ *
484
+ * @returns Success
485
+ *
486
+ * @see https://developer.quickbase.com/operation/deleteFields
487
+ */
488
+ deleteFields(params, body) {
489
+ return request({
490
+ method: 'DELETE',
491
+ path: '/fields',
492
+ query: { tableId: params.tableId },
493
+ body,
494
+ });
495
+ },
496
+ /**
497
+ * Get field
498
+ *
499
+ * Gets the properties of an individual field, based on field id.
500
+ Properties present on all field types are returned at the top level. Properties unique to a specific type of field are returned under the 'properties' attribute. Please see [Field types page](../fieldInfo) for more details on the properties for each field type.
501
+ *
502
+ * @param params.tableId - The unique identifier (dbid) of the table.
503
+ * @param params.includeFieldPerms - Set to 'true' if you'd like to get back the custom permissions for the field(s). (optional)
504
+ * @param params.fieldId - The unique identifier (fid) of the field.
505
+ *
506
+ * @returns Success
507
+ *
508
+ * @see https://developer.quickbase.com/operation/getField
509
+ */
510
+ getField(params) {
511
+ return request({
512
+ method: 'GET',
513
+ path: `/fields/${params.fieldId}`,
514
+ query: { tableId: params.tableId, includeFieldPerms: params.includeFieldPerms },
515
+ });
516
+ },
517
+ /**
518
+ * Update a field
519
+ *
520
+ * Updates the properties and custom permissions of a field. The attempt to update certain properties might cause existing data to no longer obey the field’s new properties and may be rejected. See the descriptions of required, unique, and choices, below, for specific situations. Any properties of the field that you do not specify in the request body will remain unchanged.
521
+ *
522
+ * @param params.tableId - The unique identifier of the table.
523
+ * @param params.fieldId - The unique identifier (fid) of the field.
524
+ *
525
+ * @param body - Request body (optional)
526
+ * @param body.audited - Indicates if the field is being tracked as part of Quickbase Audit Logs. You can only set this property to "true" if the app has audit logs enabled. See Enable data change logs under [Quickbase Audit Logs](https://help.quickbase.com/user-assistance/audit_logs.html). (optional)
527
+ * @param body.fieldHelp - The configured help text shown to users within the product. (optional)
528
+ * @param body.bold - Indicates if the field is configured to display in bold in the product. (optional)
529
+ * @param body.required - Indicates if the field is required (i.e. if every record must have a non-null value in this field). If you attempt to change a field from not-required to required, and the table currently contains records that have null values in that field, you will get an error indicating that there are null values of the field. In this case you need to find and update those records with null values of the field before changing the field to required. (optional)
530
+ * @param body.properties - Specific field properties. (optional)
531
+ * @param body.appearsByDefault - Indicates if the field is marked as a default in reports. (optional)
532
+ * @param body.unique - Indicates if every record in the table must contain a unique value of this field. If you attempt to change a field from not-unique to unique, and the table currently contains records with the same value of this field, you will get an error. In this case you need to find and update those records with duplicate values of the field before changing the field to unique. (optional)
533
+ * @param body.permissions - Field Permissions for different roles. (optional)
534
+ * @param body.addToForms - Whether the field you are adding should appear on forms. (optional)
535
+ * @param body.label - The label (name) of the field. (optional)
536
+ * @param body.findEnabled - Indicates if the field is marked as searchable. (optional)
537
+ * @param body.noWrap - Indicates if the field is configured to not wrap when displayed in the product. (optional)
538
+ *
539
+ * @returns Success
540
+ *
541
+ * @see https://developer.quickbase.com/operation/updateField
542
+ */
543
+ updateField(params, body) {
544
+ return request({
545
+ method: 'POST',
546
+ path: `/fields/${params.fieldId}`,
547
+ query: { tableId: params.tableId },
548
+ body,
549
+ });
550
+ },
551
+ /**
552
+ * Get usage for all fields
553
+ *
554
+ * Get all the field usage statistics for a table. This is a summary of the information that can be found in the usage table of field properties.
555
+ *
556
+ * @param params.tableId - The unique identifier (dbid) of the table.
557
+ * @param params.skip - The number of fields to skip from the list. (optional)
558
+ * @param params.top - The maximum number of fields to return. (optional)
559
+ *
560
+ * @returns Success
561
+ *
562
+ * @see https://developer.quickbase.com/operation/getFieldsUsage
563
+ */
564
+ getFieldsUsage(params) {
565
+ return request({
566
+ method: 'GET',
567
+ path: '/fields/usage',
568
+ query: { tableId: params.tableId, skip: params.skip, top: params.top },
569
+ });
570
+ },
571
+ /**
572
+ * Get usage for a field
573
+ *
574
+ * Get a single fields usage statistics. This is a summary of the information that can be found in the usage table of field properties.
575
+ *
576
+ * @param params.tableId - The unique identifier (dbid) of the table.
577
+ * @param params.fieldId - The unique identifier (fid) of the field.
578
+ *
579
+ * @returns Success
580
+ *
581
+ * @see https://developer.quickbase.com/operation/getFieldUsage
582
+ */
583
+ getFieldUsage(params) {
584
+ return request({
585
+ method: 'GET',
586
+ path: `/fields/usage/${params.fieldId}`,
587
+ query: { tableId: params.tableId },
588
+ });
589
+ },
590
+ /**
591
+ * Run a formula
592
+ *
593
+ * Allows running a formula via an API call. Use this method in custom code to get the value back of a formula without a discrete field on a record.
594
+ *
595
+ * @param body - Request body
596
+ * @param body.formula - The formula to run. This must be a valid Quickbase formula.
597
+ * @param body.rid - The record ID to run the formula against. Only necessary for formulas that are run in the context of a record. For example, the formula User() does not need a record ID. (optional)
598
+ * @param body.from - The unique identifier (dbid) of the table.
599
+ *
600
+ * @returns Success
601
+ *
602
+ * @see https://developer.quickbase.com/operation/runFormula
603
+ */
604
+ runFormula(body) {
605
+ return request({
606
+ method: 'POST',
607
+ path: '/formula/run',
608
+ body,
609
+ });
610
+ },
611
+ /**
612
+ * Insert/Update record(s)
613
+ *
614
+ * Insert and/or update record(s) in a table. In this single API call, inserts and updates can be submitted. Update can use the key field on the table, or any other supported unique field. Refer to the [Field types page](../fieldInfo) for more information about how each field type should be formatted. This operation allows for incremental processing of successful records, even when some of the records fail.
615
+ **Note:** This endpoint supports a maximum payload size of 40MB.
616
+ *
617
+ * @param body - Request body
618
+ * @param body.to - The table identifier.
619
+ * @param body.data - Record data array, where each record contains key-value mappings of fields to be defined/updated and their values. (optional)
620
+ * @param body.mergeFieldId - The merge field id. (optional)
621
+ * @param body.fieldsToReturn - Specify an array of field ids that will return data for any updates or added record. Record ID (FID 3) is always returned if any field ID is requested. (optional)
622
+ *
623
+ * @returns Response
624
+ *
625
+ * @see https://developer.quickbase.com/operation/upsert
626
+ */
627
+ upsert(body) {
628
+ const executor = () => {
629
+ return request({
630
+ method: 'POST',
631
+ path: '/records',
632
+ body,
633
+ });
634
+ };
635
+ const paginatedExecutor = (paginationParams) => {
636
+ const bodyRecord = body;
637
+ const paginatedBody = paginationParams.skip !== undefined || paginationParams.nextPageToken || paginationParams.nextToken
638
+ ? {
639
+ ...(bodyRecord || {}),
640
+ options: {
641
+ ...(bodyRecord?.options || {}),
642
+ ...(paginationParams.skip !== undefined ? { skip: paginationParams.skip } : {}),
643
+ },
644
+ ...(paginationParams.nextPageToken ? { nextPageToken: paginationParams.nextPageToken } : {}),
645
+ ...(paginationParams.nextToken ? { nextToken: paginationParams.nextToken } : {}),
646
+ }
647
+ : body;
648
+ return request({
649
+ method: 'POST',
650
+ path: '/records',
651
+ body: paginatedBody,
652
+ });
653
+ };
654
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
655
+ },
656
+ /**
657
+ * Delete record(s)
658
+ *
659
+ * Deletes record(s) in a table based on a query. Alternatively, all records in the table can be deleted.
660
+ *
661
+ * @param body - Request body
662
+ * @param body.from - The unique identifier of the table.
663
+ * @param body.where - The filter to delete records. To delete all records specify a filter that will include all records, for example {3.GT.0} where 3 is the ID of the Record ID field.
664
+ *
665
+ * @returns Successful delete records response.
666
+ *
667
+ * @see https://developer.quickbase.com/operation/deleteRecords
668
+ */
669
+ deleteRecords(body) {
670
+ return request({
671
+ method: 'DELETE',
672
+ path: '/records',
673
+ body,
674
+ });
675
+ },
676
+ /**
677
+ * Query for data
678
+ *
679
+ * Pass in a query in the [Quickbase query language](https://help.quickbase.com/api-guide/componentsquery.html). Returns record data with [intelligent pagination](../pagination) based on the approximate size of each record. The metadata object will include the necessary information to iterate over the response and gather more data.
680
+ *
681
+ * @param body - Request body
682
+ * @param body.options - Additional query options. (optional)
683
+ * @param body.where - The filter, using the Quickbase query language, which determines the records to return. If this parameter is omitted, the query will return all records. (optional)
684
+ * @param body.groupBy - An array that contains the fields to group the records by. (optional)
685
+ * @param body.sortBy - An array of field IDs and sort directions. If this attribute is not set or set to false, queries will be unsorted to improve performance. (optional)
686
+ * @param body.select - An array of field ids for the fields that should be returned in the response. If empty, the default columns on the table will be returned. (optional)
687
+ * @param body.from - The table identifier.
688
+ *
689
+ * @returns Success
690
+ *
691
+ * @see https://developer.quickbase.com/operation/runQuery
692
+ */
693
+ runQuery(body) {
694
+ const executor = () => {
695
+ return request({
696
+ method: 'POST',
697
+ path: '/records/query',
698
+ body,
699
+ });
700
+ };
701
+ const paginatedExecutor = (paginationParams) => {
702
+ const bodyRecord = body;
703
+ const paginatedBody = paginationParams.skip !== undefined || paginationParams.nextPageToken || paginationParams.nextToken
704
+ ? {
705
+ ...(bodyRecord || {}),
706
+ options: {
707
+ ...(bodyRecord?.options || {}),
708
+ ...(paginationParams.skip !== undefined ? { skip: paginationParams.skip } : {}),
709
+ },
710
+ ...(paginationParams.nextPageToken ? { nextPageToken: paginationParams.nextPageToken } : {}),
711
+ ...(paginationParams.nextToken ? { nextToken: paginationParams.nextToken } : {}),
712
+ }
713
+ : body;
714
+ return request({
715
+ method: 'POST',
716
+ path: '/records/query',
717
+ body: paginatedBody,
718
+ });
719
+ };
720
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
721
+ },
722
+ /**
723
+ * Get a temporary token for a dbid
724
+ *
725
+ * Use this endpoint to get a temporary authorization token, scoped to either an app or a table. It can only be used inside of code pages for client-side authentication because it relies on the browser session. Learn more about [extending Quickbase](https://helpv2.quickbase.com/hc/en-us/articles/4570341709844-Extending-Quickbase). You can then use this token to make other API calls (see [authorization](../auth)). This token expires in 5 minutes.
726
+ *
727
+ * @param params.dbid - The unique identifier of an app or table.
728
+ *
729
+ * @returns This token is used in the authorization header value (similar to the QB-USER-TOKEN), except it uses the QB-TEMP-TOKEN prefix header['Authorization'] = 'QB-TEMP-TOKEN {token}'
730
+ *
731
+ * @see https://developer.quickbase.com/operation/getTempTokenDBID
732
+ */
733
+ getTempTokenDBID(params) {
734
+ return request({
735
+ method: 'GET',
736
+ path: `/auth/temporary/${params.dbid}`,
737
+ });
738
+ },
739
+ /**
740
+ * Exchange an SSO token
741
+ *
742
+ * Use this endpoint to exchange a SAML assertion for a Quickbase token following [RFC 8693](https://www.rfc-editor.org/rfc/rfc8693.html). Callers can choose to return a token compatible with SCIM, XML, or RESTful APIs. The token duration is determined by the [SAML timeout session time](https://helpv2.quickbase.com/hc/en-us/articles/4570410646420-SAML-assertion-example#:~:text=Setting%20SAML%20timeout%20session%20time). You must be able to create a SAML assertion in your code to use this endpoint. The SAML assertion is verified against the configuration on the realm. Learn more about about [SAML assertions](https://helpv2.quickbase.com/hc/en-us/articles/4570410646420-SAML-assertion-example).
743
+ *
744
+ * @param body - Request body
745
+ * @param body.grant_type - The value `urn:ietf:params:oauth:grant-type:token-exchange` indicates that a token exchange is being performed.
746
+ * @param body.requested_token_type - An identifier for the type of the requested security token. For the RESTful API, use `urn:quickbase:params:oauth:token-type:temp_token`. For the XML or SCIM APIs use `urn:quickbase:params:oauth:token-type:temp_ticket`.
747
+ * @param body.subject_token - A security token that represents the identity of the party on behalf of whom the request is being made. For SAML 2.0, the value should be a base64url-encoded SAML 2.0 assertion.
748
+ * @param body.subject_token_type - An identifier that indicates the type of the security token in the `subject_token` parameter.
749
+ *
750
+ * @returns Success
751
+ *
752
+ * @see https://developer.quickbase.com/operation/exchangeSsoToken
753
+ */
754
+ exchangeSsoToken(body) {
755
+ return request({
756
+ method: 'POST',
757
+ path: '/auth/oauth/token',
758
+ body,
759
+ });
760
+ },
761
+ /**
762
+ * Clone a user token
763
+ *
764
+ * Clones the authenticated user token. All applications associated with that token are automatically associated with the new token.
765
+ *
766
+ * @param body - Request body
767
+ * @param body.name - The new name for the cloned user token. (optional)
768
+ * @param body.description - The description for the cloned user token. (optional)
769
+ *
770
+ * @returns Response
771
+ *
772
+ * @see https://developer.quickbase.com/operation/cloneUserToken
773
+ */
774
+ cloneUserToken(body) {
775
+ return request({
776
+ method: 'POST',
777
+ path: '/usertoken/clone',
778
+ body,
779
+ });
780
+ },
781
+ /**
782
+ * Transfer a user token
783
+ *
784
+ * Transfers the specified user token. Application associations will remain intact. For security, permissions must manually be reconciled.
785
+ *
786
+ * @param body - Request body
787
+ * @param body.id - The id of the user token to transfer (optional)
788
+ * @param body.from - The id of the user to transfer the user token from (optional)
789
+ * @param body.to - The id of the user to transfer the user token to (optional)
790
+ *
791
+ * @returns Response
792
+ *
793
+ * @see https://developer.quickbase.com/operation/transferUserToken
794
+ */
795
+ transferUserToken(body) {
796
+ return request({
797
+ method: 'POST',
798
+ path: '/usertoken/transfer',
799
+ body,
800
+ });
801
+ },
802
+ /**
803
+ * Deactivate a user token
804
+ *
805
+ * Deactivates the authenticated user token. Once this is done, the user token must be reactivated in the user interface.
806
+ *
807
+ * @returns Response
808
+ *
809
+ * @see https://developer.quickbase.com/operation/deactivateUserToken
810
+ */
811
+ deactivateUserToken() {
812
+ return request({
813
+ method: 'POST',
814
+ path: '/usertoken/deactivate',
815
+ });
816
+ },
817
+ /**
818
+ * Delete a user token
819
+ *
820
+ * Deletes the authenticated user token. This is not reversible.
821
+ *
822
+ * @returns Response
823
+ *
824
+ * @see https://developer.quickbase.com/operation/deleteUserToken
825
+ */
826
+ deleteUserToken() {
827
+ return request({
828
+ method: 'DELETE',
829
+ path: '/usertoken',
830
+ });
831
+ },
832
+ /**
833
+ * Download file
834
+ *
835
+ * Downloads the file attachment, with the file attachment content encoded in base64 format. The API response returns the file name in the `Content-Disposition` header. Meta-data about files can be retrieved from the /records and /reports endpoints, where applicable. Use those endpoints to get the necessary information to fetch files.
836
+ *
837
+ * @param params.tableId - The unique identifier of the table.
838
+ * @param params.recordId - The unique identifier of the record.
839
+ * @param params.fieldId - The unique identifier of the field.
840
+ * @param params.versionNumber - The file attachment version number.
841
+ *
842
+ * @returns Success
843
+ *
844
+ * @see https://developer.quickbase.com/operation/downloadFile
845
+ */
846
+ downloadFile(params) {
847
+ return request({
848
+ method: 'GET',
849
+ path: `/files/${params.tableId}/${params.recordId}/${params.fieldId}/${params.versionNumber}`,
850
+ });
851
+ },
852
+ /**
853
+ * Delete file
854
+ *
855
+ * Deletes one file attachment version. Meta-data about files can be retrieved from the /records and /reports endpoints, where applicable. Use those endpoints to get the necessary information to delete file versions.
856
+ *
857
+ * @param params.tableId - The unique identifier of the table.
858
+ * @param params.recordId - The unique identifier of the record.
859
+ * @param params.fieldId - The unique identifier of the field.
860
+ * @param params.versionNumber - The file attachment version number.
861
+ *
862
+ * @returns Successfully Deleted the File Attachment
863
+ *
864
+ * @see https://developer.quickbase.com/operation/deleteFile
865
+ */
866
+ deleteFile(params) {
867
+ return request({
868
+ method: 'DELETE',
869
+ path: `/files/${params.tableId}/${params.recordId}/${params.fieldId}/${params.versionNumber}`,
870
+ });
871
+ },
872
+ /**
873
+ * Get users
874
+ *
875
+ * Get all users in an account or narrowed down list of users filtered by email(s). The returned users may be paginated depending on the user count. The count of the returned users may vary. When `nextPageToken` value in the response is not empty, that indicates that there are more results to be returned, you can use this value to get the next result set ('page').
876
+ *
877
+ * @param params.accountId - The account id being used to get users. If no value is specified, the first account associated with the requesting user token is chosen. (optional)
878
+ *
879
+ * @param body - Request body (optional)
880
+ * @param body.emails - When provided, the returned users will be narrowed down only to the users included in this list. (optional)
881
+ * @param body.appIds - When provided, the returned users will be narrowed down only to the users assigned to the app id's provided in this list. The provided app id's should belong to the same account. (optional)
882
+ * @param body.nextPageToken - Next page token used to get the next 'page' of results when available. When this field is empty, the first page is returned. (optional)
883
+ *
884
+ * @returns Success
885
+ *
886
+ * @see https://developer.quickbase.com/operation/getUsers
887
+ */
888
+ getUsers(params, body) {
889
+ const executor = () => {
890
+ return request({
891
+ method: 'POST',
892
+ path: '/users',
893
+ query: { accountId: params.accountId },
894
+ body,
895
+ });
896
+ };
897
+ const paginatedExecutor = (paginationParams) => {
898
+ const bodyRecord = body;
899
+ const paginatedBody = paginationParams.skip !== undefined || paginationParams.nextPageToken || paginationParams.nextToken
900
+ ? {
901
+ ...(bodyRecord || {}),
902
+ options: {
903
+ ...(bodyRecord?.options || {}),
904
+ ...(paginationParams.skip !== undefined ? { skip: paginationParams.skip } : {}),
905
+ },
906
+ ...(paginationParams.nextPageToken ? { nextPageToken: paginationParams.nextPageToken } : {}),
907
+ ...(paginationParams.nextToken ? { nextToken: paginationParams.nextToken } : {}),
908
+ }
909
+ : body;
910
+ return request({
911
+ method: 'POST',
912
+ path: '/users',
913
+ query: { accountId: params.accountId },
914
+ body: paginatedBody,
915
+ });
916
+ };
917
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
918
+ },
919
+ /**
920
+ * Deny users
921
+ *
922
+ * Denies users access to the realm but leaves them listed in groups they have been added to.
923
+ *
924
+ * @param params.accountId - The account id being used to deny users. If no value is specified, the first account associated with the requesting user token is chosen. (optional)
925
+ *
926
+ * @param body - Request body
927
+ *
928
+ * @returns Success
929
+ *
930
+ * @see https://developer.quickbase.com/operation/denyUsers
931
+ */
932
+ denyUsers(params, body) {
933
+ return request({
934
+ method: 'PUT',
935
+ path: '/users/deny',
936
+ query: { accountId: params.accountId },
937
+ body,
938
+ });
939
+ },
940
+ /**
941
+ * Deny and remove users from groups
942
+ *
943
+ * Denies users access to the realm and allows you to remove them from groups.
944
+ *
945
+ * @param params.accountId - The account id being used to deny users. If no value is specified, the first account associated with the requesting user token is chosen. (optional)
946
+ * @param params.shouldDeleteFromGroups - Specifies if the users should also be removed from all groups.
947
+ *
948
+ * @param body - Request body
949
+ *
950
+ * @returns Success
951
+ *
952
+ * @see https://developer.quickbase.com/operation/denyUsersAndGroups
953
+ */
954
+ denyUsersAndGroups(params, body) {
955
+ return request({
956
+ method: 'PUT',
957
+ path: `/users/deny/${params.shouldDeleteFromGroups}`,
958
+ query: { accountId: params.accountId },
959
+ body,
960
+ });
961
+ },
962
+ /**
963
+ * Undeny users
964
+ *
965
+ * Grants users that have previously been denied access to the realm.
966
+ *
967
+ * @param params.accountId - The account id being used to undeny users. If no value is specified, the first account associated with the requesting user token is chosen. (optional)
968
+ *
969
+ * @param body - Request body
970
+ *
971
+ * @returns Success
972
+ *
973
+ * @see https://developer.quickbase.com/operation/undenyUsers
974
+ */
975
+ undenyUsers(params, body) {
976
+ return request({
977
+ method: 'PUT',
978
+ path: '/users/undeny',
979
+ query: { accountId: params.accountId },
980
+ body,
981
+ });
982
+ },
983
+ /**
984
+ * Add members
985
+ *
986
+ * Adds a list of users to a given group as members.
987
+ *
988
+ * @param params.gid - This is the ID of the group being modified.
989
+ *
990
+ * @param body - Request body
991
+ *
992
+ * @returns Success
993
+ *
994
+ * @see https://developer.quickbase.com/operation/addMembersToGroup
995
+ */
996
+ addMembersToGroup(params, body) {
997
+ return request({
998
+ method: 'POST',
999
+ path: `/groups/${params.gid}/members`,
1000
+ body,
1001
+ });
1002
+ },
1003
+ /**
1004
+ * Remove members
1005
+ *
1006
+ * Removes a list of members from a given group.
1007
+ *
1008
+ * @param params.gid - This is the ID of the group being modified.
1009
+ *
1010
+ * @param body - Request body
1011
+ *
1012
+ * @returns Success
1013
+ *
1014
+ * @see https://developer.quickbase.com/operation/removeMembersFromGroup
1015
+ */
1016
+ removeMembersFromGroup(params, body) {
1017
+ return request({
1018
+ method: 'DELETE',
1019
+ path: `/groups/${params.gid}/members`,
1020
+ body,
1021
+ });
1022
+ },
1023
+ /**
1024
+ * Add managers
1025
+ *
1026
+ * Adds a list of users to a given group as managers.
1027
+ *
1028
+ * @param params.gid - This is the ID of the group being modified.
1029
+ *
1030
+ * @param body - Request body
1031
+ *
1032
+ * @returns Success
1033
+ *
1034
+ * @see https://developer.quickbase.com/operation/addManagersToGroup
1035
+ */
1036
+ addManagersToGroup(params, body) {
1037
+ return request({
1038
+ method: 'POST',
1039
+ path: `/groups/${params.gid}/managers`,
1040
+ body,
1041
+ });
1042
+ },
1043
+ /**
1044
+ * Remove managers
1045
+ *
1046
+ * Removes a list of managers from a given group.
1047
+ *
1048
+ * @param params.gid - This is the ID of the group being modified.
1049
+ *
1050
+ * @param body - Request body
1051
+ *
1052
+ * @returns Success
1053
+ *
1054
+ * @see https://developer.quickbase.com/operation/removeManagersFromGroup
1055
+ */
1056
+ removeManagersFromGroup(params, body) {
1057
+ return request({
1058
+ method: 'DELETE',
1059
+ path: `/groups/${params.gid}/managers`,
1060
+ body,
1061
+ });
1062
+ },
1063
+ /**
1064
+ * Add child groups
1065
+ *
1066
+ * Adds a list of groups to a given group.
1067
+ *
1068
+ * @param params.gid - This is the ID of the group being modified.
1069
+ *
1070
+ * @param body - Request body
1071
+ *
1072
+ * @returns Success
1073
+ *
1074
+ * @see https://developer.quickbase.com/operation/addSubgroupsToGroup
1075
+ */
1076
+ addSubgroupsToGroup(params, body) {
1077
+ return request({
1078
+ method: 'POST',
1079
+ path: `/groups/${params.gid}/subgroups`,
1080
+ body,
1081
+ });
1082
+ },
1083
+ /**
1084
+ * Remove child groups
1085
+ *
1086
+ * Removes a list of groups from a given group.
1087
+ *
1088
+ * @param params.gid - This is the ID of the group being modified.
1089
+ *
1090
+ * @param body - Request body
1091
+ *
1092
+ * @returns Success
1093
+ *
1094
+ * @see https://developer.quickbase.com/operation/removeSubgroupsFromGroup
1095
+ */
1096
+ removeSubgroupsFromGroup(params, body) {
1097
+ return request({
1098
+ method: 'DELETE',
1099
+ path: `/groups/${params.gid}/subgroups`,
1100
+ body,
1101
+ });
1102
+ },
1103
+ /**
1104
+ * Get audit logs
1105
+ *
1106
+ * Gathers the audit logs for a single day from a realm. By default, this API returns 10,000 entries. This can be changed with the numRows parameter. Integrators can iterate through batches to get an entire day's worth of logs. Each realm has a maximum entitlement of querying 1,000 days per year (allowing lookbacks for up to two years). Requests for paginated data do not count towards the annual limit. Transactional rate limits are 10 per 10 seconds.
1107
+ **Note:** This API is available for enterprise users only.
1108
+ *
1109
+ * @param body - Request body
1110
+ * @param body.nextToken - Token specifying start of page. For first page don't supply this. (optional)
1111
+ * @param body.numRows - Number of logs to return per page, default is 10000, minimum is 1000, max is 50000. (optional)
1112
+ * @param body.queryId - The query id of an audit log request. This id is needed to fetch subsequent paged results of a single query. (optional)
1113
+ * @param body.date - The date for which audit logs need to be fetched. This must be date-time only, as YYYY-MM-DD, and a valid date in the past. (optional)
1114
+ * @param body.topics - An array that may contain up to 20 [topics](https://resources.quickbase.com/nav/app/budurkasx/action/showpage/2b2941e4-f34d-4d41-9b0e-db790d20e9ab?pageIdV2=quickbase.com-DashboardGroup-15760d74-2243-4ce9-9495-7cc8790f12e7) to filter by. If empty, all topics are returned. (optional)
1115
+ *
1116
+ * @returns Query ran successfully and has returned the events for the given time period.
1117
+ *
1118
+ * @see https://developer.quickbase.com/operation/audit
1119
+ */
1120
+ audit(body) {
1121
+ return request({
1122
+ method: 'POST',
1123
+ path: '/audit',
1124
+ body,
1125
+ });
1126
+ },
1127
+ /**
1128
+ * Get read summaries
1129
+ *
1130
+ * Get user read and integration read summaries for any day in the past.
1131
+ **Note:** This API is available for enterprise users only.
1132
+ *
1133
+ * @param params.day - The date for which read summaries need to be fetched. This must be date-time only, as YYYY-MM-DD, and a valid date in the past. (optional)
1134
+ *
1135
+ * @returns Summaries returned succesfully
1136
+ *
1137
+ * @see https://developer.quickbase.com/operation/platformAnalyticReads
1138
+ */
1139
+ platformAnalyticReads(params) {
1140
+ return request({
1141
+ method: 'GET',
1142
+ path: '/analytics/reads',
1143
+ query: { day: params.day },
1144
+ });
1145
+ },
1146
+ /**
1147
+ * Get event summaries
1148
+ *
1149
+ * Get event summaries for any span of days up to one year and excluding future dates.
1150
+ **Note:** This API is available for enterprise users only. Data is updated hourly; to ensure accuracy, query dates should be at least one hour in the past. Transactional rate limits are 100 per hour.
1151
+ *
1152
+ * @param params.accountId - The ID of the account to query. If no value is specified, the first account matching the provided domain is chosen. (optional)
1153
+ *
1154
+ * @param body - Request body (optional)
1155
+ * @param body.start - The start date and time of the requested summaries in ISO 8601 time format.
1156
+ * @param body.end - The end date and time of the requested summaries in ISO 8601 time format.
1157
+ * @param body.groupBy - How the events should be grouped.
1158
+ * @param body.nextToken - A pagination token from a previous response. Used to fetch the next page. (optional)
1159
+ * @param body.where - A list of items to filter events by. Only events which match ALL criteria will be included in the results. (optional)
1160
+ *
1161
+ * @returns Event summaries returned succesfully
1162
+ *
1163
+ * @see https://developer.quickbase.com/operation/platformAnalyticEventSummaries
1164
+ */
1165
+ platformAnalyticEventSummaries(params, body) {
1166
+ const executor = () => {
1167
+ return request({
1168
+ method: 'POST',
1169
+ path: '/analytics/events/summaries',
1170
+ query: { accountId: params.accountId },
1171
+ body,
1172
+ });
1173
+ };
1174
+ const paginatedExecutor = (paginationParams) => {
1175
+ const bodyRecord = body;
1176
+ const paginatedBody = paginationParams.skip !== undefined || paginationParams.nextPageToken || paginationParams.nextToken
1177
+ ? {
1178
+ ...(bodyRecord || {}),
1179
+ options: {
1180
+ ...(bodyRecord?.options || {}),
1181
+ ...(paginationParams.skip !== undefined ? { skip: paginationParams.skip } : {}),
1182
+ },
1183
+ ...(paginationParams.nextPageToken ? { nextPageToken: paginationParams.nextPageToken } : {}),
1184
+ ...(paginationParams.nextToken ? { nextToken: paginationParams.nextToken } : {}),
1185
+ }
1186
+ : body;
1187
+ return request({
1188
+ method: 'POST',
1189
+ path: '/analytics/events/summaries',
1190
+ query: { accountId: params.accountId },
1191
+ body: paginatedBody,
1192
+ });
1193
+ };
1194
+ return createPaginatedRequest(executor, { paginatedExecutor, autoPaginate });
1195
+ },
1196
+ /**
1197
+ * Export a solution
1198
+ *
1199
+ * Returns the QBL for the specified solution. Learn more about [QBL syntax](https://help.quickbase.com/hc/en-us/articles/24845511223828-What-is-QBL).
1200
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1201
+ *
1202
+ * @param params.solutionId - The unique identifier of a solution
1203
+ *
1204
+ * @returns Success
1205
+ *
1206
+ * @see https://developer.quickbase.com/operation/exportSolution
1207
+ */
1208
+ exportSolution(params) {
1209
+ return request({
1210
+ method: 'GET',
1211
+ path: `/solutions/${params.solutionId}`,
1212
+ });
1213
+ },
1214
+ /**
1215
+ * Update a solution
1216
+ *
1217
+ * Updates the solution using the provided QBL. Learn more about [QBL syntax](https://help.quickbase.com/hc/en-us/articles/24845511223828-What-is-QBL).
1218
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1219
+ *
1220
+ * @param params.solutionId - The unique identifier of a solution
1221
+ *
1222
+ * @param body - The QBL to be used for the update. (optional)
1223
+ *
1224
+ * @returns Success
1225
+ *
1226
+ * @see https://developer.quickbase.com/operation/updateSolution
1227
+ */
1228
+ updateSolution(params, body) {
1229
+ return request({
1230
+ method: 'PUT',
1231
+ path: `/solutions/${params.solutionId}`,
1232
+ body,
1233
+ });
1234
+ },
1235
+ /**
1236
+ * Create a solution
1237
+ *
1238
+ * Creates a solution using the provided QBL. Learn more about [QBL syntax](https://help.quickbase.com/hc/en-us/articles/24845511223828-What-is-QBL).
1239
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1240
+ *
1241
+ * @param body - The QBL to be used for the create.
1242
+ *
1243
+ * @returns Success
1244
+ *
1245
+ * @see https://developer.quickbase.com/operation/createSolution
1246
+ */
1247
+ createSolution(body) {
1248
+ return request({
1249
+ method: 'POST',
1250
+ path: '/solutions',
1251
+ body,
1252
+ });
1253
+ },
1254
+ /**
1255
+ * Export solution to record
1256
+ *
1257
+ * Exports the solution and outputs the resulting QBL in a new record in the specified table. The QBL will be saved to a file in the file attachment field that is specified. The table cannot have any required fields besides the file attachment field.
1258
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1259
+ *
1260
+ * @param params.solutionId - The unique identifier of the solution.
1261
+ * @param params.tableId - The unique identifier (dbid) of the table.
1262
+ * @param params.fieldId - The unique identifier (fid) of the field. It needs to be a file attachment field.
1263
+ *
1264
+ * @returns Success
1265
+ *
1266
+ * @see https://developer.quickbase.com/operation/exportSolutionToRecord
1267
+ */
1268
+ exportSolutionToRecord(params) {
1269
+ return request({
1270
+ method: 'GET',
1271
+ path: `/solutions/${params.solutionId}/torecord`,
1272
+ query: { tableId: params.tableId, fieldId: params.fieldId },
1273
+ });
1274
+ },
1275
+ /**
1276
+ * Create solution from record
1277
+ *
1278
+ * Creates a solution using the QBL from the specified record.
1279
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1280
+ *
1281
+ * @param params.tableId - The unique identifier (dbid) of the table.
1282
+ * @param params.fieldId - The unique identifier (fid) of the field. It needs to be a file attachment field.
1283
+ * @param params.recordId - The unique identifier of the record.
1284
+ *
1285
+ * @returns Success
1286
+ *
1287
+ * @see https://developer.quickbase.com/operation/createSolutionFromRecord
1288
+ */
1289
+ createSolutionFromRecord(params) {
1290
+ return request({
1291
+ method: 'GET',
1292
+ path: '/solutions/fromrecord',
1293
+ query: { tableId: params.tableId, fieldId: params.fieldId, recordId: params.recordId },
1294
+ });
1295
+ },
1296
+ /**
1297
+ * Update solution from record
1298
+ *
1299
+ * Updates a solution using the QBL from the specified record.
1300
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1301
+ *
1302
+ * @param params.solutionId - The unique identifier of the solution.
1303
+ * @param params.tableId - The unique identifier (dbid) of the table.
1304
+ * @param params.fieldId - The unique identifier (fid) of the field. It needs to be a file attachment field.
1305
+ * @param params.recordId - The unique identifier of the record.
1306
+ *
1307
+ * @returns Success
1308
+ *
1309
+ * @see https://developer.quickbase.com/operation/updateSolutionToRecord
1310
+ */
1311
+ updateSolutionToRecord(params) {
1312
+ return request({
1313
+ method: 'GET',
1314
+ path: `/solutions/${params.solutionId}/fromrecord`,
1315
+ query: { tableId: params.tableId, fieldId: params.fieldId, recordId: params.recordId },
1316
+ });
1317
+ },
1318
+ /**
1319
+ * List solution changes
1320
+ *
1321
+ * Returns a list of changes that would occur if the provided QBL were to be applied. Learn more about [QBL syntax](https://help.quickbase.com/hc/en-us/articles/24845511223828-What-is-QBL).
1322
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1323
+ *
1324
+ * @param params.solutionId - The unique identifier of the solution.
1325
+ *
1326
+ * @param body - The QBL to be used for the changeset.
1327
+ *
1328
+ * @returns Success
1329
+ *
1330
+ * @see https://developer.quickbase.com/operation/changesetSolution
1331
+ */
1332
+ changesetSolution(params, body) {
1333
+ return request({
1334
+ method: 'PUT',
1335
+ path: `/solutions/${params.solutionId}/changeset`,
1336
+ body,
1337
+ });
1338
+ },
1339
+ /**
1340
+ * List solution changes from record
1341
+ *
1342
+ * Returns a list of changes that would occur if the QBL from the provided record were to be applied.
1343
+ We are releasing schema coverage for QBL in stages. See [what's supported today](https://helpv2.quickbase.com/hc/en-us/articles/30119680754068-QBL-version-0-4-overview) in our QBL documentation.
1344
+ *
1345
+ * @param params.solutionId - The unique identifier of the solution.
1346
+ * @param params.tableId - The unique identifier (dbid) of the table.
1347
+ * @param params.fieldId - The unique identifier (fid) of the field. It needs to be a file attachment field.
1348
+ * @param params.recordId - The unique identifier of the record.
1349
+ *
1350
+ * @returns Success
1351
+ *
1352
+ * @see https://developer.quickbase.com/operation/changesetSolutionFromRecord
1353
+ */
1354
+ changesetSolutionFromRecord(params) {
1355
+ return request({
1356
+ method: 'GET',
1357
+ path: `/solutions/${params.solutionId}/changeset/fromrecord`,
1358
+ query: { tableId: params.tableId, fieldId: params.fieldId, recordId: params.recordId },
1359
+ });
1360
+ },
1361
+ /**
1362
+ * Generate a document
1363
+ *
1364
+ * Generates a document from a template. This feature is only available on business or enterprise plans.
1365
+ *
1366
+ * @param params.templateId - This is the ID of document template.
1367
+ * @param params.tableId - The unique identifier of the table.
1368
+ * @param params.recordId - The ID of the record (optional)
1369
+ * @param params.filename - File name for the downloaded file
1370
+ * @param params.format - The format of the file that is returned. Default is "pdf". (optional)
1371
+ * @param params.margin - Margin formatted as top right bottom left, separated by spaces. Add to override the value set in the template builder. (optional)
1372
+ * @param params.unit - Unit of measurement for the margin. Default is "in". Add to override the value set in the template builder. (optional)
1373
+ * @param params.pageSize - Page size. Default is "A4". Add to override the value set in the template builder. (optional)
1374
+ * @param params.orientation - Page orientation. Default is "portrait". Add to override the value set in the template builder. (optional)
1375
+ * @param params.realm - Your Quickbase domain, for example demo.quickbase.com (optional)
1376
+ *
1377
+ * @returns Success
1378
+ *
1379
+ * @see https://developer.quickbase.com/operation/generateDocument
1380
+ */
1381
+ generateDocument(params) {
1382
+ return request({
1383
+ method: 'GET',
1384
+ path: `/docTemplates/${params.templateId}/generate`,
1385
+ query: { tableId: params.tableId, recordId: params.recordId, filename: params.filename, format: params.format, margin: params.margin, unit: params.unit, pageSize: params.pageSize, orientation: params.orientation, realm: params.realm },
1386
+ });
1387
+ },
1388
+ };
1389
+ }
1390
+ //# sourceMappingURL=client.js.map