quickbase-js 1.1.0-beta.6 → 1.1.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.
- package/README.md +253 -135
- package/dist/esm/quickbase.d.ts +5614 -2861
- package/dist/esm/quickbase.js +3204 -2116
- package/dist/esm/quickbase.js.map +1 -1
- package/dist/esm/quickbase.min.js +1 -1
- package/dist/esm/quickbase.min.js.map +1 -1
- package/dist/umd/quickbase.umd.js +3533 -2325
- package/dist/umd/quickbase.umd.js.map +1 -1
- package/dist/umd/quickbase.umd.min.js +1 -1
- package/dist/umd/quickbase.umd.min.js.map +1 -1
- package/package.json +49 -32
- package/CHANGELOG.md +0 -93
- package/build.js +0 -186
- package/dist/umd/quickbase.umd.d.ts +0 -5341
- package/examples/react.js +0 -48
- package/examples/vanillajs.html +0 -47
- package/examples/vanillatest.html +0 -49
- package/log-gen.yaml +0 -1372
- package/open-api/definitions/apps.ts +0 -274
- package/open-api/definitions/auth.ts +0 -10
- package/open-api/definitions/fields.ts +0 -751
- package/open-api/definitions/index.ts +0 -18
- package/open-api/definitions/records.ts +0 -269
- package/open-api/definitions/relationships.ts +0 -90
- package/open-api/definitions/reports.ts +0 -10
- package/open-api/definitions/tables.ts +0 -112
- package/open-api/fix-spec-main.ts +0 -176
- package/open-api/generate-unified-interface.ts +0 -170
- package/open-api/output/quickbase-fixed.json +0 -6760
- package/open-api/paths/apps.ts +0 -100
- package/open-api/paths/auth.ts +0 -25
- package/open-api/paths/fields.ts +0 -207
- package/open-api/paths/index.ts +0 -17
- package/open-api/paths/records.ts +0 -68
- package/open-api/paths/relationships.ts +0 -32
- package/open-api/paths/reports.ts +0 -34
- package/open-api/paths/tables.ts +0 -162
- package/open-api/regenerate-client.ts +0 -110
- package/playwright-results.txt/.last-run.json +0 -4
- package/playwright.config.ts +0 -37
- package/rollup.config.mjs +0 -114
- package/specs/QuickBase_RESTful_API_2025-03-04T06_22_39.725Z.json +0 -46878
- package/src/generated-unified/QuickbaseClient.ts +0 -62
- package/src/index.ts +0 -1
- package/src/quickbaseClient.ts +0 -313
- package/src/tokenCache.ts +0 -51
- package/test-artifacts/.last-run.json +0 -6
- package/test-esm.js +0 -1
- package/test-results.json +0 -2050
- package/test-umd.js +0 -1
- package/test.ts +0 -1
- package/tests/playwright/qb/auth/cacheSwitching.test.ts +0 -189
- package/tests/playwright/qb/auth/fetchTempToken401.test.ts +0 -217
- package/tests/playwright/qb/auth/getAppWithUserToken.test.ts +0 -151
- package/tests/playwright/qb/auth/getTempToken.test.ts +0 -180
- package/tests/playwright/qb/auth/tokenPrefetch.test.ts +0 -192
- package/tests/playwright/qb/auth/tokenRenewal.test.ts +0 -110
- package/tests/playwright/qb/auth/umd.test.ts +0 -10
- package/tests/setup.ts +0 -51
- package/tests/vitest/qb/apps/copyApp.test.ts +0 -76
- package/tests/vitest/qb/apps/createApp.test.ts +0 -64
- package/tests/vitest/qb/apps/deleteApp.test.ts +0 -76
- package/tests/vitest/qb/apps/getApp.test.ts +0 -40
- package/tests/vitest/qb/fields/createField.test.ts +0 -78
- package/tests/vitest/qb/fields/deleteFields.test.ts +0 -89
- package/tests/vitest/qb/fields/getField.test.ts +0 -85
- package/tests/vitest/qb/fields/getFieldUsage.test.ts +0 -174
- package/tests/vitest/qb/fields/getFields.test.ts +0 -232
- package/tests/vitest/qb/fields/getFieldsUsage.test.ts +0 -77
- package/tests/vitest/qb/index.ts +0 -28
- package/tests/vitest/qb/records/deleteRecords.test.ts +0 -110
- package/tests/vitest/qb/records/runQuery.test.ts +0 -146
- package/tests/vitest/qb/records/upsert.test.ts +0 -102
- package/tests/vitest/qb/tables/createTable.test.ts +0 -55
- package/tests/vitest/qb/tables/deleteTable.test.ts +0 -50
- package/tests/vitest/qb/tables/getAppTables.test.ts +0 -46
- package/tests/vitest/qb/tables/getRelationships.test.ts +0 -80
- package/tests/vitest/qb/tables/getTable.test.ts +0 -26
- package/tests/vitest/qb/tables/updateTable.test.ts +0 -48
- package/tests/vitest/unit/apps/copyApp.test.ts +0 -282
- package/tests/vitest/unit/apps/createApp.test.ts +0 -125
- package/tests/vitest/unit/apps/deleteApp.test.ts +0 -215
- package/tests/vitest/unit/apps/getApp.test.ts +0 -86
- package/tests/vitest/unit/auth/fetchTempToken401.test.ts +0 -85
- package/tests/vitest/unit/auth/getTempToken.test.ts +0 -95
- package/tests/vitest/unit/auth/retryOn401.test.ts +0 -106
- package/tests/vitest/unit/auth/two401s.test.ts +0 -77
- package/tests/vitest/unit/fields/createField.test.ts +0 -391
- package/tests/vitest/unit/fields/deleteFields.test.ts +0 -141
- package/tests/vitest/unit/fields/getField.test.ts +0 -189
- package/tests/vitest/unit/fields/getFieldUsage.test.ts +0 -147
- package/tests/vitest/unit/fields/getFields.test.ts +0 -122
- package/tests/vitest/unit/fields/getFieldsUsage.test.ts +0 -160
- package/tests/vitest/unit/index.ts +0 -33
- package/tests/vitest/unit/records/deleteRecords.test.ts +0 -112
- package/tests/vitest/unit/records/runQuery.test.ts +0 -102
- package/tests/vitest/unit/records/upsert.test.ts +0 -218
- package/tests/vitest/unit/tables/createTable.test.ts +0 -70
- package/tests/vitest/unit/tables/deleteTable.test.ts +0 -77
- package/tests/vitest/unit/tables/getAppTables.test.ts +0 -85
- package/tests/vitest/unit/tables/getRelationships.test.ts +0 -259
- package/tests/vitest/unit/tables/getTable.test.ts +0 -233
- package/tests/vitest/unit/tables/updateTable.test.ts +0 -80
- package/tests/vitest/unit/umd.test.ts +0 -8
- package/text.txt +0 -104
- package/tools/log-gen.ts +0 -175
- package/tools/openapi-jars/openapi-generator-cli-7.12.0.jar +0 -0
- package/tsconfig.build.json +0 -17
- package/tsconfig.json +0 -29
- package/versionrc.json +0 -9
- package/vitest.config.ts +0 -27
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { execSync } from "child_process";
|
|
3
|
-
import { existsSync } from "fs";
|
|
4
|
-
import { join } from "path";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
import fetch from "node-fetch";
|
|
7
|
-
import readline from "readline";
|
|
8
|
-
|
|
9
|
-
const CURRENT_JAR_VERSION = "7.12.0";
|
|
10
|
-
const MAVEN_METADATA_URL =
|
|
11
|
-
"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/maven-metadata.xml";
|
|
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
|
-
|
|
17
|
-
async function getLatestVersion(): Promise<string> {
|
|
18
|
-
const response = await fetch(MAVEN_METADATA_URL);
|
|
19
|
-
if (!response.ok)
|
|
20
|
-
throw new Error(`Failed to fetch Maven metadata: ${response.statusText}`);
|
|
21
|
-
const text = await response.text();
|
|
22
|
-
const match = text.match(/<latest>(.*?)<\/latest>/);
|
|
23
|
-
if (!match)
|
|
24
|
-
throw new Error("Couldn’t parse latest version from Maven metadata");
|
|
25
|
-
return match[1];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function checkAndPromptForUpdate(messages: string[]): Promise<string> {
|
|
29
|
-
const latestVersion = await getLatestVersion();
|
|
30
|
-
if (latestVersion === CURRENT_JAR_VERSION) {
|
|
31
|
-
messages.push(`Current version (${CURRENT_JAR_VERSION}) is the latest.`);
|
|
32
|
-
return CURRENT_JAR_VERSION;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
messages.push(
|
|
36
|
-
`Newer version available: ${latestVersion} (current: ${CURRENT_JAR_VERSION})`
|
|
37
|
-
);
|
|
38
|
-
const rl = readline.createInterface({
|
|
39
|
-
input: process.stdin,
|
|
40
|
-
output: process.stdout,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return new Promise((resolve) => {
|
|
44
|
-
const prompt = "Do you want to update to the latest version? (y/n): ";
|
|
45
|
-
messages.push(prompt);
|
|
46
|
-
rl.question(prompt, (answer) => {
|
|
47
|
-
rl.close();
|
|
48
|
-
if (answer.toLowerCase() === "y" || answer.toLowerCase() === "yes") {
|
|
49
|
-
messages.push(`Switching to version ${latestVersion}...`);
|
|
50
|
-
resolve(latestVersion);
|
|
51
|
-
} else {
|
|
52
|
-
messages.push(`Sticking with version ${CURRENT_JAR_VERSION}.`);
|
|
53
|
-
resolve(CURRENT_JAR_VERSION);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function ensureJarExists(
|
|
60
|
-
version: string,
|
|
61
|
-
messages: string[]
|
|
62
|
-
): Promise<string> {
|
|
63
|
-
const jarPath = join(JARS_DIR, `openapi-generator-cli-${version}.jar`);
|
|
64
|
-
const jarUrl = `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${version}/openapi-generator-cli-${version}.jar`;
|
|
65
|
-
|
|
66
|
-
if (!existsSync(jarPath)) {
|
|
67
|
-
messages.push(`Downloading OpenAPI Generator CLI v${version}...`);
|
|
68
|
-
try {
|
|
69
|
-
execSync(`curl -L -o ${jarPath} ${jarUrl}`, { stdio: "inherit" });
|
|
70
|
-
messages.push(`Downloaded ${jarPath}`);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
messages.push("Failed to download JAR.");
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
messages.push(`Using existing ${jarPath}`);
|
|
77
|
-
}
|
|
78
|
-
return jarPath;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function regenerateClient(jarPath: string, messages: string[]) {
|
|
82
|
-
messages.push("Regenerating client from spec...");
|
|
83
|
-
const command = `java -jar ${jarPath} generate -i ${SPEC_INPUT} -g typescript-fetch -o ${OUTPUT_DIR}`;
|
|
84
|
-
try {
|
|
85
|
-
execSync(command, { stdio: "inherit" });
|
|
86
|
-
messages.push("Client regeneration complete.");
|
|
87
|
-
} catch (error) {
|
|
88
|
-
messages.push("Regeneration failed.");
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async function main() {
|
|
94
|
-
const messages: string[] = [];
|
|
95
|
-
try {
|
|
96
|
-
const versionToUse = await checkAndPromptForUpdate(messages);
|
|
97
|
-
const jarPath = await ensureJarExists(versionToUse, messages);
|
|
98
|
-
regenerateClient(jarPath, messages);
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error("Error occurred during process:", error);
|
|
101
|
-
} finally {
|
|
102
|
-
console.log("\n--- Key Messages ---");
|
|
103
|
-
messages.forEach((msg) => console.log(msg));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
main().catch((error) => {
|
|
108
|
-
console.error("Error in regeneration process:", error);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
});
|
package/playwright.config.ts
DELETED
|
@@ -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 should take at least 5min. Workers: ${
|
|
33
|
-
config.workers || "default (half CPU cores)"
|
|
34
|
-
}`
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export default config;
|
package/rollup.config.mjs
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import terser from "@rollup/plugin-terser";
|
|
2
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
3
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
4
|
-
import dts from "rollup-plugin-dts";
|
|
5
|
-
import typescript from "@rollup/plugin-typescript";
|
|
6
|
-
|
|
7
|
-
const isProd = process.env.NODE_ENV === "production";
|
|
8
|
-
|
|
9
|
-
// External dependencies for both ESM and UMD builds
|
|
10
|
-
const external = [
|
|
11
|
-
"node:http",
|
|
12
|
-
"node:https",
|
|
13
|
-
"node:zlib",
|
|
14
|
-
"node:stream",
|
|
15
|
-
"node:buffer",
|
|
16
|
-
"node:util",
|
|
17
|
-
"node:url",
|
|
18
|
-
"node:net",
|
|
19
|
-
"node:fs",
|
|
20
|
-
"node:path",
|
|
21
|
-
"node-fetch",
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
// Global mappings for UMD (browser) build
|
|
25
|
-
const globals = {
|
|
26
|
-
"node-fetch": "fetch", // Map node-fetch to window.fetch in browsers
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default [
|
|
30
|
-
// ESM Build
|
|
31
|
-
{
|
|
32
|
-
input: "src/quickbaseClient.ts",
|
|
33
|
-
output: {
|
|
34
|
-
dir: "dist/esm",
|
|
35
|
-
format: "esm",
|
|
36
|
-
sourcemap: true,
|
|
37
|
-
entryFileNames: "quickbase.js",
|
|
38
|
-
},
|
|
39
|
-
external,
|
|
40
|
-
plugins: [
|
|
41
|
-
nodeResolve({ preferBuiltins: true }), // Node.js resolution
|
|
42
|
-
commonjs(), // Convert CommonJS to ESM
|
|
43
|
-
typescript({
|
|
44
|
-
tsconfig: "./tsconfig.json",
|
|
45
|
-
noEmitOnError: true, // Fail on TypeScript errors
|
|
46
|
-
// Use Rollup to emit JavaScript, overriding noEmit for this build
|
|
47
|
-
}),
|
|
48
|
-
isProd && terser(), // Minification for production
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
// UMD Build
|
|
52
|
-
{
|
|
53
|
-
input: "src/quickbaseClient.ts",
|
|
54
|
-
output: {
|
|
55
|
-
file: "dist/umd/quickbase.umd.js",
|
|
56
|
-
format: "umd",
|
|
57
|
-
name: "QuickbaseJS", // Global name for browser
|
|
58
|
-
sourcemap: true,
|
|
59
|
-
globals,
|
|
60
|
-
},
|
|
61
|
-
external,
|
|
62
|
-
plugins: [
|
|
63
|
-
nodeResolve({ preferBuiltins: true, browser: true }), // Browser-first resolution
|
|
64
|
-
commonjs(), // Convert CommonJS to UMD
|
|
65
|
-
typescript({
|
|
66
|
-
tsconfig: "./tsconfig.json",
|
|
67
|
-
noEmitOnError: true, // Fail on TypeScript errors
|
|
68
|
-
// Use Rollup to emit JavaScript, overriding noEmit for this build
|
|
69
|
-
}),
|
|
70
|
-
isProd && terser(), // Minification for production
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
// ESM Declarations
|
|
74
|
-
{
|
|
75
|
-
input: "src/quickbaseClient.ts",
|
|
76
|
-
output: {
|
|
77
|
-
file: "dist/esm/quickbase.d.ts",
|
|
78
|
-
format: "esm",
|
|
79
|
-
},
|
|
80
|
-
plugins: [
|
|
81
|
-
dts({
|
|
82
|
-
tsconfig: "./tsconfig.json",
|
|
83
|
-
respectExternal: true, // Include external dependencies in declarations
|
|
84
|
-
}),
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
// UMD Declarations
|
|
88
|
-
{
|
|
89
|
-
input: "src/quickbaseClient.ts",
|
|
90
|
-
output: {
|
|
91
|
-
file: "dist/umd/quickbase.umd.d.ts",
|
|
92
|
-
format: "umd",
|
|
93
|
-
},
|
|
94
|
-
plugins: [
|
|
95
|
-
dts({
|
|
96
|
-
tsconfig: "./tsconfig.json",
|
|
97
|
-
respectExternal: true, // Include external dependencies in declarations
|
|
98
|
-
}),
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
].map((config) => ({
|
|
102
|
-
...config,
|
|
103
|
-
onwarn(warning, warn) {
|
|
104
|
-
// Suppress TypeScript plugin warnings
|
|
105
|
-
if (
|
|
106
|
-
warning.code === "PLUGIN_WARNING" &&
|
|
107
|
-
warning.plugin === "typescript" &&
|
|
108
|
-
warning.message.includes("TS5096")
|
|
109
|
-
) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
warn(warning);
|
|
113
|
-
},
|
|
114
|
-
}));
|