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

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 (69) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +115 -5
  3. package/build.js +175 -55
  4. package/dist/{quickbase.d.ts → esm/quickbase.d.ts} +1108 -349
  5. package/dist/{quickbase.js → esm/quickbase.js} +828 -263
  6. package/dist/esm/quickbase.js.map +1 -0
  7. package/dist/esm/quickbase.min.js +2 -0
  8. package/dist/esm/quickbase.min.js.map +1 -0
  9. package/dist/umd/quickbase.umd.d.ts +5341 -0
  10. package/dist/umd/quickbase.umd.js +7696 -0
  11. package/dist/umd/quickbase.umd.js.map +1 -0
  12. package/dist/umd/quickbase.umd.min.js +2 -0
  13. package/dist/umd/quickbase.umd.min.js.map +1 -0
  14. package/examples/react.js +12 -12
  15. package/examples/vanillajs.html +12 -12
  16. package/log-gen.yaml +536 -1915
  17. package/open-api/definitions/apps.ts +274 -0
  18. package/open-api/definitions/auth.ts +10 -0
  19. package/open-api/definitions/fields.ts +751 -0
  20. package/open-api/definitions/index.ts +18 -0
  21. package/open-api/definitions/records.ts +269 -0
  22. package/open-api/definitions/relationships.ts +90 -0
  23. package/open-api/definitions/reports.ts +10 -0
  24. package/open-api/definitions/tables.ts +112 -0
  25. package/{src/code-generation → open-api}/fix-spec-main.ts +3 -3
  26. package/{src/code-generation → open-api}/generate-unified-interface.ts +42 -17
  27. package/{src/code-generation → open-api}/output/quickbase-fixed.json +3244 -4586
  28. package/open-api/paths/apps.ts +100 -0
  29. package/open-api/paths/auth.ts +25 -0
  30. package/open-api/paths/fields.ts +207 -0
  31. package/open-api/paths/index.ts +17 -0
  32. package/open-api/paths/records.ts +68 -0
  33. package/open-api/paths/relationships.ts +32 -0
  34. package/open-api/paths/reports.ts +34 -0
  35. package/open-api/paths/tables.ts +162 -0
  36. package/{src/code-generation → open-api}/regenerate-client.ts +4 -4
  37. package/package.json +34 -25
  38. package/playwright-results.txt/.last-run.json +4 -0
  39. package/playwright.config.ts +1 -1
  40. package/rollup.config.mjs +114 -0
  41. package/src/generated-unified/QuickbaseClient.ts +7 -6
  42. package/test-artifacts/.last-run.json +4 -2
  43. package/test-esm.js +1 -0
  44. package/test-umd.js +1 -0
  45. package/test.ts +1 -0
  46. package/tests/playwright/qb/auth/umd.test.ts +10 -0
  47. package/tests/vitest/qb/fields/createField.test.ts +78 -0
  48. package/tests/vitest/qb/fields/deleteFields.test.ts +89 -0
  49. package/tests/vitest/qb/fields/getField.test.ts +85 -0
  50. package/tests/vitest/qb/fields/getFieldUsage.test.ts +174 -0
  51. package/tests/vitest/qb/fields/getFieldsUsage.test.ts +77 -0
  52. package/tests/vitest/qb/index.ts +25 -1
  53. package/tests/vitest/unit/fields/createField.test.ts +391 -0
  54. package/tests/vitest/unit/fields/deleteFields.test.ts +141 -0
  55. package/tests/vitest/unit/fields/getField.test.ts +189 -0
  56. package/tests/vitest/unit/fields/getFieldUsage.test.ts +147 -0
  57. package/tests/vitest/unit/fields/getFieldsUsage.test.ts +160 -0
  58. package/tests/vitest/unit/index.ts +30 -1
  59. package/tests/vitest/unit/umd.test.ts +8 -0
  60. package/{src → tools}/log-gen.ts +14 -10
  61. package/tools/openapi-jars/openapi-generator-cli-7.12.0.jar +0 -0
  62. package/tsconfig.build.json +17 -0
  63. package/tsconfig.json +5 -5
  64. package/dist/quickbase.js.map +0 -1
  65. package/rollup.config.js +0 -70
  66. package/src/code-generation/fix-spec-definitions.ts +0 -809
  67. package/src/code-generation/fix-spec-paths.ts +0 -439
  68. package/test-artifacts/test-results.json +0 -829
  69. /package/{src/specs → specs}/QuickBase_RESTful_API_2025-03-04T06_22_39.725Z.json +0 -0
@@ -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
+ };
@@ -9,10 +9,10 @@ import readline from "readline";
9
9
  const CURRENT_JAR_VERSION = "7.12.0";
10
10
  const MAVEN_METADATA_URL =
11
11
  "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/maven-metadata.xml";
12
- const CODEGEN_DIR = join(fileURLToPath(import.meta.url), "..");
13
- const JARS_DIR = join(CODEGEN_DIR, "..", "openapi-jars");
14
- const SPEC_INPUT = join(CODEGEN_DIR, "output", "quickbase-fixed.json"); // Updated path
15
- const OUTPUT_DIR = join(CODEGEN_DIR, "..", "generated");
12
+ const CODEGEN_DIR = join(fileURLToPath(import.meta.url), ".."); // open-api/
13
+ const JARS_DIR = join(CODEGEN_DIR, "..", "tools", "openapi-jars"); // Updated to tools/openapi-jars/
14
+ const SPEC_INPUT = join(CODEGEN_DIR, "output", "quickbase-fixed.json"); // Relative to open-api/
15
+ const OUTPUT_DIR = join(CODEGEN_DIR, "..", "src", "generated"); // Up to root, then into src/generated/
16
16
 
17
17
  async function getLatestVersion(): Promise<string> {
18
18
  const response = await fetch(MAVEN_METADATA_URL);