-
Notifications
You must be signed in to change notification settings - Fork 0
fix: update workspace schema exporting endpoint #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@calycode/core": minor | ||
| "@calycode/cli": minor | ||
| --- | ||
|
|
||
| fix: **BREAKING CHANGE** fixing a breaking change in the Xano Metadata API for the workspace/{workspace_id}/export-schema endpoint causing the repo and internal docs generator commands to fail |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -291,16 +291,21 @@ export const nodeConfigStorage: ConfigStorage = { | |
| // Extract with tar | ||
| await x({ file: tarGzPath, cwd: tempDir }); | ||
|
|
||
| // Read all files in tempDir | ||
| const files = await fs.promises.readdir(tempDir); | ||
| for (const file of files) { | ||
| if (file.endsWith('.yaml')) { | ||
| result[file] = await fs.promises.readFile(join(tempDir, file)); | ||
| const entries = await fs.promises.readdir(tempDir, { recursive: true }); | ||
|
|
||
| for (const file of entries) { | ||
| // Check for both extensions | ||
| if (file.endsWith('.yaml') || file.endsWith('.json')) { | ||
| const fullPath = join(tempDir, file); | ||
| // Ensure we are reading a file, not a directory that happens to end in .json | ||
| const stat = await fs.promises.stat(fullPath); | ||
| if (stat.isFile()) { | ||
| result[file] = await fs.promises.readFile(fullPath); | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+294
to
306
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd -t f 'package.json' --exec jq -r '.engines.node // "not specified"' {} \;Repository: calycode/xano-tools Length of output: 182 🏁 Script executed: # Check the actual code at the specified lines in the file
cat -n packages/cli/src/node-config-storage.ts | sed -n '294,306p'Repository: calycode/xano-tools Length of output: 741 🏁 Script executed: # Get more context around the tarExtract method to understand the full implementation
cat -n packages/cli/src/node-config-storage.ts | sed -n '280,315p'Repository: calycode/xano-tools Length of output: 1472 🏁 Script executed: cat packages/cli/package.json | jq '.engines.node // "not specified"'Repository: calycode/xano-tools Length of output: 73 🏁 Script executed: # Check root package.json if it exists
if [ -f package.json ]; then cat package.json | jq '.engines.node // "not specified"'; fiRepository: calycode/xano-tools Length of output: 78 🌐 Web query:
💡 Result: The fs.promises.readdir({ recursive: true }) option was added in Node.js v20.1.0 and backported to v18.17.0 — so you need Node >= 18.17.0 (or any v20.1.0+ release). [1][2] Sources: Node.js API docs. [1] [2] Update minimum Node.js version or refactor The Either:
🤖 Prompt for AI Agents |
||
| } finally { | ||
| // Clean up tempDir here | ||
| await fs.promises.rm(tempDir, { recursive: true }); | ||
| await fs.promises.rm(tempDir, { recursive: true, force: true }); | ||
| } | ||
|
|
||
| return result; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistency:
.ymlextension not supported in fetch path.This code correctly handles
.ymlextension (line 114), butpackages/utils/src/methods/fetch-and-extract-yaml.tsat line 50 only checks for.jsonand.yamlextensions. This means:.ymlworks ✓.ymlfail ✗For consistency, the fetch utility should also check for
.yml:This can be combined with the priority fix suggested earlier in
fetch-and-extract-yaml.ts.