@opsrev/acculynx-cli 1.7.0 → 1.8.1
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 +0 -105
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,26 +20,12 @@ cp .env.example .env
|
|
|
20
20
|
|
|
21
21
|
Your `.env` is gitignored and will never be committed.
|
|
22
22
|
|
|
23
|
-
### Official API
|
|
24
|
-
|
|
25
23
|
| Env Var | Flag | Description |
|
|
26
24
|
|---------|------|-------------|
|
|
27
25
|
| `ACCULYNX_API_KEY` | `--api-key` | AccuLynx API key (required) |
|
|
28
26
|
|
|
29
27
|
API keys are created by your AccuLynx account administrator under Account Settings.
|
|
30
28
|
|
|
31
|
-
### Unofficial Web API
|
|
32
|
-
|
|
33
|
-
The `unofficial` commands use cookie-based authentication against AccuLynx's internal web APIs. These provide access to features not available in the official API (job documents, messages, etc.).
|
|
34
|
-
|
|
35
|
-
| Env Var | Flag | Description |
|
|
36
|
-
|---------|------|-------------|
|
|
37
|
-
| `ACCULYNX_EMAIL` | `--email` | Your AccuLynx login email |
|
|
38
|
-
| `ACCULYNX_PASSWORD` | `--password` | Your AccuLynx password |
|
|
39
|
-
| `ACCULYNX_COMPANY_ID` | `--company-id` | Company GUID from location selector |
|
|
40
|
-
|
|
41
|
-
> **Note:** These endpoints are reverse-engineered from the AccuLynx web app and may break without notice.
|
|
42
|
-
|
|
43
29
|
## Commands
|
|
44
30
|
|
|
45
31
|
```
|
|
@@ -68,95 +54,6 @@ acculynx estimates section <estimateId> <secId> # Get section details
|
|
|
68
54
|
acculynx estimates items <estimateId> <secId> # List items in a section
|
|
69
55
|
```
|
|
70
56
|
|
|
71
|
-
### Unofficial commands
|
|
72
|
-
|
|
73
|
-
Requires `ACCULYNX_EMAIL`, `ACCULYNX_PASSWORD`, and `ACCULYNX_COMPANY_ID` in your `.env` (or passed as flags).
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
acculynx unofficial companies # List available companies (discover your company ID)
|
|
77
|
-
acculynx unofficial login # Authenticate and cache session
|
|
78
|
-
acculynx unofficial logout # Remove cached session
|
|
79
|
-
acculynx unofficial sessions # List cached sessions
|
|
80
|
-
acculynx unofficial documents list <jobId> # List all document folders/files for a job
|
|
81
|
-
acculynx unofficial documents download <jobId> <fileId> [--output ./file.pdf] # Download a document
|
|
82
|
-
acculynx unofficial messages list <jobId> # List all messages/comments for a job
|
|
83
|
-
acculynx unofficial messages list <jobId> --type Email # Filter by type: Comment, Email, or Signatures
|
|
84
|
-
acculynx unofficial messages list <jobId> --count-only # Get message count only
|
|
85
|
-
acculynx unofficial messages post <jobId> <message> # Post a comment to a job
|
|
86
|
-
acculynx unofficial messages post <jobId> <message> --notify <userId,...> # Post and notify users
|
|
87
|
-
acculynx unofficial milestones list <jobId> # List workflow milestones/statuses for a job
|
|
88
|
-
acculynx unofficial milestones set <jobId> <status> # Set a job's milestone/status by name
|
|
89
|
-
acculynx unofficial milestones set <jobId> <status> --message "note" # Set with comment
|
|
90
|
-
acculynx unofficial jobs list # List jobs (unofficial)
|
|
91
|
-
acculynx unofficial jobs list --status <name> # Filter by workflow status name
|
|
92
|
-
acculynx unofficial jobs list --milestone <name> # Filter by milestone name
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
#### Messages
|
|
96
|
-
|
|
97
|
-
List all messages, comments, and emails on a job. HTML email content is automatically converted to lightweight markdown (headers, links, lists preserved; images and styles stripped) for clean AI agent consumption.
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
acculynx unofficial messages list <jobId> # all messages, newest first
|
|
101
|
-
acculynx unofficial messages list <jobId> --sort "createdDate|asc" # oldest first
|
|
102
|
-
acculynx unofficial messages list <jobId> --type Email # only emails
|
|
103
|
-
acculynx unofficial messages list <jobId> --count-only # just the count
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Post a comment to a job, optionally notifying (tagging) users:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
acculynx unofficial messages post <jobId> "Your message here"
|
|
110
|
-
acculynx unofficial messages post <jobId> "Check this out" --notify "userId1,userId2"
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
User IDs for `--notify` come from the official users API (`/api/v2/users`).
|
|
114
|
-
|
|
115
|
-
#### Milestones
|
|
116
|
-
|
|
117
|
-
AccuLynx workflows have milestones (Lead, Prospect, Approved, etc.) that contain custom statuses (Estimate Sent, Contract Signed, etc.). The official API only filters by top-level milestones. The unofficial milestones commands let you work with the granular workflow statuses.
|
|
118
|
-
|
|
119
|
-
List all milestones and their statuses for a job:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
acculynx unofficial milestones list <jobId>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Set a job to a specific workflow status by name (case-insensitive):
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
acculynx unofficial milestones set <jobId> "Estimate Sent"
|
|
129
|
-
acculynx unofficial milestones set <jobId> "OpsRev: Estimate Ready for Review"
|
|
130
|
-
acculynx unofficial milestones set <jobId> "Contract Signed" --message "Moving to contract phase"
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
If the status name doesn't match, the command returns the list of available statuses.
|
|
134
|
-
|
|
135
|
-
#### Jobs (unofficial)
|
|
136
|
-
|
|
137
|
-
The official `jobs list --milestones` filter only accepts top-level milestone names (Lead, Prospect, Approved, etc.). The unofficial `jobs list` command supports filtering by custom workflow status names.
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
acculynx unofficial jobs list --status "Estimate Sent" # jobs in a specific status
|
|
141
|
-
acculynx unofficial jobs list --status "OpsRev: Estimate Ready for Review" # custom status names work
|
|
142
|
-
acculynx unofficial jobs list --milestone Prospect # filter by milestone
|
|
143
|
-
acculynx unofficial jobs list --status "Estimate Sent" --query "Smith" # combine with search
|
|
144
|
-
acculynx unofficial jobs list --sort "lastTouched|desc" --page 2 # sort and paginate
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
The `--status` flag resolves the status name (case-insensitive) to a GUID via the company workflow configuration, then queries the internal job list API. If the name doesn't match, the command returns the list of available statuses.
|
|
148
|
-
|
|
149
|
-
**Getting started:** If you don't know your company ID, run `companies` first -- it logs in and returns all companies available to your account:
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
npm run dev -- unofficial companies
|
|
153
|
-
# [{"id":"f104ba56-...","name":"My Roofing Co"},{"id":"7749e90f-...","name":"Sandbox"}]
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Copy the `id` into your `.env` as `ACCULYNX_COMPANY_ID`, then run `login` to cache the session.
|
|
157
|
-
|
|
158
|
-
Login caches session cookies to `~/.config/acculynx-cli/sessions/` so you only need to re-authenticate when the session expires. Multiple accounts/companies are supported -- each gets its own cached session.
|
|
159
|
-
|
|
160
57
|
### Pagination
|
|
161
58
|
|
|
162
59
|
All list commands default to **25 results**. Use `--limit <n>` for a custom count or `--all` to fetch everything:
|
|
@@ -220,8 +117,6 @@ npm run build # build to dist/
|
|
|
220
117
|
The `npm run dev` script automatically loads your `.env` file via Node's `--env-file` flag (Node 20.6+). Examples:
|
|
221
118
|
|
|
222
119
|
```bash
|
|
223
|
-
npm run dev -- unofficial login
|
|
224
|
-
npm run dev -- unofficial documents list <jobId>
|
|
225
120
|
npm run dev -- jobs list --limit 5
|
|
226
121
|
```
|
|
227
122
|
|
package/dist/index.js
CHANGED
|
@@ -343,8 +343,9 @@ registerJobsCommands(program, getClient);
|
|
|
343
343
|
registerContactsCommands(program, getClient);
|
|
344
344
|
registerEstimatesCommands(program, getClient);
|
|
345
345
|
try {
|
|
346
|
-
const
|
|
347
|
-
mod
|
|
346
|
+
const resolved = require2.resolve("@opsrev/acculynx-cli-unofficial");
|
|
347
|
+
const mod = await import(resolved);
|
|
348
|
+
mod.registerExtendedCommands(program);
|
|
348
349
|
} catch {
|
|
349
350
|
}
|
|
350
351
|
program.parseAsync().catch((err) => {
|