quickbase-js 2.0.0-alpha.7 → 2.0.0-alpha.9

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 CHANGED
@@ -28,11 +28,16 @@ npm install quickbase-js
28
28
 
29
29
  ### Browser / CDN (QuickBase Code Pages)
30
30
 
31
+ For QuickBase Code Pages, use temp-token authentication which automatically leverages the user's browser session:
32
+
31
33
  ```html
32
34
  <script src="https://cdn.jsdelivr.net/npm/quickbase-js@2/dist/quickbase.min.js"></script>
33
35
  <script>
36
+ // Realm can be auto-detected from the current URL
37
+ const realm = window.location.hostname.split('.')[0];
38
+
34
39
  const client = QuickBase.createClient({
35
- realm: 'mycompany',
40
+ realm: realm,
36
41
  auth: { type: 'temp-token' },
37
42
  });
38
43
 
@@ -122,6 +127,16 @@ const client = createClient({
122
127
  });
123
128
  ```
124
129
 
130
+ **Auto dbid extraction:** The SDK automatically extracts the database ID for temp token authentication from your request parameters:
131
+
132
+ - `body.from` (runQuery, deleteRecords)
133
+ - `body.to` (upsert)
134
+ - `query.tableId` (getFields, etc.)
135
+ - `query.appId` (getAppTables, etc.)
136
+ - Path segments `/tables/{tableId}` and `/apps/{appId}`
137
+
138
+ This means you don't need to manually specify the dbid - just make API calls and the SDK handles token management automatically.
139
+
125
140
  ### SSO Token
126
141
 
127
142
  ```typescript
@@ -408,6 +423,12 @@ await client.runQuery({ from: tableId, select: [3, 6] });
408
423
  ## Development
409
424
 
410
425
  ```bash
426
+ # Clone with submodules (includes OpenAPI spec)
427
+ git clone --recurse-submodules https://github.com/DrewBradfordXYZ/quickbase-js.git
428
+
429
+ # Or if already cloned, initialize submodules
430
+ git submodule update --init
431
+
411
432
  # Install dependencies
412
433
  npm install
413
434
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QuickBase JS SDK v2.0.0-alpha.7
2
+ * QuickBase JS SDK v2.0.0-alpha.9
3
3
  * https://github.com/DrewBradfordXYZ/quickbase-js#readme
4
4
  * @license MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QuickBase JS SDK v2.0.0-alpha.7
2
+ * QuickBase JS SDK v2.0.0-alpha.9
3
3
  * https://github.com/DrewBradfordXYZ/quickbase-js#readme
4
4
  * @license MIT
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickbase-js",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "TypeScript/JavaScript client for the QuickBase JSON RESTful API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "spec:patch": "tsx spec/tools/cli.ts patch",
37
37
  "spec:validate": "tsx spec/tools/cli.ts validate",
38
38
  "spec:split": "tsx spec/tools/cli.ts split",
39
- "spec:generate": "tsx spec/tools/cli.ts generate",
40
- "spec:build": "tsx spec/tools/cli.ts build",
39
+ "spec:generate": "tsx scripts/spec/generate.ts",
40
+ "spec:build": "npm run spec:convert && npm run spec:patch && npm run spec:validate && npm run spec:generate",
41
41
  "docs": "typedoc",
42
42
  "docs:watch": "typedoc --watch",
43
43
  "prepublishOnly": "npm run clean && npm run build && npm run test"