Commit all workspace changes from current session

This commit is contained in:
JC Beasley
2026-07-05 12:50:33 -07:00
parent 93b21a8164
commit 3d855cfd11
74 changed files with 2204 additions and 2491 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token')
NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]')
echo "Getting colOptions..."
curl -s "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc/colOptions" \
-H "xc-token: $NOCODB_TOKEN" | jq '.'
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env node
const axios = require('axios');
async function debug() {
// Get vault token
const vaultResp = await axios.post('https://beavault.beawit.net:8200/v1/auth/approle/login', {
role_id: '75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e',
secret_id: '6202b465-2f25-547c-ec07-f47cfc4dda3e'
}, { httpsAgent: new (require('https').Agent)({ rejectUnauthorized: false }) });
const vaultToken = vaultResp.data.auth.client_token;
// Get nocodb token
const infraResp = await axios.get('https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure', {
headers: { 'X-Vault-Token': vaultToken },
httpsAgent: new (require('https').Agent)({ rejectUnauthorized: false })
});
const nocodbToken = infraResp.data.data.data['nocodb-token'];
console.log('Token:', nocodbToken.substring(0, 20) + '...');
// Check existing records
console.log('\n=== Existing records ===');
const records = await axios.get('http://192.168.25.5:8080/api/v2/tables/mx149yctebfwvys/records', {
headers: { 'xc-token': nocodbToken }
});
console.log('Records:', JSON.stringify(records.data.list, null, 2));
// Try to create with minimal payload
console.log('\n=== Testing minimal insert ===');
try {
const result = await axios.post(
'http://192.168.25.5:8080/api/v2/tables/mx149yctebfwvys/records',
{
type: 'correction',
id: 'test_' + Date.now(),
pattern: 'test',
severity: 'auto-correct',
message: 'test message',
blocking: true
},
{
headers: {
'xc-token': nocodbToken,
'Content-Type': 'application/json'
}
}
);
console.log('Success:', result.data);
} catch (err) {
console.log('Error:', err.response?.data || err.message);
console.log('Status:', err.response?.status);
}
}
debug().catch(console.error);
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# Get vault token
VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token')
# Get nocodb token
NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]')
echo "NocoDB Token: ${NOCODB_TOKEN:0:20}..."
# Get column ID for 'type'
echo "=== Getting type column ID ==="
curl -s "http://192.168.25.5:8080/api/v2/meta/tables/mx149yctebfwvys" \
-H "xc-token: $NOCODB_TOKEN" | jq '.columns[] | select(.column_name == "type") | {id, column_name, uidt}'
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
VAULT_TOKEN=*** -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login)
TOKEN=*** -r '.auth.client_token')
curl -sk -H "X-Vault-Token: $TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]'
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token')
NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]')
echo "Deleting type column..."
# Delete the type column
curl -s -X DELETE "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \
-H "xc-token: $NOCODB_TOKEN"
echo ""
echo "Recreating type column with options..."
# Create new SingleSelect column with options
curl -s -X POST "http://192.168.25.5:8080/api/v2/meta/tables/mx149yctebfwvys/columns" \
-H "xc-token: $NOCODB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"column_name": "type",
"title": "type",
"uidt": "SingleSelect",
"dtxp": "correction,preference,episode,decision,validation"
}'
echo ""
echo "Done!"
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Get vault token
VAULT_TOKEN=$(curl -sk -X POST \
-d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' \
"https://beavault.beawit.net:8200/v1/auth/approle/login" | jq -r '.auth.client_token')
# Get nocodb token
NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" \
"https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure" | jq -r '.data.data["nocodb-token"]')
echo "Token: ${NOCODB_TOKEN:0:20}..."
# First get the table to find column IDs
echo "=== Getting table metadata ==="
curl -s "http://192.168.25.5:8080/api/v2/meta/tables/mx149yctebfwvys" \
-H "xc-token: $NOCODB_TOKEN" | jq '.columns[] | select(.column_name == "type") | {id, column_name, uidt, dtxp}'
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Get tokens
VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token')
NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]')
echo "Updating type column options..."
# Update type column (ID: ctkqqemeblx80cc)
curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \
-H "xc-token: $NOCODB_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dtxp": "correction,preference,episode,decision,validation",
"meta": {
"options": [
{"title": "correction", "color": "#FF0000"},
{"title": "preference", "color": "#00FF00"},
{"title": "episode", "color": "#0000FF"},
{"title": "decision", "color": "#FFFF00"},
{"title": "validation", "color": "#FF00FF"}
]
}
}'
echo ""
echo "Done"