quickbase-js 0.1.0-beta.9 → 1.0.0

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 (146) hide show
  1. package/README.md +270 -60
  2. package/dist/esm/quickbase.d.ts +2553 -3220
  3. package/dist/esm/quickbase.js +1545 -3443
  4. package/dist/esm/quickbase.js.map +1 -1
  5. package/dist/esm/quickbase.min.js +1 -1
  6. package/dist/esm/quickbase.min.js.map +1 -1
  7. package/dist/umd/quickbase.umd.js +1544 -3625
  8. package/dist/umd/quickbase.umd.js.map +1 -1
  9. package/dist/umd/quickbase.umd.min.js +1 -1
  10. package/dist/umd/quickbase.umd.min.js.map +1 -1
  11. package/package.json +25 -12
  12. package/CHANGELOG.md +0 -184
  13. package/build-common.js +0 -131
  14. package/build-esm.js +0 -71
  15. package/build-umd.js +0 -69
  16. package/examples/quicbase-jsCDN.html +0 -36
  17. package/examples/react.js +0 -48
  18. package/examples/vanillajs.html +0 -47
  19. package/open-api/fix-spec-main.ts +0 -97
  20. package/open-api/generate-override-report.ts +0 -214
  21. package/open-api/generate-unified-interface.ts +0 -336
  22. package/open-api/output/override-report.html +0 -11
  23. package/open-api/output/override-report.json +0 -14395
  24. package/open-api/output/quickbase-fixed.json +0 -11191
  25. package/open-api/regenerate-client.ts +0 -116
  26. package/open-api/schema/enhance-general.ts +0 -100
  27. package/open-api/schema/fix-arrays.ts +0 -69
  28. package/open-api/schema/tags/apps.ts +0 -90
  29. package/open-api/schema/tags/fields.ts +0 -471
  30. package/open-api/schema/tags/groups.ts +0 -51
  31. package/open-api/schema/tags/index.ts +0 -66
  32. package/open-api/schema/tags/records.ts +0 -115
  33. package/open-api/schema/tags/tables.ts +0 -211
  34. package/open-api/schema/tags/users.ts +0 -47
  35. package/open-api/types/spec.ts +0 -42
  36. package/open-api/utils/generateJsDoc.ts +0 -96
  37. package/open-api/utils/infer-schema.ts +0 -40
  38. package/open-api/utils/naming.ts +0 -10
  39. package/playwright.config.ts +0 -37
  40. package/rollup.config.js +0 -114
  41. package/specs/QuickBase_RESTful_API_2025-03-04T06_22_39.725Z.json +0 -46878
  42. package/specs/split/apps.json +0 -1315
  43. package/specs/split/auth.json +0 -191
  44. package/specs/split/fields.json +0 -3869
  45. package/specs/split/records.json +0 -754
  46. package/specs/split/reports.json +0 -619
  47. package/specs/split/tables.json +0 -1605
  48. package/src/RateLimitError.ts +0 -12
  49. package/src/ThrottleBucket.ts +0 -41
  50. package/src/authorizationStrategy.ts +0 -246
  51. package/src/generated-unified/QuickbaseClient.ts +0 -1049
  52. package/src/generated-unified/missing-types-report.json +0 -3
  53. package/src/index.ts +0 -1
  54. package/src/invokeMethod.ts +0 -242
  55. package/src/quickbaseClient.ts +0 -271
  56. package/src/rateLimiter.ts +0 -25
  57. package/src/tokenCache.ts +0 -35
  58. package/src/utils.ts +0 -7
  59. package/test-esm.js +0 -1
  60. package/test-results.json +0 -2050
  61. package/test-umd.js +0 -1
  62. package/test.ts +0 -1
  63. package/tests/playwright/qb/auth/cacheSwitching.test.ts +0 -159
  64. package/tests/playwright/qb/auth/fetchTempToken401.test.ts +0 -219
  65. package/tests/playwright/qb/auth/getAppWithTempToken.test.ts +0 -162
  66. package/tests/playwright/qb/auth/getAppWithUserToken.test.ts +0 -153
  67. package/tests/playwright/qb/auth/getTempToken.test.ts +0 -152
  68. package/tests/playwright/qb/auth/tempTokenPrefetch.test.ts +0 -179
  69. package/tests/playwright/qb/auth/tempTokenRenewal.test.ts +0 -133
  70. package/tests/setup.ts +0 -53
  71. package/tests/vitest/qb/apps/copyApp.test.ts +0 -76
  72. package/tests/vitest/qb/apps/createApp.test.ts +0 -64
  73. package/tests/vitest/qb/apps/deleteApp.test.ts +0 -76
  74. package/tests/vitest/qb/apps/getApp.test.ts +0 -44
  75. package/tests/vitest/qb/apps/getAppEvents.test.ts +0 -67
  76. package/tests/vitest/qb/apps/updateApp.test.ts +0 -58
  77. package/tests/vitest/qb/auth/mockQuickbaseServer.ts +0 -60
  78. package/tests/vitest/qb/auth/retryUserToken401.test.ts +0 -73
  79. package/tests/vitest/qb/auth/ssoTokenIntegrationWithServer.test.ts +0 -65
  80. package/tests/vitest/qb/fields/createField.test.ts +0 -77
  81. package/tests/vitest/qb/fields/deleteFields.test.ts +0 -83
  82. package/tests/vitest/qb/fields/getField.test.ts +0 -85
  83. package/tests/vitest/qb/fields/getFieldUsage.test.ts +0 -82
  84. package/tests/vitest/qb/fields/getFields.test.ts +0 -232
  85. package/tests/vitest/qb/fields/getFieldsUsage.test.ts +0 -77
  86. package/tests/vitest/qb/fields/updateField.test.ts +0 -93
  87. package/tests/vitest/qb/formulas/runFormula.test.ts +0 -96
  88. package/tests/vitest/qb/index.ts +0 -29
  89. package/tests/vitest/qb/records/deleteRecords.test.ts +0 -110
  90. package/tests/vitest/qb/records/runQuery.test.ts +0 -146
  91. package/tests/vitest/qb/records/upsert.test.ts +0 -102
  92. package/tests/vitest/qb/tables/createRelationship.test.ts +0 -102
  93. package/tests/vitest/qb/tables/createTable.test.ts +0 -55
  94. package/tests/vitest/qb/tables/deleteRelationship.test.ts +0 -143
  95. package/tests/vitest/qb/tables/deleteTable.test.ts +0 -50
  96. package/tests/vitest/qb/tables/getAppTables.test.ts +0 -46
  97. package/tests/vitest/qb/tables/getRelationships.test.ts +0 -80
  98. package/tests/vitest/qb/tables/getTable.test.ts +0 -26
  99. package/tests/vitest/qb/tables/updateRelationship.test.ts +0 -250
  100. package/tests/vitest/qb/tables/updateTable.test.ts +0 -48
  101. package/tests/vitest/unit/ThrottleBucket.test.ts +0 -95
  102. package/tests/vitest/unit/apps/copyApp.test.ts +0 -581
  103. package/tests/vitest/unit/apps/createApp.test.ts +0 -186
  104. package/tests/vitest/unit/apps/deleteApp.test.ts +0 -216
  105. package/tests/vitest/unit/apps/getApp.test.ts +0 -128
  106. package/tests/vitest/unit/apps/getAppEvents.test.ts +0 -193
  107. package/tests/vitest/unit/apps/updateApp.test.ts +0 -412
  108. package/tests/vitest/unit/auth/fetchTempToken401.test.ts +0 -63
  109. package/tests/vitest/unit/auth/getTempToken.test.ts +0 -119
  110. package/tests/vitest/unit/auth/retryTempToken401.test.ts +0 -95
  111. package/tests/vitest/unit/auth/retryTempTokenMaxRetries.test.ts +0 -235
  112. package/tests/vitest/unit/auth/retryUserToken401.test.ts +0 -69
  113. package/tests/vitest/unit/auth/ssoTokenRefresh.test.ts +0 -325
  114. package/tests/vitest/unit/fields/createField.test.ts +0 -451
  115. package/tests/vitest/unit/fields/deleteFields.test.ts +0 -141
  116. package/tests/vitest/unit/fields/getField.test.ts +0 -189
  117. package/tests/vitest/unit/fields/getFieldUsage.test.ts +0 -180
  118. package/tests/vitest/unit/fields/getFields.test.ts +0 -122
  119. package/tests/vitest/unit/fields/getFieldsUsage.test.ts +0 -160
  120. package/tests/vitest/unit/fields/updateField.test.ts +0 -285
  121. package/tests/vitest/unit/formulas/runFormula.test.ts +0 -205
  122. package/tests/vitest/unit/index.ts +0 -34
  123. package/tests/vitest/unit/inferHttpMethod.test.ts +0 -131
  124. package/tests/vitest/unit/rateLimit.test.ts +0 -191
  125. package/tests/vitest/unit/records/deleteRecords.test.ts +0 -112
  126. package/tests/vitest/unit/records/runQuery.test.ts +0 -102
  127. package/tests/vitest/unit/records/upsert.test.ts +0 -234
  128. package/tests/vitest/unit/tables/createRelationship.test.ts +0 -212
  129. package/tests/vitest/unit/tables/createTable.test.ts +0 -70
  130. package/tests/vitest/unit/tables/deleteRelationship.test.ts +0 -97
  131. package/tests/vitest/unit/tables/deleteTable.test.ts +0 -77
  132. package/tests/vitest/unit/tables/getAppTables.test.ts +0 -85
  133. package/tests/vitest/unit/tables/getRelationships.test.ts +0 -259
  134. package/tests/vitest/unit/tables/getTable.test.ts +0 -233
  135. package/tests/vitest/unit/tables/updateRelationship.test.ts +0 -307
  136. package/tests/vitest/unit/tables/updateTable.test.ts +0 -80
  137. package/tests/vitest/unit/tokenLifespan.test.ts +0 -204
  138. package/tests/vitest/unit/umd.test.ts +0 -8
  139. package/text.txt +0 -104
  140. package/tools/log-gen.ts +0 -244
  141. package/tools/log-gen.yaml +0 -5424
  142. package/tools/openapi-jars/openapi-generator-cli-7.12.0.jar +0 -0
  143. package/tsconfig.build.json +0 -17
  144. package/tsconfig.json +0 -32
  145. package/versionrc.json +0 -9
  146. package/vitest.config.ts +0 -27
@@ -1,115 +0,0 @@
1
- // open-api/schema/tags/records.ts
2
- import { Operation, Parameter, Spec } from "../../types/spec.ts";
3
- import { normalizeDefinitionName } from "../../utils/naming.ts"; // Ensure this import is present
4
-
5
- export function enhanceRecords(
6
- spec: Spec,
7
- pathKey: string,
8
- method: string,
9
- operation: Operation
10
- ): void {
11
- const opId =
12
- operation.operationId || `${method}${pathKey.replace(/\W/g, "")}`;
13
- if (operation.parameters && operation.tags?.includes("Records")) {
14
- operation.parameters.forEach((param: Parameter) => {
15
- if (param.in === "body") {
16
- if (!param.schema) param.schema = {};
17
- let requestName =
18
- param.schema.$ref?.split("/").pop() || `${opId}Request`;
19
- requestName = normalizeDefinitionName(requestName);
20
-
21
- if (
22
- !spec.definitions[requestName] ||
23
- !spec.definitions[requestName].type ||
24
- Object.keys(spec.definitions[requestName]?.properties || {})
25
- .length === 0
26
- ) {
27
- console.log(
28
- `Defining schema for ${requestName} in ${pathKey}(${method})`
29
- );
30
- let properties;
31
- // Upsert endpoint (/records)
32
- if (pathKey === "/records" && method === "post") {
33
- properties = {
34
- data: { type: "array", items: { $ref: "#/definitions/Record" } },
35
- to: { type: "string" },
36
- fieldsToReturn: { type: "array", items: { type: "integer" } },
37
- };
38
- }
39
- // Query endpoint (/records/query)
40
- else if (pathKey === "/records/query" && method === "post") {
41
- properties = {
42
- from: { type: "string", description: "The table identifier." },
43
- select: {
44
- type: "array",
45
- items: { type: "integer" },
46
- description: "An array of field ids...",
47
- },
48
- where: {
49
- type: "string",
50
- description:
51
- "The filter, using the Quickbase query language...",
52
- },
53
- sortBy: {
54
- type: "array",
55
- items: {
56
- type: "object",
57
- properties: {
58
- fieldId: { type: "integer" },
59
- order: {
60
- type: "string",
61
- enum: ["ASC", "DESC", "equal-values"],
62
- },
63
- },
64
- required: ["fieldId", "order"],
65
- },
66
- description: "An array of field IDs and sort directions...",
67
- },
68
- groupBy: {
69
- type: "array",
70
- items: {
71
- type: "object",
72
- properties: {
73
- fieldId: { type: "integer" },
74
- grouping: { type: "string", enum: ["equal-values"] },
75
- },
76
- required: ["fieldId", "grouping"],
77
- },
78
- description:
79
- "An array that contains the fields to group the records by.",
80
- },
81
- options: {
82
- type: "object",
83
- properties: {
84
- skip: { type: "integer" },
85
- top: { type: "integer" },
86
- compareWithAppLocalTime: { type: "boolean" },
87
- },
88
- description: "Additional query options.",
89
- },
90
- };
91
- }
92
- // Delete endpoint (/records)
93
- else if (method === "delete") {
94
- properties = {
95
- from: { type: "string" },
96
- where: { type: "string" },
97
- };
98
- }
99
- if (properties) {
100
- spec.definitions[requestName] = {
101
- type: "object",
102
- properties,
103
- required: ["from"], // Only 'from' is required per the spec
104
- description: operation.summary || `Request body for ${opId}`,
105
- };
106
- }
107
- }
108
- param.schema = { $ref: `#/definitions/${requestName}` };
109
- console.log(
110
- `Ensured ${requestName} in definitions for ${pathKey}(${method})`
111
- );
112
- }
113
- });
114
- }
115
- }
@@ -1,211 +0,0 @@
1
- // schema/tags/tables.ts
2
- import { Operation, Parameter, Spec } from "../../types/spec.ts";
3
- import { normalizeDefinitionName } from "../../utils/naming.ts";
4
-
5
- export function enhanceTables(
6
- spec: Spec,
7
- pathKey: string,
8
- method: string,
9
- operation: Operation
10
- ): void {
11
- const opId =
12
- operation.operationId || `${method}${pathKey.replace(/\W/g, "")}`;
13
- if (operation.parameters && operation.tags?.includes("Tables")) {
14
- operation.parameters.forEach((param: Parameter) => {
15
- if (param.in === "body") {
16
- if (!param.schema) param.schema = {};
17
- let requestName =
18
- param.schema.$ref?.split("/").pop() || `${opId}Request`;
19
- requestName = normalizeDefinitionName(requestName);
20
-
21
- if (
22
- !spec.definitions[requestName] ||
23
- !spec.definitions[requestName].type ||
24
- Object.keys(spec.definitions[requestName]?.properties || {})
25
- .length === 0
26
- ) {
27
- console.log(
28
- `Defining schema for ${requestName} in ${pathKey}(${method})`
29
- );
30
- let properties;
31
-
32
- // Existing logic for other endpoints remains unchanged
33
- if (pathKey === "/tables" && method === "post") {
34
- properties = {
35
- name: {
36
- type: "string",
37
- description: "The name for the table.",
38
- minLength: 1,
39
- },
40
- description: {
41
- type: "string",
42
- description: "The description for the table...",
43
- },
44
- singleRecordName: {
45
- type: "string",
46
- description: "The singular noun for records...",
47
- },
48
- pluralRecordName: {
49
- type: "string",
50
- description: "The plural noun for records...",
51
- },
52
- };
53
- } else if (pathKey === "/tables/{tableId}" && method === "post") {
54
- properties = {
55
- name: {
56
- type: "string",
57
- description: "The updated name of the table.",
58
- },
59
- description: {
60
- type: "string",
61
- description: "The updated description for the table.",
62
- },
63
- };
64
- }
65
- // Add minimal fix for relationship endpoints
66
- else if (
67
- pathKey === "/tables/{tableId}/relationship" &&
68
- method === "post"
69
- ) {
70
- requestName = "CreateRelationshipRequest"; // Force correct name
71
- if (!spec.definitions[requestName]) {
72
- properties = {
73
- parentTableId: {
74
- type: "string",
75
- description: "The parent table id for the relationship.",
76
- },
77
- foreignKeyField: {
78
- type: "object",
79
- properties: {
80
- label: {
81
- type: "string",
82
- description: "The label for the foreign key field.",
83
- },
84
- },
85
- additionalProperties: true,
86
- },
87
- lookupFieldIds: {
88
- type: "array",
89
- items: { type: "integer" },
90
- description: "Array of field ids...",
91
- },
92
- summaryFields: {
93
- type: "array",
94
- items: {
95
- type: "object",
96
- properties: {
97
- summaryFid: {
98
- type: "number",
99
- description: "The field id to summarize.",
100
- },
101
- label: {
102
- type: "string",
103
- description: "The label for the summary field.",
104
- },
105
- accumulationType: {
106
- type: "string",
107
- enum: [
108
- "AVG",
109
- "SUM",
110
- "MAX",
111
- "MIN",
112
- "STD-DEV",
113
- "COUNT",
114
- "COMBINED-TEXT",
115
- "COMBINED-USER",
116
- "DISTINCT-COUNT",
117
- ],
118
- description: "The accumulation type...",
119
- },
120
- where: { type: "string", description: "The filter..." },
121
- },
122
- required: ["accumulationType"],
123
- additionalProperties: true,
124
- },
125
- description: "Array of summary field objects...",
126
- },
127
- };
128
- }
129
- } else if (
130
- pathKey === "/tables/{tableId}/relationship/{relationshipId}" &&
131
- method === "post"
132
- ) {
133
- requestName = "UpdateRelationshipRequest"; // Force correct name
134
- if (!spec.definitions[requestName]) {
135
- properties = {
136
- parentTableId: {
137
- type: "string",
138
- description: "The updated parent table id...",
139
- },
140
- foreignKeyField: {
141
- type: "object",
142
- properties: {
143
- label: {
144
- type: "string",
145
- description: "The updated label...",
146
- },
147
- },
148
- additionalProperties: true,
149
- },
150
- lookupFieldIds: {
151
- type: "array",
152
- items: { type: "integer" },
153
- description: "Updated array of field ids...",
154
- },
155
- summaryFields: {
156
- type: "array",
157
- items: {
158
- type: "object",
159
- properties: {
160
- summaryFid: { type: "number" },
161
- label: { type: "string" },
162
- accumulationType: {
163
- type: "string",
164
- enum: [
165
- "AVG",
166
- "SUM",
167
- "MAX",
168
- "MIN",
169
- "STD-DEV",
170
- "COUNT",
171
- "COMBINED-TEXT",
172
- "COMBINED-USER",
173
- "DISTINCT-COUNT",
174
- ],
175
- },
176
- where: { type: "string" },
177
- },
178
- required: ["accumulationType"],
179
- additionalProperties: true,
180
- },
181
- },
182
- };
183
- }
184
- }
185
-
186
- if (properties) {
187
- spec.definitions[requestName] = {
188
- type: "object",
189
- properties,
190
- required:
191
- pathKey.includes("relationship") &&
192
- pathKey.endsWith("/relationship")
193
- ? ["parentTableId"]
194
- : pathKey === "/tables"
195
- ? ["name"]
196
- : [],
197
- additionalProperties: pathKey.includes("relationship")
198
- ? false
199
- : true, // Match raw spec
200
- description: operation.summary || `Request body for ${opId}`,
201
- };
202
- }
203
- }
204
- param.schema = { $ref: `#/definitions/${requestName}` };
205
- console.log(
206
- `Ensured ${requestName} in definitions for ${pathKey}(${method})`
207
- );
208
- }
209
- });
210
- }
211
- }
@@ -1,47 +0,0 @@
1
- // schema/tags/users.ts
2
- import { Operation, Parameter, Spec } from "../../types/spec.ts";
3
- import { normalizeDefinitionName } from "../../utils/naming.ts";
4
-
5
- export function enhanceUsers(
6
- spec: Spec,
7
- pathKey: string,
8
- method: string,
9
- operation: Operation
10
- ): void {
11
- const opId =
12
- operation.operationId || `${method}${pathKey.replace(/\W/g, "")}`;
13
- if (operation.parameters && operation.tags?.includes("Users")) {
14
- operation.parameters.forEach((param: Parameter) => {
15
- if (param.in === "body") {
16
- if (!param.schema) param.schema = {};
17
- let requestName =
18
- param.schema.$ref?.split("/").pop() || `${opId}Request`;
19
- requestName = normalizeDefinitionName(requestName);
20
-
21
- if (
22
- !spec.definitions[requestName] ||
23
- !spec.definitions[requestName].type ||
24
- Object.keys(spec.definitions[requestName]?.properties || {})
25
- .length === 0
26
- ) {
27
- console.log(
28
- `Defining schema for ${requestName} in ${pathKey}(${method})`
29
- );
30
- const properties = {
31
- userIds: { type: "array", items: { type: "string" } },
32
- };
33
- spec.definitions[requestName] = {
34
- type: "object",
35
- properties,
36
- required: Object.keys(properties),
37
- description: operation.summary || `Request body for ${opId}`,
38
- };
39
- }
40
- param.schema = { $ref: `#/definitions/${requestName}` };
41
- console.log(
42
- `Ensured ${requestName} in definitions for ${pathKey}(${method})`
43
- );
44
- }
45
- });
46
- }
47
- }
@@ -1,42 +0,0 @@
1
- // open-api/types/spec.ts
2
- export interface Parameter {
3
- name: string;
4
- in: string;
5
- required?: boolean;
6
- type?: string;
7
- schema?: {
8
- type?: string;
9
- items?: any;
10
- $ref?: string;
11
- properties?: any;
12
- example?: any;
13
- };
14
- example?: any;
15
- }
16
-
17
- export interface Operation {
18
- parameters?: Parameter[];
19
- responses?: Record<
20
- string,
21
- { description: string; schema?: any; "x-amf-mediaType"?: string }
22
- >;
23
- operationId?: string;
24
- summary?: string;
25
- tags?: string[];
26
- }
27
-
28
- export interface Spec {
29
- paths: Record<string, Record<string, Operation>>;
30
- definitions: Record<string, any>; // Required, no longer optional
31
- swagger: string;
32
- info: any;
33
- operations?: any;
34
- groups?: any;
35
- components?: any;
36
- }
37
-
38
- export interface FixSpecConfig {
39
- applyOverrides?: boolean;
40
- overridePaths?: string[];
41
- overrideDefinitions?: string[];
42
- }
@@ -1,96 +0,0 @@
1
- interface ParamDetail {
2
- name: string;
3
- type: string;
4
- required: boolean;
5
- properties: {
6
- name: string;
7
- type: string;
8
- required: boolean;
9
- jsdoc?: string;
10
- }[];
11
- }
12
-
13
- interface JsDocOptions {
14
- summary: string;
15
- opId: string;
16
- paramDetails: ParamDetail[];
17
- returnType: string;
18
- returnTypeDetails: {
19
- name: string;
20
- type: string;
21
- required: boolean;
22
- jsdoc?: string;
23
- }[];
24
- docLink: string;
25
- }
26
-
27
- export function generateJsDoc({
28
- summary,
29
- opId,
30
- paramDetails,
31
- returnType,
32
- returnTypeDetails,
33
- docLink,
34
- }: JsDocOptions): string {
35
- const jsDocLines: string[] = [
36
- ` /**`,
37
- ` * ${summary}`,
38
- ` *`,
39
- ` * @param {Object} params _Object containing the parameters for_ ${opId}`,
40
- ];
41
-
42
- // Parameters section
43
- if (paramDetails.length > 0) {
44
- paramDetails.forEach((p) => {
45
- jsDocLines.push(
46
- ` * @param {${p.type}} params.${p.name} _${
47
- p.required ? "Required" : "Optional"
48
- } parameter with properties_`
49
- );
50
- if (p.properties.length > 0) {
51
- p.properties.forEach((prop) => {
52
- const propDesc = prop.jsdoc
53
- ? prop.jsdoc.replace(/@type\s*{[^}]+}\s*@memberof\s*\w+/, "").trim()
54
- : `Type: ${prop.type}`;
55
- jsDocLines.push(
56
- ` * - **${prop.name}** (\`${prop.type}\`${
57
- prop.required ? ", required" : ", optional"
58
- }) _${propDesc}_`
59
- );
60
- });
61
- }
62
- });
63
- } else {
64
- jsDocLines.push(` * No parameters`);
65
- }
66
-
67
- // Returns section
68
- jsDocLines.push(` *`);
69
- if (returnTypeDetails.length > 0) {
70
- jsDocLines.push(
71
- ` * @returns {Promise<${returnType}>} _Promise resolving to the ${opId} response with properties_`
72
- );
73
- returnTypeDetails.forEach((prop) => {
74
- const propDesc = prop.jsdoc
75
- ? prop.jsdoc.replace(/@type\s*{[^}]+}\s*@memberof\s*\w+/, "").trim()
76
- : `Type: ${prop.type}`;
77
- jsDocLines.push(
78
- ` * - **${prop.name}** (\`${prop.type}\`${
79
- prop.required ? ", required" : ", optional"
80
- }) _${propDesc}_`
81
- );
82
- });
83
- } else {
84
- jsDocLines.push(
85
- ` * @returns {Promise<${returnType}>} _Promise resolving to the ${opId} response_`
86
- );
87
- }
88
-
89
- jsDocLines.push(
90
- ` *`,
91
- ` * @see {@link ${docLink}} Official Quickbase API documentation`
92
- );
93
- jsDocLines.push(` */`);
94
-
95
- return jsDocLines.join("\n");
96
- }
@@ -1,40 +0,0 @@
1
- // utils/infer-schema.ts
2
- export function inferSchema(example: any, operationId?: string): any {
3
- if (!example || typeof example !== "object") {
4
- return { type: "string" };
5
- }
6
- if (Array.isArray(example)) {
7
- return {
8
- type: "array",
9
- items:
10
- example.length > 0
11
- ? inferSchema(example[0], operationId)
12
- : { type: "string" },
13
- };
14
- }
15
- const properties: Record<string, any> = {};
16
- for (const [key, value] of Object.entries(example)) {
17
- if (Array.isArray(value)) {
18
- properties[key] = {
19
- type: "array",
20
- items:
21
- value.length > 0
22
- ? inferSchema(value[0], operationId)
23
- : { type: "string" },
24
- };
25
- } else if (typeof value === "object" && value !== null) {
26
- properties[key] = inferSchema(value, operationId);
27
- } else {
28
- properties[key] = {
29
- type:
30
- typeof value === "object" && value === null
31
- ? "object"
32
- : typeof value || "string",
33
- };
34
- }
35
- }
36
- if (operationId && operationId.endsWith("200Response")) {
37
- return { type: "array", items: { type: "object", properties } };
38
- }
39
- return { type: "object", properties };
40
- }
@@ -1,10 +0,0 @@
1
- // utils/naming.ts
2
- export function toCamelCase(str: string): string {
3
- return str
4
- .replace(/[-_](.)/g, (_, char) => char.toUpperCase())
5
- .replace(/^./, (str) => str.toLowerCase());
6
- }
7
-
8
- export function normalizeDefinitionName(name: string): string {
9
- return name.charAt(0).toUpperCase() + name.slice(1);
10
- }
@@ -1,37 +0,0 @@
1
- // playwright.config.ts
2
- import { defineConfig, devices } from "@playwright/test";
3
-
4
- const config = defineConfig({
5
- fullyParallel: true,
6
- workers: undefined, // Default: half of CPU cores (e.g., 2 on a 4-core machine)
7
- // workers: 2, // Or explicitly set to 2 for controlled testing
8
- testDir: "./tests/playwright",
9
- timeout: 600000, // 10 minutes
10
- retries: 2,
11
- reporter: [
12
- ["list"],
13
- ["json", { outputFile: "test-artifacts/test-results.json" }],
14
- ],
15
- use: {
16
- baseURL: "https://api.quickbase.com",
17
- headless: true,
18
- viewport: { width: 1280, height: 720 },
19
- actionTimeout: 10000,
20
- screenshot: "off",
21
- },
22
- outputDir: "test-artifacts",
23
- projects: [
24
- {
25
- name: "chromium",
26
- use: { ...devices["Desktop Chrome"] },
27
- },
28
- ],
29
- });
30
-
31
- console.log(
32
- `Loading Playwright: Testing temp token authorization in browser. Be patient, this could take at least 5min. Workers: ${
33
- config.workers || "default (half CPU cores)"
34
- }`
35
- );
36
-
37
- export default config;