quickbase-js 1.1.0-beta.5 → 1.1.0-beta.6
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/CHANGELOG.md +7 -0
- package/dist/esm/quickbase.js +5 -3
- 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 +5 -3
- 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/examples/vanillatest.html +49 -0
- package/log-gen.yaml +112 -41
- package/package.json +1 -1
- package/src/quickbaseClient.ts +5 -3
- package/tools/log-gen.ts +3 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<title>Quickbase CDN Test</title>
|
|
6
|
+
<!-- Load Quickbase library from CDN -->
|
|
7
|
+
<script src="https://cdn.jsdelivr.net/npm/quickbase-js@1.1.0-beta.5/dist/umd/quickbase.umd.min.js"></script>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<div>
|
|
12
|
+
<h1>Quickbase CDN Test</h1>
|
|
13
|
+
<p id="result">Loading...</p>
|
|
14
|
+
</div>
|
|
15
|
+
<script>
|
|
16
|
+
// Log the global object for debugging
|
|
17
|
+
console.log("Window object:", window);
|
|
18
|
+
|
|
19
|
+
// Log the QuickbaseJS variable for debugging
|
|
20
|
+
console.log("QuickbaseJS:", typeof QuickbaseJS);
|
|
21
|
+
|
|
22
|
+
// Ensure the QuickbaseJS library is loaded
|
|
23
|
+
if (typeof QuickbaseJS === "undefined") {
|
|
24
|
+
console.error("QuickbaseJS library not loaded.");
|
|
25
|
+
document.getElementById("result").textContent = "Error: Failed to load QuickbaseJS library.";
|
|
26
|
+
} else {
|
|
27
|
+
console.log("QuickbaseJS library loaded successfully.");
|
|
28
|
+
|
|
29
|
+
// Initialize the Quickbase client
|
|
30
|
+
var qbClient = QuickbaseJS.quickbase({
|
|
31
|
+
realm: "builderprogram-dbradford6815", // Replace with your realm (without .quickbase.com)
|
|
32
|
+
useTempTokens: true,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Fetch the app using the getApp method
|
|
36
|
+
qbClient.getApp({ appId: "buwai2zpe" })
|
|
37
|
+
.then(function (app) {
|
|
38
|
+
document.getElementById("result").textContent = "App Name: " + app.name;
|
|
39
|
+
})
|
|
40
|
+
.catch(function (err) {
|
|
41
|
+
console.error("Error fetching app:", err);
|
|
42
|
+
document.getElementById("result").textContent =
|
|
43
|
+
"Error: " + (err.message || "Failed to load app");
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
</body>
|
|
48
|
+
|
|
49
|
+
</html>
|
package/log-gen.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
project: quickbase-js
|
|
2
|
-
date: 3/
|
|
2
|
+
date: 3/13/2025
|
|
3
3
|
root: /home/drew/Projects/quickbase-js
|
|
4
4
|
goals:
|
|
5
5
|
- A library for interacting with the QuickBase RESTful API.
|
|
@@ -66,7 +66,7 @@ tree:
|
|
|
66
66
|
import commonjs from '@rollup/plugin-commonjs';
|
|
67
67
|
import dts from 'rollup-plugin-dts';
|
|
68
68
|
import { rimrafSync } from 'rimraf';
|
|
69
|
-
import { copyFileSync, readdirSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
69
|
+
import { copyFileSync, readdirSync, readFileSync, writeFileSync, mkdirSync, statSync } from 'fs';
|
|
70
70
|
import { join } from 'path';
|
|
71
71
|
|
|
72
72
|
// Clean the dist folder
|
|
@@ -126,44 +126,92 @@ tree:
|
|
|
126
126
|
];
|
|
127
127
|
const globals = { 'node-fetch': 'fetch' };
|
|
128
128
|
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
// Function to create Rollup bundle
|
|
130
|
+
async function createBundle(input, plugins, format, outputOptions) {
|
|
131
|
+
const bundle = await rollup({
|
|
132
|
+
input,
|
|
133
|
+
external,
|
|
134
|
+
plugins,
|
|
135
|
+
});
|
|
136
|
+
await bundle.write(outputOptions);
|
|
137
|
+
await bundle.close();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ESM Builds
|
|
141
|
+
console.log('Building ESM bundles...');
|
|
142
|
+
// Unminified ESM build (always generated)
|
|
143
|
+
await createBundle(
|
|
144
|
+
'dist/temp/quickbaseClient.js',
|
|
145
|
+
[
|
|
135
146
|
nodeResolve({ preferBuiltins: true }),
|
|
136
147
|
commonjs(),
|
|
137
|
-
isProd && terser(), // Only minify in prod
|
|
138
148
|
],
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
'esm',
|
|
150
|
+
{
|
|
151
|
+
dir: 'dist/esm',
|
|
152
|
+
format: 'esm',
|
|
153
|
+
sourcemap: true,
|
|
154
|
+
entryFileNames: 'quickbase.js',
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Minified ESM build (only in production)
|
|
159
|
+
if (isProd) {
|
|
160
|
+
await createBundle(
|
|
161
|
+
'dist/temp/quickbaseClient.js',
|
|
162
|
+
[
|
|
163
|
+
nodeResolve({ preferBuiltins: true }),
|
|
164
|
+
commonjs(),
|
|
165
|
+
terser(),
|
|
166
|
+
],
|
|
167
|
+
'esm',
|
|
168
|
+
{
|
|
169
|
+
dir: 'dist/esm',
|
|
170
|
+
format: 'esm',
|
|
171
|
+
sourcemap: true,
|
|
172
|
+
entryFileNames: 'quickbase.min.js',
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
147
176
|
|
|
148
|
-
// UMD
|
|
149
|
-
console.log(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
177
|
+
// UMD Builds
|
|
178
|
+
console.log('Building UMD bundles...');
|
|
179
|
+
// Unminified UMD build (always generated)
|
|
180
|
+
await createBundle(
|
|
181
|
+
'dist/temp/quickbaseClient.js',
|
|
182
|
+
[
|
|
154
183
|
nodeResolve({ preferBuiltins: true, browser: true }),
|
|
155
184
|
commonjs(),
|
|
156
|
-
isProd && terser(), // Only minify in prod
|
|
157
185
|
],
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
186
|
+
'umd',
|
|
187
|
+
{
|
|
188
|
+
file: join(process.cwd(), 'dist/umd', 'quickbase.umd.js'),
|
|
189
|
+
format: 'umd',
|
|
190
|
+
name: 'QuickbaseJS',
|
|
191
|
+
sourcemap: true,
|
|
192
|
+
globals,
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
// Minified UMD build (only in production)
|
|
197
|
+
if (isProd) {
|
|
198
|
+
await createBundle(
|
|
199
|
+
'dist/temp/quickbaseClient.js',
|
|
200
|
+
[
|
|
201
|
+
nodeResolve({ preferBuiltins: true, browser: true }),
|
|
202
|
+
commonjs(),
|
|
203
|
+
terser(),
|
|
204
|
+
],
|
|
205
|
+
'umd',
|
|
206
|
+
{
|
|
207
|
+
file: join(process.cwd(), 'dist/umd', 'quickbase.umd.min.js'),
|
|
208
|
+
format: 'umd',
|
|
209
|
+
name: 'QuickbaseJS',
|
|
210
|
+
sourcemap: true,
|
|
211
|
+
globals,
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
167
215
|
|
|
168
216
|
// Declarations
|
|
169
217
|
console.log('Generating declarations...');
|
|
@@ -178,7 +226,25 @@ tree:
|
|
|
178
226
|
// Clean up
|
|
179
227
|
rimrafSync('dist/temp');
|
|
180
228
|
rimrafSync('dist/temp-src');
|
|
181
|
-
|
|
229
|
+
|
|
230
|
+
// List generated files and their sizes
|
|
231
|
+
console.log('\nGenerated files:');
|
|
232
|
+
function listFilesWithSizes(dir, prefix = '') {
|
|
233
|
+
const files = readdirSync(dir, { withFileTypes: true });
|
|
234
|
+
for (const file of files) {
|
|
235
|
+
const filePath = join(dir, file.name);
|
|
236
|
+
if (file.isDirectory()) {
|
|
237
|
+
listFilesWithSizes(filePath, `${prefix}${file.name}/`);
|
|
238
|
+
} else {
|
|
239
|
+
const stats = statSync(filePath);
|
|
240
|
+
const sizeKB = (stats.size / 1024).toFixed(2);
|
|
241
|
+
console.log(`${prefix}${file.name} - ${sizeKB} KB`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
listFilesWithSizes(join(process.cwd(), 'dist'));
|
|
246
|
+
|
|
247
|
+
console.log('\nBuild completed successfully');
|
|
182
248
|
- name: dist
|
|
183
249
|
type: directory
|
|
184
250
|
children:
|
|
@@ -187,6 +253,10 @@ tree:
|
|
|
187
253
|
children:
|
|
188
254
|
- name: quickbase.d.ts
|
|
189
255
|
type: file
|
|
256
|
+
- name: quickbase.js
|
|
257
|
+
type: file
|
|
258
|
+
- name: quickbase.js.map
|
|
259
|
+
type: file
|
|
190
260
|
- name: quickbase.min.js
|
|
191
261
|
type: file
|
|
192
262
|
- name: quickbase.min.js.map
|
|
@@ -196,6 +266,10 @@ tree:
|
|
|
196
266
|
children:
|
|
197
267
|
- name: quickbase.umd.d.ts
|
|
198
268
|
type: file
|
|
269
|
+
- name: quickbase.umd.js
|
|
270
|
+
type: file
|
|
271
|
+
- name: quickbase.umd.js.map
|
|
272
|
+
type: file
|
|
199
273
|
- name: quickbase.umd.min.js
|
|
200
274
|
type: file
|
|
201
275
|
- name: quickbase.umd.min.js.map
|
|
@@ -207,6 +281,8 @@ tree:
|
|
|
207
281
|
type: file
|
|
208
282
|
- name: vanillajs.html
|
|
209
283
|
type: file
|
|
284
|
+
- name: vanillatest.html
|
|
285
|
+
type: file
|
|
210
286
|
- name: log-gen.yaml
|
|
211
287
|
type: file
|
|
212
288
|
- name: open-api
|
|
@@ -270,7 +346,7 @@ tree:
|
|
|
270
346
|
contents: |
|
|
271
347
|
{
|
|
272
348
|
"name": "quickbase-js",
|
|
273
|
-
"version": "1.1.0-beta.
|
|
349
|
+
"version": "1.1.0-beta.5",
|
|
274
350
|
"description": "QuickBase JavaScript client for frameworks and vanilla JS",
|
|
275
351
|
"type": "module",
|
|
276
352
|
"main": "dist/esm/quickbase.js",
|
|
@@ -299,8 +375,7 @@ tree:
|
|
|
299
375
|
"release:alpha": "standard-version --prerelease alpha",
|
|
300
376
|
"release:push": "npm run release:beta && git push --follow-tags origin main",
|
|
301
377
|
"release:publish": "npm run release:push && npm publish --tag beta",
|
|
302
|
-
|
|
303
|
-
|
|
378
|
+
"release:stable": "standard-version && git push --follow-tags origin main && npm publish",
|
|
304
379
|
"fix-spec": "node --loader ts-node/esm open-api/fix-spec-main.ts",
|
|
305
380
|
"regenerate:openapi": "rimraf src/generated && node --loader ts-node/esm open-api/regenerate-client.ts",
|
|
306
381
|
"regenerate:unified": "node --loader ts-node/esm open-api/generate-unified-interface.ts",
|
|
@@ -308,10 +383,6 @@ tree:
|
|
|
308
383
|
"log-gen": "node --loader ts-node/esm tools/log-gen.ts",
|
|
309
384
|
"build": "rimraf dist && node --loader ts-node/esm build.js",
|
|
310
385
|
"build:prod": "rimraf dist && NODE_ENV=production node --loader ts-node/esm build.js",
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
"build-old": "rimraf dist && rollup -c",
|
|
314
|
-
"build:prod-old": "rimraf dist && NODE_ENV=production rollup -c",
|
|
315
386
|
"test:all": "vitest run tests/vitest/**/**/*.test.ts --reporter=basic && playwright test tests/playwright/qb --config playwright.config.ts --reporter=dot --quiet",
|
|
316
387
|
"test:pw:qb:all": "playwright test tests/playwright/qb --config playwright.config.ts",
|
|
317
388
|
"test:vitest:all": "vitest run tests/vitest/**/**/*.test.ts",
|
package/package.json
CHANGED
package/src/quickbaseClient.ts
CHANGED
|
@@ -98,7 +98,7 @@ export function quickbase(config: QuickbaseConfig): QuickbaseClient {
|
|
|
98
98
|
basePath: baseUrl,
|
|
99
99
|
headers: { ...baseHeaders },
|
|
100
100
|
fetchApi: fetchApi || defaultFetch,
|
|
101
|
-
credentials:
|
|
101
|
+
credentials: "omit", // Default to "omit" for all requests
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
if (!configuration.fetchApi && typeof globalThis.window === "undefined") {
|
|
@@ -163,7 +163,7 @@ export function quickbase(config: QuickbaseConfig): QuickbaseClient {
|
|
|
163
163
|
{
|
|
164
164
|
method: "GET",
|
|
165
165
|
headers: { ...baseHeaders },
|
|
166
|
-
credentials: "include",
|
|
166
|
+
credentials: "include", // Explicitly include credentials for token fetch
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
169
|
|
|
@@ -209,7 +209,9 @@ export function quickbase(config: QuickbaseConfig): QuickbaseClient {
|
|
|
209
209
|
methodInfo.paramMap[0] === "requestParameters"
|
|
210
210
|
? { requestParameters: params }
|
|
211
211
|
: params;
|
|
212
|
-
let requestOptions: RequestInit = {
|
|
212
|
+
let requestOptions: RequestInit = {
|
|
213
|
+
credentials: "omit", // Explicitly set to "omit" for API calls
|
|
214
|
+
};
|
|
213
215
|
|
|
214
216
|
const selectedToken =
|
|
215
217
|
initialTempToken || (userToken && !useTempTokens ? userToken : undefined);
|
package/tools/log-gen.ts
CHANGED
|
@@ -12,9 +12,9 @@ const excludeDirs: string[] = ["node_modules", ".git", "specs"];
|
|
|
12
12
|
|
|
13
13
|
// prettier-ignore
|
|
14
14
|
const includeFolders: string[] = [
|
|
15
|
-
"open-api",
|
|
16
|
-
"open-api/definitions",
|
|
17
|
-
"open-api/paths",
|
|
15
|
+
// "open-api",
|
|
16
|
+
// "open-api/definitions",
|
|
17
|
+
// "open-api/paths",
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
// prettier-ignore
|