quickbase-js 1.1.0-beta.3 → 1.1.0-beta.4

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 (46) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +61 -5
  3. package/dist/quickbase.d.ts +1108 -349
  4. package/dist/quickbase.js +828 -263
  5. package/dist/quickbase.js.map +1 -1
  6. package/examples/react.js +12 -12
  7. package/examples/vanillajs.html +12 -12
  8. package/log-gen.yaml +4622 -759
  9. package/package.json +12 -14
  10. package/playwright-results.txt/.last-run.json +4 -0
  11. package/playwright.config.ts +1 -1
  12. package/src/code-generation/definitions/apps.ts +274 -0
  13. package/src/code-generation/definitions/auth.ts +10 -0
  14. package/src/code-generation/definitions/fields.ts +751 -0
  15. package/src/code-generation/definitions/index.ts +18 -0
  16. package/src/code-generation/definitions/records.ts +269 -0
  17. package/src/code-generation/definitions/relationships.ts +90 -0
  18. package/src/code-generation/definitions/reports.ts +10 -0
  19. package/src/code-generation/definitions/tables.ts +112 -0
  20. package/src/code-generation/fix-spec-main.ts +2 -2
  21. package/src/code-generation/output/quickbase-fixed.json +3244 -4586
  22. package/src/code-generation/paths/apps.ts +100 -0
  23. package/src/code-generation/paths/auth.ts +25 -0
  24. package/src/code-generation/paths/fields.ts +207 -0
  25. package/src/code-generation/paths/index.ts +17 -0
  26. package/src/code-generation/paths/records.ts +68 -0
  27. package/src/code-generation/paths/relationships.ts +32 -0
  28. package/src/code-generation/paths/reports.ts +34 -0
  29. package/src/code-generation/paths/tables.ts +162 -0
  30. package/src/generated-unified/QuickbaseClient.ts +7 -6
  31. package/src/log-gen.ts +8 -6
  32. package/tests/vitest/qb/fields/createField.test.ts +78 -0
  33. package/tests/vitest/qb/fields/deleteFields.test.ts +89 -0
  34. package/tests/vitest/qb/fields/getField.test.ts +85 -0
  35. package/tests/vitest/qb/fields/getFieldUsage.test.ts +174 -0
  36. package/tests/vitest/qb/fields/getFieldsUsage.test.ts +77 -0
  37. package/tests/vitest/qb/index.ts +25 -1
  38. package/tests/vitest/unit/fields/createField.test.ts +391 -0
  39. package/tests/vitest/unit/fields/deleteFields.test.ts +141 -0
  40. package/tests/vitest/unit/fields/getField.test.ts +189 -0
  41. package/tests/vitest/unit/fields/getFieldUsage.test.ts +147 -0
  42. package/tests/vitest/unit/fields/getFieldsUsage.test.ts +160 -0
  43. package/tests/vitest/unit/index.ts +30 -1
  44. package/src/code-generation/fix-spec-definitions.ts +0 -809
  45. package/src/code-generation/fix-spec-paths.ts +0 -439
  46. package/test-artifacts/test-results.json +0 -829
@@ -0,0 +1,100 @@
1
+ // src/code-generation/paths/apps.ts
2
+ export const appsPaths = {
3
+ "/apps": {
4
+ post: {
5
+ operationId: "createApp",
6
+ summary: "Create a new application",
7
+ tags: ["Apps"],
8
+ parameters: [
9
+ {
10
+ name: "body",
11
+ in: "body",
12
+ required: true,
13
+ schema: { $ref: "#/definitions/CreateAppRequest" },
14
+ },
15
+ ],
16
+ responses: {
17
+ 200: {
18
+ description: "Success - application created",
19
+ schema: { $ref: "#/definitions/CreateApp200Response" },
20
+ },
21
+ },
22
+ },
23
+ },
24
+ "/apps/{appId}": {
25
+ get: {
26
+ operationId: "getApp",
27
+ summary: "Get an app by ID",
28
+ tags: ["Apps"],
29
+ parameters: [
30
+ {
31
+ name: "appId",
32
+ in: "path",
33
+ required: true,
34
+ type: "string",
35
+ description: "The application identifier.",
36
+ },
37
+ ],
38
+ responses: {
39
+ 200: {
40
+ description: "Success",
41
+ schema: { $ref: "#/definitions/App" },
42
+ },
43
+ },
44
+ },
45
+ delete: {
46
+ operationId: "deleteApp",
47
+ summary: "Delete an application by ID",
48
+ tags: ["Apps"],
49
+ parameters: [
50
+ {
51
+ name: "appId",
52
+ in: "path",
53
+ required: true,
54
+ type: "string",
55
+ description: "The unique identifier of the app to delete.",
56
+ },
57
+ {
58
+ name: "body",
59
+ in: "body",
60
+ required: true,
61
+ schema: { $ref: "#/definitions/DeleteAppRequest" },
62
+ },
63
+ ],
64
+ responses: {
65
+ 200: {
66
+ description: "Success - application deleted",
67
+ schema: { $ref: "#/definitions/DeleteApp200Response" },
68
+ },
69
+ },
70
+ },
71
+ },
72
+ "/apps/{appId}/copy": {
73
+ post: {
74
+ operationId: "copyApp",
75
+ summary: "Copy an existing application",
76
+ tags: ["Apps"],
77
+ parameters: [
78
+ {
79
+ name: "appId",
80
+ in: "path",
81
+ required: true,
82
+ type: "string",
83
+ description: "The unique identifier of the app to copy.",
84
+ },
85
+ {
86
+ name: "body",
87
+ in: "body",
88
+ required: true,
89
+ schema: { $ref: "#/definitions/CopyAppRequest" },
90
+ },
91
+ ],
92
+ responses: {
93
+ 200: {
94
+ description: "Success - application copied",
95
+ schema: { $ref: "#/definitions/CopyApp200Response" },
96
+ },
97
+ },
98
+ },
99
+ },
100
+ };
@@ -0,0 +1,25 @@
1
+ // src/code-generation/paths/auth.ts
2
+ export const authPaths = {
3
+ "/auth/temporary/{dbid}": {
4
+ get: {
5
+ operationId: "getTempTokenDBID",
6
+ summary: "Get a temporary authorization token for a specific dbid",
7
+ tags: ["Auth"],
8
+ parameters: [
9
+ {
10
+ name: "dbid",
11
+ in: "path",
12
+ required: true,
13
+ type: "string",
14
+ description: "The database identifier (dbid).",
15
+ },
16
+ ],
17
+ responses: {
18
+ 200: {
19
+ description: "Success",
20
+ schema: { $ref: "#/definitions/GetTempTokenDBID200Response" },
21
+ },
22
+ },
23
+ },
24
+ },
25
+ };
@@ -0,0 +1,207 @@
1
+ // src/code-generation/paths/fields.ts
2
+ export const fieldsPaths = {
3
+ "/fields": {
4
+ get: {
5
+ operationId: "getFields",
6
+ summary: "Get all fields for a table",
7
+ tags: ["Fields"],
8
+ parameters: [
9
+ {
10
+ name: "tableId",
11
+ in: "query",
12
+ required: true,
13
+ type: "string",
14
+ description: "The table identifier (dbid).",
15
+ },
16
+ {
17
+ name: "includeFieldPerms",
18
+ in: "query",
19
+ required: false,
20
+ type: "boolean",
21
+ description: "Whether to include field permissions.",
22
+ },
23
+ ],
24
+ responses: {
25
+ 200: {
26
+ description: "Success",
27
+ schema: {
28
+ type: "array",
29
+ items: { $ref: "#/definitions/Field" },
30
+ },
31
+ },
32
+ },
33
+ },
34
+ post: {
35
+ operationId: "createField",
36
+ summary: "Create a new field in a table",
37
+ tags: ["Fields"],
38
+ parameters: [
39
+ {
40
+ name: "tableId",
41
+ in: "query",
42
+ required: true,
43
+ type: "string",
44
+ description: "The unique identifier of the table.",
45
+ },
46
+ {
47
+ name: "body",
48
+ in: "body",
49
+ required: true,
50
+ schema: { $ref: "#/definitions/CreateFieldRequest" },
51
+ },
52
+ ],
53
+ responses: {
54
+ 200: {
55
+ description: "Success - field created",
56
+ schema: { $ref: "#/definitions/CreateField200Response" },
57
+ },
58
+ },
59
+ },
60
+ delete: {
61
+ operationId: "deleteFields",
62
+ summary: "Delete fields from a table",
63
+ tags: ["Fields"],
64
+ parameters: [
65
+ {
66
+ name: "tableId",
67
+ in: "query",
68
+ required: true,
69
+ type: "string",
70
+ description: "The unique identifier of the table.",
71
+ },
72
+ {
73
+ name: "body",
74
+ in: "body",
75
+ required: true,
76
+ schema: { $ref: "#/definitions/DeleteFieldsRequest" },
77
+ },
78
+ ],
79
+ responses: {
80
+ 200: {
81
+ description: "Success - fields deleted, with possible errors",
82
+ schema: { $ref: "#/definitions/DeleteFields200Response" },
83
+ },
84
+ },
85
+ },
86
+ },
87
+ "/fields/{fieldId}": {
88
+ get: {
89
+ operationId: "getField",
90
+ summary: "Get the properties of an individual field by ID",
91
+ tags: ["Fields"],
92
+ parameters: [
93
+ {
94
+ name: "fieldId",
95
+ in: "path",
96
+ required: true,
97
+ type: "integer",
98
+ description: "The unique identifier (fid) of the field.",
99
+ },
100
+ {
101
+ name: "tableId",
102
+ in: "query",
103
+ required: true,
104
+ type: "string",
105
+ description: "The unique identifier (dbid) of the table.",
106
+ },
107
+ {
108
+ name: "includeFieldPerms",
109
+ in: "query",
110
+ required: false,
111
+ type: "boolean",
112
+ description:
113
+ "Set to 'true' to include custom permissions for the field.",
114
+ },
115
+ ],
116
+ responses: {
117
+ 200: {
118
+ description: "Success - field properties retrieved",
119
+ schema: { $ref: "#/definitions/Field" },
120
+ },
121
+ },
122
+ },
123
+ },
124
+ "/fields/usage": {
125
+ get: {
126
+ operationId: "getFieldsUsage",
127
+ summary: "Get usage statistics for all fields in a table",
128
+ tags: ["Fields"],
129
+ parameters: [
130
+ {
131
+ name: "tableId",
132
+ in: "query",
133
+ required: true,
134
+ type: "string",
135
+ description: "The unique identifier (dbid) of the table.",
136
+ },
137
+ {
138
+ name: "skip",
139
+ in: "query",
140
+ required: false,
141
+ type: "integer",
142
+ description: "The number of fields to skip from the list.",
143
+ },
144
+ {
145
+ name: "top",
146
+ in: "query",
147
+ required: false,
148
+ type: "integer",
149
+ description: "The maximum number of fields to return.",
150
+ },
151
+ ],
152
+ responses: {
153
+ 200: {
154
+ description: "Success - field usage statistics retrieved",
155
+ schema: {
156
+ type: "array",
157
+ items: { $ref: "#/definitions/FieldUsage" },
158
+ },
159
+ },
160
+ },
161
+ },
162
+ },
163
+ "/fields/usage/{fieldId}": {
164
+ get: {
165
+ operationId: "getFieldUsage",
166
+ summary: "Get usage statistics for a single field",
167
+ description:
168
+ "Retrieve usage statistics for a specific field, summarizing where it is referenced across QuickBase features such as reports, forms, and pipelines.",
169
+ tags: ["Fields"],
170
+ parameters: [
171
+ {
172
+ name: "fieldId",
173
+ in: "path",
174
+ required: true,
175
+ type: "integer",
176
+ description: "The unique identifier (fid) of the field.",
177
+ },
178
+ {
179
+ name: "tableId",
180
+ in: "query",
181
+ required: true,
182
+ type: "string",
183
+ description:
184
+ "The unique identifier (dbid) of the table containing the field.",
185
+ },
186
+ {
187
+ name: "User-Agent",
188
+ in: "header",
189
+ required: false,
190
+ type: "string",
191
+ description:
192
+ "Identifies the client making the request. Can be custom or default from your toolkit.",
193
+ },
194
+ ],
195
+ responses: {
196
+ 200: {
197
+ description: "Success - field usage statistics retrieved",
198
+ schema: {
199
+ type: "array",
200
+ items: { $ref: "#/definitions/FieldUsage" },
201
+ maxItems: 1, // Ensures a single-item array as per QuickBase API behavior
202
+ },
203
+ },
204
+ },
205
+ },
206
+ },
207
+ };
@@ -0,0 +1,17 @@
1
+ import { appsPaths } from "./apps.ts";
2
+ import { authPaths } from "./auth.ts";
3
+ import { fieldsPaths } from "./fields.ts";
4
+ import { recordsPaths } from "./records.ts";
5
+ import { relationshipsPaths } from "./relationships.ts";
6
+ import { reportsPaths } from "./reports.ts";
7
+ import { tablesPaths } from "./tables.ts";
8
+
9
+ export const paths = {
10
+ ...appsPaths,
11
+ ...authPaths,
12
+ ...fieldsPaths,
13
+ ...recordsPaths,
14
+ ...relationshipsPaths,
15
+ ...reportsPaths,
16
+ ...tablesPaths,
17
+ };
@@ -0,0 +1,68 @@
1
+ // src/code-generation/paths/records.ts
2
+ export const recordsPaths = {
3
+ "/records": {
4
+ post: {
5
+ operationId: "upsert",
6
+ summary: "Upsert records in a table",
7
+ tags: ["Records"],
8
+ parameters: [
9
+ {
10
+ name: "body",
11
+ in: "body",
12
+ required: true,
13
+ schema: { $ref: "#/definitions/UpsertRequest" },
14
+ },
15
+ ],
16
+ responses: {
17
+ 200: {
18
+ description: "Success - all records processed successfully",
19
+ schema: { $ref: "#/definitions/Upsert200Response" },
20
+ },
21
+ 207: {
22
+ description: "Multi-Status - partial success with some errors",
23
+ schema: { $ref: "#/definitions/Upsert207Response" },
24
+ },
25
+ },
26
+ },
27
+ delete: {
28
+ operationId: "deleteRecords",
29
+ summary: "Delete records in a table",
30
+ tags: ["Records"],
31
+ parameters: [
32
+ {
33
+ name: "body",
34
+ in: "body",
35
+ required: true,
36
+ schema: { $ref: "#/definitions/DeleteRecordsRequest" },
37
+ },
38
+ ],
39
+ responses: {
40
+ 200: {
41
+ description: "Success - records deleted",
42
+ schema: { $ref: "#/definitions/DeleteRecords200Response" },
43
+ },
44
+ },
45
+ },
46
+ },
47
+ "/records/query": {
48
+ post: {
49
+ operationId: "runQuery",
50
+ summary: "Query records in a table",
51
+ tags: ["Records"],
52
+ parameters: [
53
+ {
54
+ name: "body",
55
+ in: "body",
56
+ required: true,
57
+ schema: { $ref: "#/definitions/RunQueryRequest" },
58
+ },
59
+ ],
60
+ responses: {
61
+ 200: {
62
+ description: "Success - records returned",
63
+ schema: { $ref: "#/definitions/RunQueryResponse" },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ };
@@ -0,0 +1,32 @@
1
+ // src/code-generation/paths/relationships.ts
2
+ export const relationshipsPaths = {
3
+ "/tables/{tableId}/relationships": {
4
+ get: {
5
+ operationId: "getRelationships",
6
+ summary: "Get relationships for a table",
7
+ tags: ["Relationships"],
8
+ parameters: [
9
+ {
10
+ name: "tableId",
11
+ in: "path",
12
+ required: true,
13
+ type: "string",
14
+ description: "The unique identifier (dbid) of the child table.",
15
+ },
16
+ {
17
+ name: "skip",
18
+ in: "query",
19
+ required: false,
20
+ type: "integer",
21
+ description: "The number of relationships to skip.",
22
+ },
23
+ ],
24
+ responses: {
25
+ 200: {
26
+ description: "Success - relationships retrieved",
27
+ schema: { $ref: "#/definitions/GetRelationships200Response" },
28
+ },
29
+ },
30
+ },
31
+ },
32
+ };
@@ -0,0 +1,34 @@
1
+ // src/code-generation/paths/reports.ts
2
+ export const reportsPaths = {
3
+ "/reports/{reportId}/run": {
4
+ post: {
5
+ operationId: "runReport",
6
+ summary: "Run a report",
7
+ tags: ["Reports"],
8
+ parameters: [
9
+ {
10
+ name: "reportId",
11
+ in: "path",
12
+ required: true,
13
+ type: "string",
14
+ description: "The report identifier.",
15
+ },
16
+ {
17
+ name: "generated",
18
+ in: "body",
19
+ required: true,
20
+ schema: { type: "object" },
21
+ },
22
+ ],
23
+ responses: {
24
+ 200: {
25
+ description: "Success",
26
+ schema: {
27
+ type: "array",
28
+ items: { $ref: "#/definitions/ReportRunResponse" },
29
+ },
30
+ },
31
+ },
32
+ },
33
+ },
34
+ };
@@ -0,0 +1,162 @@
1
+ // src/code-generation/paths/tables.ts
2
+ export const tablesPaths = {
3
+ "/tables": {
4
+ get: {
5
+ operationId: "getAppTables",
6
+ summary: "Get all tables for an app",
7
+ tags: ["Tables"],
8
+ parameters: [
9
+ {
10
+ name: "appId",
11
+ in: "query",
12
+ required: true,
13
+ type: "string",
14
+ description: "The application identifier.",
15
+ },
16
+ ],
17
+ responses: {
18
+ 200: {
19
+ description: "Success",
20
+ schema: {
21
+ type: "array",
22
+ items: { $ref: "#/definitions/Table" },
23
+ },
24
+ },
25
+ },
26
+ },
27
+ post: {
28
+ operationId: "createTable",
29
+ summary: "Create a new table in an app",
30
+ tags: ["Tables"],
31
+ parameters: [
32
+ {
33
+ name: "appId",
34
+ in: "query",
35
+ required: true,
36
+ type: "string",
37
+ description:
38
+ "The unique identifier of the app where the table will be created.",
39
+ },
40
+ {
41
+ name: "body",
42
+ in: "body",
43
+ required: true,
44
+ schema: {
45
+ type: "object",
46
+ properties: {
47
+ name: { type: "string", description: "The name of the table." },
48
+ description: {
49
+ type: "string",
50
+ description: "The description of the table.",
51
+ },
52
+ singleRecordName: {
53
+ type: "string",
54
+ description: "Singular noun for records.",
55
+ },
56
+ pluralRecordName: {
57
+ type: "string",
58
+ description: "Plural noun for records.",
59
+ },
60
+ },
61
+ required: ["name"],
62
+ },
63
+ },
64
+ ],
65
+ responses: {
66
+ 200: {
67
+ description: "Success - table created",
68
+ schema: { $ref: "#/definitions/Table" },
69
+ },
70
+ },
71
+ },
72
+ },
73
+ "/tables/{tableId}": {
74
+ get: {
75
+ operationId: "getTable",
76
+ summary: "Get a table by ID",
77
+ tags: ["Tables"],
78
+ parameters: [
79
+ {
80
+ name: "tableId",
81
+ in: "path",
82
+ required: true,
83
+ type: "string",
84
+ description: "The table identifier (dbid).",
85
+ },
86
+ {
87
+ name: "appId",
88
+ in: "query",
89
+ required: true,
90
+ type: "string",
91
+ description: "The unique identifier of the app containing the table.",
92
+ },
93
+ ],
94
+ responses: {
95
+ 200: {
96
+ description: "Success - table retrieved",
97
+ schema: { $ref: "#/definitions/Table" },
98
+ },
99
+ },
100
+ },
101
+ post: {
102
+ operationId: "updateTable",
103
+ summary: "Update a table by ID",
104
+ tags: ["Tables"],
105
+ parameters: [
106
+ {
107
+ name: "tableId",
108
+ in: "path",
109
+ required: true,
110
+ type: "string",
111
+ description: "The table identifier (dbid).",
112
+ },
113
+ {
114
+ name: "appId",
115
+ in: "query",
116
+ required: true,
117
+ type: "string",
118
+ description: "The unique identifier of the app containing the table.",
119
+ },
120
+ {
121
+ name: "body",
122
+ in: "body",
123
+ required: true,
124
+ schema: { $ref: "#/definitions/UpdateTableRequest" },
125
+ },
126
+ ],
127
+ responses: {
128
+ 200: {
129
+ description: "Success - table updated",
130
+ schema: { $ref: "#/definitions/Table" },
131
+ },
132
+ },
133
+ },
134
+ delete: {
135
+ operationId: "deleteTable",
136
+ summary: "Delete a table by ID",
137
+ tags: ["Tables"],
138
+ parameters: [
139
+ {
140
+ name: "tableId",
141
+ in: "path",
142
+ required: true,
143
+ type: "string",
144
+ description: "The table identifier (dbid).",
145
+ },
146
+ {
147
+ name: "appId",
148
+ in: "query",
149
+ required: true,
150
+ type: "string",
151
+ description: "The unique identifier of the app containing the table.",
152
+ },
153
+ ],
154
+ responses: {
155
+ 200: {
156
+ description: "Success - table deleted",
157
+ schema: { $ref: "#/definitions/DeleteTableResponse" },
158
+ },
159
+ },
160
+ },
161
+ },
162
+ };
@@ -1,5 +1,5 @@
1
- // Generated on 2025-03-11T21:50:08.483Z
2
- import { App, CopyApp200Response, CopyAppRequest, CreateApp200Response, CreateAppRequest, DeleteApp200Response, DeleteAppRequest, DeleteRecords200Response, DeleteRecordsRequest, DeleteTableResponse, Field, GetRelationships200Response, GetTempTokenDBID200Response, ReportRunResponse, RunQueryRequest, RunQueryResponse, Table, UpdateTableRequest, Upsert200Response, Upsert207Response, UpsertRequest } from "../generated/models";
1
+ // Generated on 2025-03-12T04:58:24.127Z
2
+ import { App, CopyApp200Response, CopyAppRequest, CreateApp200Response, CreateAppRequest, CreateField200Response, CreateFieldRequest, DeleteApp200Response, DeleteAppRequest, DeleteFields200Response, DeleteFieldsRequest, DeleteRecords200Response, DeleteRecordsRequest, DeleteTableResponse, Field, FieldUsage, GetRelationships200Response, GetTempTokenDBID200Response, ReportRunResponse, RunQueryRequest, RunQueryResponse, Table, UpdateTableRequest, Upsert200Response, Upsert207Response, UpsertRequest } from "../generated/models";
3
3
 
4
4
  export interface QuickbaseClient {
5
5
  createApp: (params: { body: CreateAppRequest }) => Promise<CreateApp200Response>;
@@ -20,10 +20,11 @@ export interface QuickbaseClient {
20
20
  getReport: (params: { tableId: string; reportId: string }) => Promise<{ [key: string]: any }>;
21
21
  runReport: (params: { reportId: string; generated: any }) => Promise<ReportRunResponse[]>;
22
22
  getFields: (params: { tableId: string; includeFieldPerms?: boolean }) => Promise<Field[]>;
23
- getField: (params: { tableId: string; includeFieldPerms?: boolean; fieldId: number }) => Promise<{ [key: string]: any }>;
24
- updateField: (params: { tableId: string; fieldId: number; generated?: any }) => Promise<{ [key: string]: any }>;
25
- getFieldsUsage: (params: { tableId: string; skip?: number; top?: number }) => Promise<any[]>;
26
- getFieldUsage: (params: { tableId: string; fieldId: number }) => Promise<any[]>;
23
+ createField: (params: { tableId: string; body: CreateFieldRequest }) => Promise<CreateField200Response>;
24
+ deleteFields: (params: { tableId: string; body: DeleteFieldsRequest }) => Promise<DeleteFields200Response>;
25
+ getField: (params: { fieldId: number; tableId: string; includeFieldPerms?: boolean }) => Promise<Field>;
26
+ getFieldsUsage: (params: { tableId: string; skip?: number; top?: number }) => Promise<FieldUsage[]>;
27
+ getFieldUsage: (params: { fieldId: number; tableId: string }) => Promise<FieldUsage[]>;
27
28
  runFormula: (params: { generated?: any }) => Promise<{ [key: string]: any }>;
28
29
  upsert: (params: { body: UpsertRequest }) => Promise<Upsert200Response | Upsert207Response>;
29
30
  deleteRecords: (params: { body: DeleteRecordsRequest }) => Promise<DeleteRecords200Response>;