postgresdk 0.18.28 → 0.18.29
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 +5 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -547,6 +547,8 @@ pnpm dlx postgresdk@latest pull
|
|
|
547
547
|
|
|
548
548
|
The SDK files are written directly to your client project, giving you full TypeScript autocomplete and type safety.
|
|
549
549
|
|
|
550
|
+
**Stale file cleanup:** Both `generate` and `pull` automatically remove files that are no longer part of the SDK. In an interactive terminal you'll be prompted to confirm each deletion; use `--force` (or `-y`) to skip prompts. In non-interactive environments (CI), stale files are skipped with a warning unless `--force` is passed.
|
|
551
|
+
|
|
550
552
|
### Using the SDK
|
|
551
553
|
|
|
552
554
|
#### CRUD Operations
|
|
@@ -1014,6 +1016,7 @@ Commands:
|
|
|
1014
1016
|
|
|
1015
1017
|
Options:
|
|
1016
1018
|
-c, --config <path> Path to config file (default: postgresdk.config.ts)
|
|
1019
|
+
--force, -y Delete stale files without prompting (generate & pull)
|
|
1017
1020
|
|
|
1018
1021
|
Init subcommands/flags:
|
|
1019
1022
|
init pull Generate pull-only config (alias for --sdk)
|
|
@@ -1026,7 +1029,9 @@ Examples:
|
|
|
1026
1029
|
npx postgresdk@latest init --api # API-side config
|
|
1027
1030
|
npx postgresdk@latest generate
|
|
1028
1031
|
npx postgresdk@latest generate -c custom.config.ts
|
|
1032
|
+
npx postgresdk@latest generate --force # Skip stale file prompts
|
|
1029
1033
|
npx postgresdk@latest pull --from=https://api.com --output=./src/sdk
|
|
1034
|
+
npx postgresdk@latest pull --from=https://api.com --output=./src/sdk --force
|
|
1030
1035
|
```
|
|
1031
1036
|
|
|
1032
1037
|
### Generated Tests
|
package/dist/cli.js
CHANGED
|
@@ -1433,7 +1433,7 @@ function parseForceFlag(args) {
|
|
|
1433
1433
|
async function confirmAndDeleteStaleFiles(staleFiles, force) {
|
|
1434
1434
|
if (staleFiles.length === 0)
|
|
1435
1435
|
return { deleted: 0, skipped: 0, filesDeleted: [] };
|
|
1436
|
-
if (!force && !process.
|
|
1436
|
+
if (!force && !process.stdin.isTTY) {
|
|
1437
1437
|
console.log(`⚠️ ${staleFiles.length} stale file(s) not deleted (non-interactive shell). Re-run with --force to delete.`);
|
|
1438
1438
|
return { deleted: 0, skipped: staleFiles.length, filesDeleted: [] };
|
|
1439
1439
|
}
|
package/dist/index.js
CHANGED
|
@@ -1432,7 +1432,7 @@ function parseForceFlag(args) {
|
|
|
1432
1432
|
async function confirmAndDeleteStaleFiles(staleFiles, force) {
|
|
1433
1433
|
if (staleFiles.length === 0)
|
|
1434
1434
|
return { deleted: 0, skipped: 0, filesDeleted: [] };
|
|
1435
|
-
if (!force && !process.
|
|
1435
|
+
if (!force && !process.stdin.isTTY) {
|
|
1436
1436
|
console.log(`⚠️ ${staleFiles.length} stale file(s) not deleted (non-interactive shell). Re-run with --force to delete.`);
|
|
1437
1437
|
return { deleted: 0, skipped: staleFiles.length, filesDeleted: [] };
|
|
1438
1438
|
}
|