@wavyx/pdcli 0.1.0 → 0.3.0

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +60 -11
  3. package/oclif.manifest.json +7101 -354
  4. package/package.json +4 -1
  5. package/src/base-command.js +65 -7
  6. package/src/commands/activity/create.js +63 -0
  7. package/src/commands/activity/delete.js +39 -0
  8. package/src/commands/activity/get.js +2 -17
  9. package/src/commands/activity/update.js +89 -0
  10. package/src/commands/api.js +6 -2
  11. package/src/commands/auth/login.js +102 -7
  12. package/src/commands/auth/logout.js +2 -1
  13. package/src/commands/auth/status.js +61 -13
  14. package/src/commands/backup.js +53 -0
  15. package/src/commands/deal/create.js +65 -0
  16. package/src/commands/deal/delete.js +39 -0
  17. package/src/commands/deal/get.js +2 -19
  18. package/src/commands/deal/update.js +79 -0
  19. package/src/commands/file/download.js +35 -0
  20. package/src/commands/file/get.js +26 -0
  21. package/src/commands/file/list.js +40 -0
  22. package/src/commands/file/upload.js +42 -0
  23. package/src/commands/filter/get.js +26 -0
  24. package/src/commands/filter/list.js +43 -0
  25. package/src/commands/goal/list.js +37 -0
  26. package/src/commands/lead/create.js +58 -0
  27. package/src/commands/lead/delete.js +39 -0
  28. package/src/commands/lead/get.js +26 -0
  29. package/src/commands/lead/list.js +50 -0
  30. package/src/commands/lead/update.js +71 -0
  31. package/src/commands/note/create.js +42 -0
  32. package/src/commands/note/delete.js +39 -0
  33. package/src/commands/note/get.js +26 -0
  34. package/src/commands/note/list.js +49 -0
  35. package/src/commands/note/update.js +45 -0
  36. package/src/commands/org/create.js +42 -0
  37. package/src/commands/org/delete.js +39 -0
  38. package/src/commands/org/get.js +2 -17
  39. package/src/commands/org/update.js +57 -0
  40. package/src/commands/person/create.js +54 -0
  41. package/src/commands/person/delete.js +39 -0
  42. package/src/commands/person/get.js +2 -17
  43. package/src/commands/person/update.js +69 -0
  44. package/src/commands/pipeline/get.js +26 -0
  45. package/src/commands/pipeline/list.js +37 -0
  46. package/src/commands/product/create.js +62 -0
  47. package/src/commands/product/delete.js +39 -0
  48. package/src/commands/product/get.js +26 -0
  49. package/src/commands/product/list.js +45 -0
  50. package/src/commands/product/update.js +77 -0
  51. package/src/commands/project/create.js +48 -0
  52. package/src/commands/project/delete.js +39 -0
  53. package/src/commands/project/get.js +26 -0
  54. package/src/commands/project/list.js +39 -0
  55. package/src/commands/project/update.js +63 -0
  56. package/src/commands/stage/get.js +26 -0
  57. package/src/commands/stage/list.js +41 -0
  58. package/src/commands/webhook/create.js +75 -0
  59. package/src/commands/webhook/delete.js +39 -0
  60. package/src/commands/webhook/list.js +33 -0
  61. package/src/lib/auth.js +227 -3
  62. package/src/lib/backup.js +122 -0
  63. package/src/lib/client.js +96 -6
  64. package/src/lib/confirm.js +10 -0
  65. package/src/lib/entity-view.js +42 -0
  66. package/src/lib/input.js +110 -0
  67. package/src/lib/keychain.js +47 -0
  68. package/src/lib/output/csv.js +26 -0
  69. package/src/lib/output/index.js +9 -1
  70. package/src/lib/output/yaml.js +9 -0
package/CHANGELOG.md CHANGED
@@ -4,7 +4,42 @@ All notable changes to `pdcli` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/); versions follow
5
5
  [SemVer](https://semver.org/).
6
6
 
7
- ## [Unreleased]
7
+ ## [0.3.0] - 2026-06-04
8
+
9
+ ### Added
10
+
11
+ - Full entity surface: `lead` (v1, UUID ids), `note`, `file`
12
+ (list/get/download/upload), `filter`, `webhook` (defaults to v2 payloads),
13
+ `goal`, `pipeline`/`stage`, and `project` (v2) topics.
14
+ - Output formats everywhere: `--output yaml|csv` join `table|json`; `--jq`
15
+ expression filtering (lazy-loaded native jq); `--fields` column selection.
16
+ - `pdcli backup` — full-account export to a JSON tree (18 resources), with a
17
+ manifest checkpoint after every resource and `--resume` to continue
18
+ interrupted runs.
19
+ - Client: binary downloads and multipart uploads (files API), host-locked
20
+ like every other request.
21
+
22
+ ## [0.2.0] - 2026-06-04
23
+
24
+ ### Added
25
+
26
+ - Write paths for core CRM: `deal|person|org|activity create/update/delete`
27
+ (v2 PATCH semantics — only provided fields change). Destructive deletes
28
+ prompt unless `--yes`.
29
+ - Custom-field input resolution: repeatable `--field "Name=Value"` resolves
30
+ human field names to hash keys and option labels to IDs (enum, set, and
31
+ numeric coercion); `--body` accepts raw JSON (typed flags win).
32
+ - `product` topic: `list/get/create/update/delete` with `--price`/`--currency`
33
+ pairs.
34
+ - OAuth 2.0: `auth login --oauth` (browser authorization-code flow against
35
+ your own Developer Hub app). Access/refresh tokens, `api_domain`, and the
36
+ client secret are stored only in the OS keychain; access tokens refresh
37
+ automatically on expiry and on 401. `auth status` shows mode and expiry;
38
+ `auth logout` clears both auth modes.
39
+ - `activity create/update --person` maps to a primary participant
40
+ (`person_id` is read-only on v2 activity writes).
41
+
42
+ ## [0.1.0] - 2026-06-03
8
43
 
9
44
  ### Added
10
45
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Command-line interface for [Pipedrive](https://www.pipedrive.com/) — fast, scriptable, built for terminals, CI pipelines, and AI agents.
4
4
 
5
- > **Status: pre-release (v0.1 in development).** Not affiliated with or endorsed by Pipedrive.
5
+ > Not affiliated with or endorsed by Pipedrive.
6
6
 
7
7
  ## Install
8
8
 
@@ -10,22 +10,71 @@ Command-line interface for [Pipedrive](https://www.pipedrive.com/) — fast, scr
10
10
  npm install -g @wavyx/pdcli
11
11
  ```
12
12
 
13
- ## Quick start
13
+ ## Authenticate
14
14
 
15
15
  ```bash
16
- pdcli auth login # company domain + API token (stored in your OS keychain)
17
- pdcli user me
18
- pdcli deal list --limit 10
19
- pdcli deal list --output json | jq '.[].id'
20
- pdcli field list deal # custom fields with their hash keys
16
+ pdcli auth login # personal API token (app.pipedrive.com/settings/api)
17
+ pdcli auth login --oauth # OAuth 2.0 via your own Developer Hub app
18
+ pdcli auth status
19
+ ```
20
+
21
+ Credentials live **only in your OS keychain** — never in plaintext on disk. OAuth
22
+ access tokens refresh automatically. CI/scripts can use env vars instead:
23
+ `PDCLI_COMPANY_DOMAIN=acme PDCLI_API_TOKEN=... pdcli deal list`
24
+
25
+ ## Read
26
+
27
+ ```bash
28
+ pdcli deal list --status open --limit 20
29
+ pdcli deal get 42
30
+ pdcli person list --org 7 --jq '.[].id'
31
+ pdcli activity list --todo
32
+ pdcli lead list
33
+ pdcli note list --deal 42
34
+ pdcli pipeline list && pdcli stage list --pipeline 1
21
35
  pdcli search "acme"
22
- pdcli api GET /api/v1/currencies # raw, host-locked escape hatch
36
+ pdcli field list deal # custom fields with their hash keys
37
+ ```
38
+
39
+ Output everywhere: `--output table|json|yaml|csv`, `--jq '<expr>'`, `--fields id,name`.
40
+
41
+ ## Write
42
+
43
+ ```bash
44
+ pdcli deal create --title "Acme renewal" --value 5000 --currency EUR --stage 3
45
+ pdcli deal update 42 --status won
46
+ pdcli activity create --subject "Follow up" --type call --due-date 2026-06-10 --deal 42
47
+ pdcli product create --name "Consulting" --price 150 --currency EUR
48
+ pdcli deal delete 42 # asks first; --yes to skip
49
+ ```
50
+
51
+ Custom fields by **human name** — labels and option IDs resolve automatically:
52
+
53
+ ```bash
54
+ pdcli deal create --title "Sized" --field "Deal Size=Large" --field "Score=4.5"
55
+ pdcli deal update 42 --body '{"probability":75}' # raw JSON escape hatch
56
+ ```
57
+
58
+ ## Files, webhooks, backup
59
+
60
+ ```bash
61
+ pdcli file upload ./contract.pdf --deal 42
62
+ pdcli file download 15 --out ./contract.pdf
63
+ pdcli webhook create --url https://ci.example.com/hook --event-action create --event-object deal
64
+ pdcli backup --dir ./pipedrive-backup # full account → JSON tree, --resume to continue
65
+ ```
66
+
67
+ ## Anything else
68
+
69
+ ```bash
70
+ pdcli api GET /api/v2/pipelines # raw, host-locked to YOUR domain
71
+ pdcli api POST /api/v2/deals --body '{"title":"Raw deal"}'
72
+ pdcli doctor # diagnose auth/keychain/connectivity
23
73
  ```
24
74
 
25
- - Token lives **only** in the OS keychain never in plaintext on disk.
26
- - `--output table|json` on every command; table in a TTY, JSON when piped.
75
+ - `--output table|json|yaml|csv` everywhere; table in a TTY, JSON when piped.
27
76
  - Deterministic [sysexits](https://man.freebsd.org/cgi/man.cgi?query=sysexits) exit codes for scripting.
28
- - CI: `PDCLI_COMPANY_DOMAIN=acme PDCLI_API_TOKEN=... pdcli deal list`
77
+ - Full reference: [docs/commands.md](docs/commands.md) (generated from the CLI manifest).
29
78
 
30
79
  ## License
31
80