@eyeauras/youtrack-cli 0.5.6 → 0.6.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.
- package/README.md +78 -72
- package/dist/src/agile-commands.d.ts.map +1 -1
- package/dist/src/agile-commands.js +8 -9
- package/dist/src/agile-commands.js.map +1 -1
- package/dist/src/agile.d.ts.map +1 -1
- package/dist/src/agile.js +9 -15
- package/dist/src/agile.js.map +1 -1
- package/dist/src/article-extras-commands.d.ts.map +1 -1
- package/dist/src/article-extras-commands.js +13 -12
- package/dist/src/article-extras-commands.js.map +1 -1
- package/dist/src/articles-commands.d.ts.map +1 -1
- package/dist/src/articles-commands.js +15 -13
- package/dist/src/articles-commands.js.map +1 -1
- package/dist/src/articles.d.ts +3 -3
- package/dist/src/articles.d.ts.map +1 -1
- package/dist/src/articles.js +19 -19
- package/dist/src/articles.js.map +1 -1
- package/dist/src/attachment-download-commands.d.ts.map +1 -1
- package/dist/src/attachment-download-commands.js +10 -9
- package/dist/src/attachment-download-commands.js.map +1 -1
- package/dist/src/attachment-download.d.ts +7 -3
- package/dist/src/attachment-download.d.ts.map +1 -1
- package/dist/src/attachment-download.js +33 -40
- package/dist/src/attachment-download.js.map +1 -1
- package/dist/src/attachment-form.js +3 -3
- package/dist/src/attachment-form.js.map +1 -1
- package/dist/src/bundle-values-commands.d.ts.map +1 -1
- package/dist/src/bundle-values-commands.js +21 -18
- package/dist/src/bundle-values-commands.js.map +1 -1
- package/dist/src/cli-support.d.ts +5 -5
- package/dist/src/cli-support.d.ts.map +1 -1
- package/dist/src/cli-support.js +28 -26
- package/dist/src/cli-support.js.map +1 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +55 -39
- package/dist/src/cli.js.map +1 -1
- package/dist/src/client.d.ts +5 -2
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +66 -49
- package/dist/src/client.js.map +1 -1
- package/dist/src/field-catalog-commands.d.ts.map +1 -1
- package/dist/src/field-catalog-commands.js +19 -16
- package/dist/src/field-catalog-commands.js.map +1 -1
- package/dist/src/group-directory-commands.d.ts.map +1 -1
- package/dist/src/group-directory-commands.js +17 -16
- package/dist/src/group-directory-commands.js.map +1 -1
- package/dist/src/issue-attachments-commands.d.ts.map +1 -1
- package/dist/src/issue-attachments-commands.js +9 -8
- package/dist/src/issue-attachments-commands.js.map +1 -1
- package/dist/src/issue-batch.d.ts +3 -1
- package/dist/src/issue-batch.d.ts.map +1 -1
- package/dist/src/issue-batch.js +19 -14
- package/dist/src/issue-batch.js.map +1 -1
- package/dist/src/issue-context-commands.d.ts.map +1 -1
- package/dist/src/issue-context-commands.js +13 -12
- package/dist/src/issue-context-commands.js.map +1 -1
- package/dist/src/issue-context.d.ts.map +1 -1
- package/dist/src/issue-context.js +9 -13
- package/dist/src/issue-context.js.map +1 -1
- package/dist/src/issue-fields-commands.d.ts.map +1 -1
- package/dist/src/issue-fields-commands.js +10 -9
- package/dist/src/issue-fields-commands.js.map +1 -1
- package/dist/src/issue-fields.d.ts +2 -4
- package/dist/src/issue-fields.d.ts.map +1 -1
- package/dist/src/issue-fields.js +39 -100
- package/dist/src/issue-fields.js.map +1 -1
- package/dist/src/issue-query-commands.d.ts.map +1 -1
- package/dist/src/issue-query-commands.js +15 -14
- package/dist/src/issue-query-commands.js.map +1 -1
- package/dist/src/issue-query.d.ts.map +1 -1
- package/dist/src/issue-query.js +7 -10
- package/dist/src/issue-query.js.map +1 -1
- package/dist/src/issue-relations-commands.d.ts.map +1 -1
- package/dist/src/issue-relations-commands.js +17 -16
- package/dist/src/issue-relations-commands.js.map +1 -1
- package/dist/src/issue-relations.js +2 -2
- package/dist/src/issue-relations.js.map +1 -1
- package/dist/src/issue-time-commands.d.ts.map +1 -1
- package/dist/src/issue-time-commands.js +12 -11
- package/dist/src/issue-time-commands.js.map +1 -1
- package/dist/src/issue-time.d.ts.map +1 -1
- package/dist/src/issue-time.js +16 -19
- package/dist/src/issue-time.js.map +1 -1
- package/dist/src/presentation.d.ts +59 -0
- package/dist/src/presentation.d.ts.map +1 -0
- package/dist/src/presentation.js +467 -0
- package/dist/src/presentation.js.map +1 -0
- package/dist/src/time-settings-commands.d.ts.map +1 -1
- package/dist/src/time-settings-commands.js +13 -11
- package/dist/src/time-settings-commands.js.map +1 -1
- package/dist/src/user-directory-commands.d.ts.map +1 -1
- package/dist/src/user-directory-commands.js +14 -12
- package/dist/src/user-directory-commands.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,17 +40,16 @@ The foundational read projections are:
|
|
|
40
40
|
|
|
41
41
|
REST reads support explicit `--fields <projection>`. Projection results retain the server's
|
|
42
42
|
field names, `$type` and nullable values; authentication always validates fixed `id,login`.
|
|
43
|
-
Offset collections use `--top 50 --skip 0` by default; top is a
|
|
43
|
+
Offset collections use `--top 50 --skip 0` by default; top is a nonnegative safe integer and skip a nonnegative safe integer.
|
|
44
44
|
Paging accepts unsigned decimal digits, including leading zeros; signs (including `-0`), whitespace,
|
|
45
45
|
fractions, exponents and unsafe integers reject. Invalid syntax, range and overflow now fail before
|
|
46
46
|
onboarding or credential access on CLI, execute and RPC. The static errors are
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
`--top must be a nonnegative safe decimal integer.` and
|
|
48
|
+
`--skip must be a nonnegative integer.`; they never include the supplied input.
|
|
49
49
|
Directly callable service methods retain their own range validation.
|
|
50
50
|
Each collection command makes one request, and rejects an oversized server page. Multi-page reads
|
|
51
|
-
happen only for the explicit `issues list --all` described below
|
|
52
|
-
|
|
53
|
-
are made. Issue IDs are encoded as opaque path segments, including readable IDs such as `DEMO-1`.
|
|
51
|
+
happen only for the explicit `issues list --all` described below. Issue writes send selectors
|
|
52
|
+
directly to the API without nested discovery requests. Issue IDs are encoded as opaque path segments, including readable IDs such as `DEMO-1`.
|
|
54
53
|
|
|
55
54
|
`issues list --all --max-results <n>` reads every page (`--top` is the page size, `--skip` the start)
|
|
56
55
|
with the same query and projection. Success means the selection is complete: the result is the
|
|
@@ -69,20 +68,35 @@ npm run youtrack -- issues comments list DEMO-1 --top 3 --profile youtrack-dev
|
|
|
69
68
|
Handlers return domain values for human, `--json` and persistent `--json-rpc` output.
|
|
70
69
|
Empty collections are `[]`. Signed/credential-bearing URLs and the active bearer token are
|
|
71
70
|
scrubbed recursively, including explicitly projected nested fields. Unsigned URLs remain
|
|
72
|
-
unchanged.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
unchanged. An HTTP error status fails with Core's `HttpError` (`YouTrack answered HTTP 404.`,
|
|
72
|
+
codes `http.notFound`, `http.unauthorized` with an `auth login` follow-up, `http.rateLimited` with
|
|
73
|
+
safe Retry-After text, and so on), never with raw server errors or authentication material.
|
|
74
|
+
Remote mutations require the Update gate, described below. The ReadOnly download and export
|
|
75
|
+
commands write only their explicitly requested local file beneath profile AppData.
|
|
76
|
+
|
|
77
|
+
### Reading output
|
|
78
|
+
|
|
79
|
+
Human mode is for people; `--json` is the machine view. Every everyday command has a view built
|
|
80
|
+
from Core's formats: lists such as `issues list`, `project list`, `article list` and `issues
|
|
81
|
+
comments list` are tables (`ISSUE SUMMARY PROJECT STATE UPDATED`), `issues get` and
|
|
82
|
+
`article get` are records with a description or content section and a `Next:` command, tags and
|
|
83
|
+
link groups are one line each, and a mutation names the object it changed (`Created DEMO-99 · New
|
|
84
|
+
issue`, `Removed tag 6-1 from DEMO-7.`). A table ends with `More results: --skip <n>` only when
|
|
85
|
+
the page came back full. Long work prints one progress line per page (`issues list --all`), per
|
|
86
|
+
failed batch row and at the start of a download on stderr, never under `--json`. An explicit
|
|
87
|
+
`--fields` projection prints the generic `key: value` shape, so you see exactly the fields you
|
|
88
|
+
asked for. Root help groups the commands into Everyday, Reference and Configuration, with examples.
|
|
76
89
|
|
|
77
90
|
JSON responses have no CLI byte ceiling. Invalid/truncated identity transfer lengths, stream failure
|
|
78
|
-
or cancellation fail with `
|
|
91
|
+
or cancellation fail with `The response stream failed or was cancelled.` without response content.
|
|
79
92
|
Compressed wire length is syntax-checked but not compared with decoded size. HTTP status,
|
|
80
93
|
Retry-After, empty/null mutation and UTF-8 BOM behavior are unchanged. No request is retried
|
|
81
94
|
automatically. Runtime memory and service limits still apply.
|
|
82
95
|
|
|
83
96
|
## URL and token input
|
|
84
97
|
|
|
85
|
-
Copy the service base address, for example `https://youtrack.example.test/youtrack/`. Include any context path and port; omit `/api`, issue pages and query strings. HTTP and HTTPS are supported.
|
|
98
|
+
Copy the service base address, for example `https://youtrack.example.test/youtrack/`. Include any context path and port; omit `/api`, issue pages and query strings. HTTP and HTTPS are supported. Context segments named `api`, `app/rest`, `admin` or `issues` are
|
|
99
|
+
valid deployment contexts; the CLI appends its own service endpoints to the configured base.
|
|
86
100
|
Create/copy a permanent token in your YouTrack profile with the **YouTrack** service scope.
|
|
87
101
|
See the [permanent-token guide](https://www.jetbrains.com/help/youtrack/devportal/Manage-Permanent-Token.html). Paste only its value: `FICTIONAL_TOKEN_VALUE` is a fictional example.
|
|
88
102
|
Do not include `Bearer `, `Authorization:`, or surrounding quotes. The same guidance appears in
|
|
@@ -90,7 +104,7 @@ Do not include `Bearer `, `Authorization:`, or surrounding quotes. The same guid
|
|
|
90
104
|
|
|
91
105
|
New URL/token input trims outer whitespace, including pasted CRLF. URL trailing slashes are
|
|
92
106
|
normalized without losing the context path; internal token symbols remain unchanged. Empty input,
|
|
93
|
-
headers/quoted tokens and
|
|
107
|
+
headers/quoted tokens and malformed transport URLs fail with a safe hint before authentication or
|
|
94
108
|
persistence. This applies to onboarding, profile URL writes, login, environment/stdin candidates,
|
|
95
109
|
`execute` and JSON-RPC (which never prompts). Existing data is retained; use `profile set` or
|
|
96
110
|
`profile configure` to correct an old URL. Failed configure input preserves working credentials.
|
|
@@ -160,25 +174,20 @@ This documentation does not enable it automatically. The local proof remains Rea
|
|
|
160
174
|
|
|
161
175
|
| Command | Required `--body` JSON object |
|
|
162
176
|
|---|---|
|
|
163
|
-
| `issues create` | `project`
|
|
164
|
-
| `issues update <issueID>` |
|
|
165
|
-
| `issues comments add <issueID>` |
|
|
177
|
+
| `issues create` | Native `project` object and required `summary` (string or null); additional native fields are preserved |
|
|
178
|
+
| `issues update <issueID>` | Native issue JSON; known supplied field types are checked |
|
|
179
|
+
| `issues comments add <issueID>` | Native comment JSON; text may be a string or null |
|
|
166
180
|
|
|
167
181
|
Missing `--body` and malformed JSON fail before profile onboarding or credential access.
|
|
168
182
|
Description and comment text preserve multiline Markdown. Omitted fields remain unchanged;
|
|
169
|
-
`description: null` clears the description.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
`customFields` is
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
exactly before the write: `project.shortName` by one project read (case-insensitive match
|
|
178
|
-
required), field `name` (case-sensitive) against all fields of the project (create) or issue
|
|
179
|
-
(update). Zero or several matches fail before the POST; `id` entries need no lookup. Value
|
|
180
|
-
selectors (`id`, `name`, `login` for users) are resolved by YouTrack inside the request; `$type`
|
|
181
|
-
is never inferred and nothing is cached.
|
|
183
|
+
`description: null` clears the description. Additional fields, including visibility and notification controls, reach the API unchanged.
|
|
184
|
+
The server decides applicability and required fields.
|
|
185
|
+
|
|
186
|
+
`customFields` is an array sent in the same single POST; empty arrays, repeated entries and
|
|
187
|
+
multiple identity attributes are preserved. Each entry supplies its `$type`; future types and native
|
|
188
|
+
metadata are forwarded. Known value types are checked as below. YouTrack resolves project, field
|
|
189
|
+
and value selectors inside the write; the CLI performs no catalog reads or ID rewriting.
|
|
190
|
+
`$type` is never inferred and nothing is cached.
|
|
182
191
|
|
|
183
192
|
```powershell
|
|
184
193
|
npm run youtrack -- issues create --profile youtrack-dev --body '{"project":{"shortName":"DEMO"},"summary":"Example","customFields":[{"$type":"SingleEnumIssueCustomField","name":"Priority","value":{"name":"Major"}}]}'
|
|
@@ -231,8 +240,8 @@ for exact arguments and permission categories; no endpoint, header or arbitrary
|
|
|
231
240
|
|
|
232
241
|
`commands assist`, `search assist` and `issues count` use POST on the wire but remain ReadOnly:
|
|
233
242
|
they compute suggestions or counts without applying changes. Assist is not a dry run or a guarantee
|
|
234
|
-
that a later command will succeed. Required `--query` is preserved exactly; optional `--caret`
|
|
235
|
-
|
|
243
|
+
that a later command will succeed. Required `--query` is preserved exactly; optional `--caret` uses the API's signed Int type; the server validates position semantics.
|
|
244
|
+
`commands apply` requires comma-separated explicit issue IDs via
|
|
236
245
|
`--issues`, never an implicit search expansion. It has no run-as or silent mode. Count returns the
|
|
237
246
|
server's `count`, including `-1` (pending) or `null`; the CLI never polls automatically.
|
|
238
247
|
|
|
@@ -246,30 +255,31 @@ preserve polymorphic values, including scalar, null and array values. `issues fi
|
|
|
246
255
|
an explicit `$type` and `value`: single/multi Enum, Build, Version, Owned, Group and User types;
|
|
247
256
|
State, Simple, Date, Period and Text types. References use explicit identity selectors (`id`,
|
|
248
257
|
`name`, and `login` for users); `fields set` performs no lookup of its own. Single values can use `null`,
|
|
249
|
-
multi values use `[]` to clear. Period values accept
|
|
258
|
+
multi values use `[]` to clear. Period values accept signed 32-bit integer `minutes`
|
|
250
259
|
and/or `presentation`; dates use
|
|
251
260
|
integer Unix milliseconds. Text values use `{ "text": "..." }`. StateMachine fields instead
|
|
252
261
|
require `$type` and `{ "event": { "id": "..." } }`; inspect `possibleEvents` explicitly with
|
|
253
|
-
`--fields` before selecting a transition.
|
|
262
|
+
`--fields` before selecting a transition. Additional native fields and future `$type` values reach the API unchanged, including readback
|
|
263
|
+
metadata alongside an event. Known value types still validate JSON/scalar structure.
|
|
254
264
|
|
|
255
|
-
Relationship additions accept
|
|
265
|
+
Relationship additions accept a native reference, such as `{ "id": "TARGET_ID" }`, and preserve metadata. Link IDs include the explicit
|
|
256
266
|
direction returned by YouTrack. `issues links remove <issueID> <linkID> <targetIssueID>` unlinks
|
|
257
267
|
the target; `issues tags remove <issueID> <tagID>` unassigns the tag. Neither deletes the issue or
|
|
258
|
-
tag itself. Comment updates
|
|
268
|
+
tag itself. Comment updates preserve native fields, including nullable text, visibility and pinning.
|
|
259
269
|
|
|
260
|
-
Work-item creation requires `duration.minutes` (
|
|
270
|
+
Work-item creation requires `duration.minutes` (signed 32-bit integer) and/or string
|
|
261
271
|
`duration.presentation`. Both may be supplied; YouTrack interprets presentation text. Writable
|
|
262
272
|
fields are `duration`, `date`, `author`, `type`, `text`, `created` and `updated`. Dates/timestamps
|
|
263
273
|
use integer Unix milliseconds; `author` and `type` use `{ "id": "..." }` or `null`. Text may be
|
|
264
|
-
empty, multiline or null; `updated` may also be null. Updates
|
|
265
|
-
|
|
274
|
+
empty, multiline or null; `updated` may also be null. Updates preserve additional native fields and
|
|
275
|
+
leave omitted fields to the server. No client-side date, user or duration conversion is guessed. Work-item
|
|
266
276
|
writes accept `--fields`; only global `work-items list` supports `--query`. Other date/author
|
|
267
277
|
filters are outside this block. Time-tracking inspection defaults to `id,enabled`, without
|
|
268
278
|
expanding work items.
|
|
269
279
|
|
|
270
280
|
Attachment reads default to `id,name,size,mimeType`; explicit read projections still scrub signed
|
|
271
281
|
URLs. Upload requires one explicit `--file <path>` and sends one native multipart request, returning
|
|
272
|
-
metadata only. Missing/
|
|
282
|
+
metadata only. Missing/empty/NUL path syntax fails before onboarding. Regular-file and read
|
|
273
283
|
checks occur inside the Update handler before HTTP, so denied uploads do not inspect files.
|
|
274
284
|
Only the basename becomes the multipart filename; errors never echo local paths. No attachment
|
|
275
285
|
binary download or signed-URL follow-up was included in the first 50 operations; the separate
|
|
@@ -308,24 +318,20 @@ other metadata reads return one object. No new date, author, search or archive f
|
|
|
308
318
|
by these directory commands.
|
|
309
319
|
|
|
310
320
|
Sprint reads use an explicit board ID; the literal sprint ID `current` goes directly to the
|
|
311
|
-
same documented detail/update route. Create requires a
|
|
312
|
-
|
|
321
|
+
same documented detail/update route. Create requires a string `name`; update
|
|
322
|
+
preserves supplied native fields. Known fields include `name`, `goal`, `start`, `finish`,
|
|
313
323
|
`archived` and `isDefault`. Goal preserves empty/multiline text or null; dates are safe integer
|
|
314
324
|
Unix milliseconds or null; flags are booleans. Create additionally accepts
|
|
315
325
|
`previousSprint: { "id": "..." }`, which explicitly moves unresolved issues from that sprint.
|
|
316
|
-
It is never inferred
|
|
317
|
-
board issues go.
|
|
326
|
+
It is never inferred; the server validates its applicability. `isDefault: true` affects where matching new
|
|
327
|
+
board issues go. Additional native sprint properties are forwarded; separate agile mutations and deletion remain outside
|
|
318
328
|
this block. Reads and writes support `--fields`; there is no carryover lookup or polling.
|
|
319
329
|
|
|
320
|
-
Article create accepts
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
clears it. These narrow bodies exclude parent/hierarchy, visibility, reporter, stars, tags,
|
|
324
|
-
nested attachments/comments and comment pinning/reactions. The REST entities have additional
|
|
325
|
-
writable properties, but this CLI does not forward them. Article and comment reads/writes
|
|
330
|
+
Article create accepts a native project reference and nullable summary. Article and comment
|
|
331
|
+
updates preserve additional native fields, including parent, visibility and pinning. Known text
|
|
332
|
+
fields preserve multiline strings and documented null values; omission leaves API defaults in charge. Article and comment reads/writes
|
|
326
333
|
support `--fields`; article lists have no query flag. Article attachment transfer and hierarchy
|
|
327
|
-
reads are documented below.
|
|
328
|
-
deletion remain unsupported.
|
|
334
|
+
reads are documented below. Native body properties are validated by the API; separate deletion remains outside this command tree.
|
|
329
335
|
|
|
330
336
|
## Remaining bundles, article hierarchy and attachment transfer
|
|
331
337
|
|
|
@@ -344,41 +350,40 @@ grants permissions.
|
|
|
344
350
|
|
|
345
351
|
```powershell
|
|
346
352
|
npm run youtrack -- issues attachments download DEMO-1 1-1 --profile youtrack-dev
|
|
347
|
-
npm run youtrack -- issues attachments download DEMO-1 1-1 --
|
|
353
|
+
npm run youtrack -- issues attachments download DEMO-1 1-1 --output report.txt --max-bytes 1048576 --profile youtrack-dev
|
|
348
354
|
npm run youtrack -- article attachment download KB-A-1 7-1 --profile youtrack-dev
|
|
349
355
|
```
|
|
350
356
|
|
|
351
357
|
Issue and article attachment downloads first read the exact attachment's fixed metadata, then request only
|
|
352
|
-
its returned URL. The file request sends neither Authorization nor cookies
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
its returned URL. The file request sends neither Authorization nor cookies and follows normal HTTP redirects.
|
|
359
|
+
HTTP(S) URLs may use an external/CDN origin or another native file path; userinfo and raw
|
|
360
|
+
controls are rejected at the transport boundary. Signatures stay in memory and never
|
|
355
361
|
appear in metadata output, errors or the download result.
|
|
356
362
|
|
|
357
|
-
Files
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
file into `downloads`. Partial files are removed when their identities remain trusted. Output
|
|
363
|
+
Files default to the invocation working directory using the metadata filename. Unsafe or ambiguous
|
|
364
|
+
default filenames are rejected. `--output <path>` chooses a relative path against that working
|
|
365
|
+
directory or an absolute path. The parent must exist. Existing files and symlinks are never overwritten,
|
|
366
|
+
regardless of the selected profile. Downloads have no default byte ceiling; optional `--max-bytes`
|
|
367
|
+
bounds streamed bytes and Content-Length. Core stages bytes in a fresh private `.download-*` directory
|
|
368
|
+
beside the output file, then hard-links only the complete identity-checked file into place. Partial files are removed when their identities remain trusted. Output
|
|
364
369
|
contains only sanitized ID/name, local path, byte count and content type.
|
|
365
370
|
No binary data is printed. Publication uses an exclusive hard link; unsupported filesystems
|
|
366
371
|
fail without a copy/rename fallback. Existing links or junctions in the directory chain and detectable directory/staged/destination
|
|
367
372
|
replacement are rejected. Unknown replacement files are never removed. This protects
|
|
368
|
-
|
|
373
|
+
the output destination; it cannot prevent every malicious same-account replacement after the
|
|
369
374
|
last identity check. Errors report whether publication occurred and whether private staging cleanup
|
|
370
375
|
failed, without raw filesystem/service details. The local proof never invokes download or upload.
|
|
371
376
|
|
|
372
|
-
`article export <article> [--
|
|
373
|
-
URLs scrubbed like console output, as
|
|
377
|
+
`article export <article> [--output <path>]` (ReadOnly) saves the article content, with signed
|
|
378
|
+
URLs scrubbed like console output, as `<idReadable>.md` in the invocation working directory through the same no-overwrite
|
|
374
379
|
publication. Edit it and send it back with `article update <article> --body '{}' --content-file <path>`.
|
|
375
380
|
The result's `redacted: true` means the file contains `[redacted]` placeholders where console-output
|
|
376
381
|
scrubbing removed text (signed or credential-bearing URLs, undecodable URL-like text or the token);
|
|
377
382
|
sending it back unchanged would replace that text in YouTrack, so restore it first or edit that
|
|
378
383
|
article elsewhere.
|
|
379
|
-
The
|
|
380
|
-
|
|
381
|
-
|
|
384
|
+
The former `--name` option and `downloads list/delete/clean` commands are removed. Existing files
|
|
385
|
+
in profile AppData are left untouched; move or delete them explicitly if desired. New user outputs
|
|
386
|
+
are not owned by profile cleanup.
|
|
382
387
|
|
|
383
388
|
## Issue batches
|
|
384
389
|
|
|
@@ -389,8 +394,9 @@ with a header row. A row is `action` (`create`/`update`), `issue` (update only,
|
|
|
389
394
|
search) and the same body fields as `issues create/update`. CSV columns are `action`, `issue`,
|
|
390
395
|
`project.id`, `project.shortName`, `summary`, `description` and `customFields` (a JSON array cell);
|
|
391
396
|
an empty cell omits the field, so clearing needs JSON. CSV syntax errors and unknown or repeated
|
|
392
|
-
columns fail as a whole;
|
|
393
|
-
|
|
397
|
+
columns fail as a whole; malformed rows fail with the row number. Additional JSON row fields
|
|
398
|
+
are forwarded as native issue fields. Either way nothing
|
|
399
|
+
is written. The API resolves native selectors inside each row's single write.
|
|
394
400
|
|
|
395
401
|
Apply runs rows in order, one request per write plus exact selector reads, without retries,
|
|
396
402
|
rollback or compensation; a batch is not atomic. It stops at the first unsuccessful row unless
|
|
@@ -398,8 +404,8 @@ rollback or compensation; a batch is not atomic. It stops at the first unsuccess
|
|
|
398
404
|
(rejected before the write or with HTTP 4xx: not applied), `uncertain` (connectivity, 5xx or an
|
|
399
405
|
invalid response: it may have been applied) or `unattempted`; the overall `status` is `completed`
|
|
400
406
|
or `incomplete`, with counts. The command itself succeeds (exit code 0) once rows ran, so callers
|
|
401
|
-
must check `status`. `--failed-rows <
|
|
402
|
-
as a manifest
|
|
407
|
+
must check `status`. `--failed-rows <path.json>` saves the `failed` and `unattempted` rows
|
|
408
|
+
as a manifest at the requested path relative to the invocation working directory for deliberate resubmission; `uncertain` rows are left out and must
|
|
403
409
|
be checked in YouTrack first. A save failure is reported in `failedRows.error` without hiding row results.
|
|
404
410
|
|
|
405
411
|
## Compared with `yt` 0.22.2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agile-commands.d.ts","sourceRoot":"","sources":["../../src/agile-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agile-commands.d.ts","sourceRoot":"","sources":["../../src/agile-commands.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,qDAW7B,CAAC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { command } from "@eyeauras/cli-factory";
|
|
2
2
|
import { pagedRead, projectedBodyUpdate, projectedRead } from "./cli-support.js";
|
|
3
3
|
import { createSprint, getAgile, getSprint, listAgiles, listSprints, updateSprint } from "./agile.js";
|
|
4
|
+
import { agileRecord, agileTable, sprintRecord, sprintTable, sprintWritten } from "./presentation.js";
|
|
4
5
|
export const agileRootCommands = [
|
|
5
6
|
command("agile", "Inspect agile boards", [
|
|
6
|
-
pagedRead("list", "List
|
|
7
|
-
projectedRead("get <agile>", "
|
|
7
|
+
pagedRead("list", "List agile boards", listAgiles, agileTable),
|
|
8
|
+
projectedRead("get <agile>", "Show an agile board", getAgile, agileRecord),
|
|
8
9
|
]),
|
|
9
|
-
command("sprint", "Inspect and
|
|
10
|
-
pagedRead("list <agile>", "List
|
|
11
|
-
projectedRead("get <agile> <sprint>", "
|
|
12
|
-
projectedBodyUpdate("create <agile>", "Create
|
|
13
|
-
|
|
14
|
-
projectedBodyUpdate("update <agile> <sprint>", "Update supplied name/goal/start/finish/archived/isDefault; use current for the current sprint. " +
|
|
15
|
-
"isDefault: true automatically adds matching new issues; previousSprint is creation-only.", updateSprint),
|
|
10
|
+
command("sprint", "Inspect and manage sprints", [
|
|
11
|
+
pagedRead("list <agile>", "List a board's sprints", listSprints, sprintTable),
|
|
12
|
+
projectedRead("get <agile> <sprint>", "Show a sprint (current for the current one)", getSprint, sprintRecord),
|
|
13
|
+
projectedBodyUpdate("create <agile>", "Create a sprint", createSprint, undefined, sprintWritten("Created")),
|
|
14
|
+
projectedBodyUpdate("update <agile> <sprint>", "Update a sprint", updateSprint, undefined, sprintWritten("Updated")),
|
|
16
15
|
]),
|
|
17
16
|
];
|
|
18
17
|
//# sourceMappingURL=agile-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agile-commands.js","sourceRoot":"","sources":["../../src/agile-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEtG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,CAAC,OAAO,EAAE,sBAAsB,EAAE;QACvC,SAAS,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"agile-commands.js","sourceRoot":"","sources":["../../src/agile-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEtG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,CAAC,OAAO,EAAE,sBAAsB,EAAE;QACvC,SAAS,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,CAAC;QAC9D,aAAa,CAAC,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,WAAW,CAAC;KAC3E,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,4BAA4B,EAAE;QAC9C,SAAS,CAAC,cAAc,EAAE,wBAAwB,EAAE,WAAW,EAAE,WAAW,CAAC;QAC7E,aAAa,CAAC,sBAAsB,EAAE,6CAA6C,EAAE,SAAS,EAAE,YAAY,CAAC;QAC7G,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3G,mBAAmB,CAAC,yBAAyB,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACrH,CAAC;CACH,CAAC"}
|
package/dist/src/agile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agile.d.ts","sourceRoot":"","sources":["../../src/agile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AASrB,eAAO,MAAM,UAAU,gHAA8C,CAAC;AACtE,eAAO,MAAM,QAAQ,6GAAuC,CAAC;AAC7D,eAAO,MAAM,WAAW,+HAGvB,CAAC;AACF,eAAO,MAAM,SAAS,6HAIrB,CAAC;
|
|
1
|
+
{"version":3,"file":"agile.d.ts","sourceRoot":"","sources":["../../src/agile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AASrB,eAAO,MAAM,UAAU,gHAA8C,CAAC;AACtE,eAAO,MAAM,QAAQ,6GAAuC,CAAC;AAC7D,eAAO,MAAM,WAAW,+HAGvB,CAAC;AACF,eAAO,MAAM,SAAS,6HAIrB,CAAC;AA4CF,wBAAsB,YAAY,CAChC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,iBAAsB,kCAQhC;AAED,wBAAsB,YAAY,CAChC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,iBAAsB,kCAQhC"}
|
package/dist/src/agile.js
CHANGED
|
@@ -9,20 +9,14 @@ export const getAgile = readObjectAt(agilePath, agileFields);
|
|
|
9
9
|
export const listSprints = readCollectionAt((agile) => `${agilePath(agile)}/sprints`, sprintFields);
|
|
10
10
|
export const getSprint = readObjectAt((agile, sprint) => `${agilePath(agile)}/sprints/${encodedID(sprint, "sprint ID")}`, sprintFields);
|
|
11
11
|
function sprintBody(input, creating) {
|
|
12
|
-
const body = mutationBody(input
|
|
13
|
-
"name", "goal", "start", "finish", "archived", "isDefault",
|
|
14
|
-
...(creating ? ["previousSprint"] : []),
|
|
15
|
-
]);
|
|
12
|
+
const body = mutationBody(input);
|
|
16
13
|
if (creating && !Object.hasOwn(body, "name")) {
|
|
17
|
-
throw new Error("
|
|
14
|
+
throw new Error("A new sprint requires name.");
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
throw new Error("YouTrack sprint update requires at least one writable field.");
|
|
21
|
-
}
|
|
22
|
-
const result = {};
|
|
16
|
+
const result = { ...body };
|
|
23
17
|
if (Object.hasOwn(body, "name")) {
|
|
24
18
|
if (typeof body.name !== "string") {
|
|
25
|
-
throw new Error("
|
|
19
|
+
throw new Error("The sprint name must be text.");
|
|
26
20
|
}
|
|
27
21
|
result.name = requiredText(body.name, "sprint name");
|
|
28
22
|
}
|
|
@@ -33,7 +27,7 @@ function sprintBody(input, creating) {
|
|
|
33
27
|
if (Object.hasOwn(body, key)) {
|
|
34
28
|
const value = body[key];
|
|
35
29
|
if (value !== null && (typeof value !== "number" || !Number.isSafeInteger(value))) {
|
|
36
|
-
throw new Error(`
|
|
30
|
+
throw new Error(`The sprint ${key} must be a safe integer UTC timestamp in milliseconds or null.`);
|
|
37
31
|
}
|
|
38
32
|
result[key] = value;
|
|
39
33
|
}
|
|
@@ -41,17 +35,17 @@ function sprintBody(input, creating) {
|
|
|
41
35
|
for (const key of ["archived", "isDefault"]) {
|
|
42
36
|
if (Object.hasOwn(body, key)) {
|
|
43
37
|
if (typeof body[key] !== "boolean") {
|
|
44
|
-
throw new Error(`
|
|
38
|
+
throw new Error(`The sprint ${key} must be boolean.`);
|
|
45
39
|
}
|
|
46
40
|
result[key] = body[key];
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
if (Object.hasOwn(body, "previousSprint")) {
|
|
50
|
-
const previous = mutationBody(body.previousSprint
|
|
44
|
+
const previous = mutationBody(body.previousSprint);
|
|
51
45
|
if (typeof previous.id !== "string") {
|
|
52
|
-
throw new Error("
|
|
46
|
+
throw new Error("The previousSprint.id must be text.");
|
|
53
47
|
}
|
|
54
|
-
result.previousSprint = { id: requiredText(previous.id, "previousSprint.id") };
|
|
48
|
+
result.previousSprint = { ...previous, id: requiredText(previous.id, "previousSprint.id") };
|
|
55
49
|
}
|
|
56
50
|
return result;
|
|
57
51
|
}
|
package/dist/src/agile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agile.js","sourceRoot":"","sources":["../../src/agile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,GAIb,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,GAAG,4EAA4E,CAAC;AACjG,MAAM,YAAY,GAAG,6DAA6D,CAAC;AAEnF,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,cAAc,SAAS,CAAC,KAAK,EA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G,SAAS,CAAC,KAAK,CAAC,UAAU,EAC7B,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EACvB,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAC9B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAAsB,EACtB,KAAa,EACb,MAAc,EACd,KAAc,EACd,OAAO,GAAsB,EAAE;IAE/B,OAAO,MAAM,CACX,UAAU,EACV,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,EAC/D,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,EACxB,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article-extras-commands.d.ts","sourceRoot":"","sources":["../../src/article-extras-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"article-extras-commands.d.ts","sourceRoot":"","sources":["../../src/article-extras-commands.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB,qDAiCjC,CAAC"}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { command } from "@eyeauras/cli-factory";
|
|
2
|
-
import {
|
|
2
|
+
import { inputFilePath } from "./client.js";
|
|
3
3
|
import { articleAttachmentDownloadCommand } from "./attachment-download-commands.js";
|
|
4
4
|
import { pagedRead, projectedRead, updateCommand, projectionOptions, readOptions } from "./cli-support.js";
|
|
5
5
|
import { getArticleAttachment, getChildArticle, getParentArticle, listArticleAttachments, listChildArticles, uploadArticleAttachment, } from "./article-extras.js";
|
|
6
|
+
import { articleRecord, articleTable, attachmentRecord, attachmentTable, uploadedAttachments, withView } from "./presentation.js";
|
|
6
7
|
export const articlesExtraChildren = [
|
|
7
|
-
command("attachment", "Inspect, upload or download
|
|
8
|
+
command("attachment", "Inspect, upload or download article attachments", [
|
|
8
9
|
articleAttachmentDownloadCommand,
|
|
9
|
-
pagedRead("list <article>", "List
|
|
10
|
-
projectedRead("get <article> <attachment>", "
|
|
11
|
-
updateCommand("upload <article>", "Upload
|
|
10
|
+
pagedRead("list <article>", "List attachments", listArticleAttachments, attachmentTable),
|
|
11
|
+
projectedRead("get <article> <attachment>", "Show an attachment", getArticleAttachment, attachmentRecord),
|
|
12
|
+
withView(uploadedAttachments, updateCommand("upload <article>", "Upload a file to the article", async (connection, { args, options }, context) => uploadArticleAttachment(connection, args.article, String(options.file), readOptions(options)), [
|
|
12
13
|
...projectionOptions,
|
|
13
14
|
{
|
|
14
15
|
flags: "--file <path>",
|
|
15
|
-
description: "
|
|
16
|
+
description: "Local file to upload",
|
|
16
17
|
required: true,
|
|
17
|
-
parse:
|
|
18
|
+
parse: inputFilePath,
|
|
18
19
|
},
|
|
19
|
-
]),
|
|
20
|
+
])),
|
|
20
21
|
]),
|
|
21
|
-
command("child", "Inspect
|
|
22
|
-
pagedRead("list <article>", "List
|
|
23
|
-
projectedRead("get <article> <child>", "
|
|
22
|
+
command("child", "Inspect an article's child articles", [
|
|
23
|
+
pagedRead("list <article>", "List the immediate child articles", listChildArticles, articleTable),
|
|
24
|
+
projectedRead("get <article> <child>", "Show a child article", getChildArticle, articleRecord),
|
|
24
25
|
]),
|
|
25
26
|
command("parent", "Inspect an article's parent", [
|
|
26
|
-
projectedRead("get <article>", "
|
|
27
|
+
projectedRead("get <article>", "Show the parent article", getParentArticle, articleRecord),
|
|
27
28
|
]),
|
|
28
29
|
];
|
|
29
30
|
//# sourceMappingURL=article-extras-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article-extras-commands.js","sourceRoot":"","sources":["../../src/article-extras-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"article-extras-commands.js","sourceRoot":"","sources":["../../src/article-extras-commands.ts"],"names":[],"mapp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AE;QACtD,SAAS,CAAC,gBAAgB,EAAE,mCAAmC,EAAE,iBAAiB,EAAE,YAAY,CAAC;QACjG,aAAa,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,eAAe,EAAE,aAAa,CAAC;KAC/F,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,6BAA6B,EAAE;QAC/C,aAAa,CAAC,eAAe,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,CAAC;KAC3F,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"articles-commands.d.ts","sourceRoot":"","sources":["../../src/articles-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"articles-commands.d.ts","sourceRoot":"","sources":["../../src/articles-commands.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,oBAAoB,qDAiChC,CAAC;AAEF,eAAO,MAAM,uBAAuB,qDAInC,CAAC"}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { command } from "@eyeauras/cli-factory";
|
|
2
2
|
import { articlesExtraChildren } from "./article-extras-commands.js";
|
|
3
|
-
import { downloadName } from "./attachment-download.js";
|
|
4
3
|
import { pagedRead, projectedBodyUpdate, projectedRead, readCommand } from "./cli-support.js";
|
|
5
4
|
import { addArticleComment, createArticle, exportArticle, getArticle, getArticleComment, listArticleComments, listArticles, listProjectArticles, updateArticle, updateArticleComment, } from "./articles.js";
|
|
5
|
+
import { articleRecord, articleTable, commentAdded, commentShown, commentTable, commentUpdated, createdArticle, exportedArticle, updatedArticle, withView, } from "./presentation.js";
|
|
6
6
|
export const articlesRootCommands = [
|
|
7
7
|
command("article", "Read and write knowledge-base articles", [
|
|
8
8
|
...articlesExtraChildren,
|
|
9
|
-
pagedRead("list", "List
|
|
10
|
-
projectedRead("get <article>", "
|
|
11
|
-
readCommand("export <article>", "Save article content
|
|
12
|
-
projectedBodyUpdate("create", "Create an article
|
|
13
|
-
projectedBodyUpdate("update <article>", "Update summary
|
|
9
|
+
pagedRead("list", "List articles", listArticles, articleTable),
|
|
10
|
+
projectedRead("get <article>", "Show an article", getArticle, articleRecord),
|
|
11
|
+
withView(exportedArticle, readCommand("export <article>", "Save the article content as a file", async (connection, { args, options }, context) => exportArticle(connection, args.article, context.cwd, typeof options.output === "string" ? options.output : undefined), [{ flags: "--output <path>", description: "Save to a relative or absolute path (default: <idReadable>.md)" }])),
|
|
12
|
+
projectedBodyUpdate("create", "Create an article", createArticle, "content", createdArticle),
|
|
13
|
+
projectedBodyUpdate("update <article>", "Update the summary or content", updateArticle, "content", updatedArticle),
|
|
14
14
|
command("comment", "Read and write article comments", [
|
|
15
|
-
pagedRead("list <article>", "List
|
|
16
|
-
projectedRead("get <article> <comment>", "
|
|
17
|
-
projectedBodyUpdate("add <article>", "Add
|
|
18
|
-
projectedBodyUpdate("update <article> <comment>", "Replace
|
|
15
|
+
pagedRead("list <article>", "List comments", listArticleComments, commentTable),
|
|
16
|
+
projectedRead("get <article> <comment>", "Show a comment", getArticleComment, commentShown),
|
|
17
|
+
projectedBodyUpdate("add <article>", "Add a comment", addArticleComment, "text", commentAdded("article")),
|
|
18
|
+
projectedBodyUpdate("update <article> <comment>", "Replace a comment's text", updateArticleComment, "text", commentUpdated("article", "comment")),
|
|
19
19
|
]),
|
|
20
|
-
]
|
|
20
|
+
], {
|
|
21
|
+
examples: ["article list --top 20", "article get KB-A-7", "article export KB-A-7 --output onboarding.md"],
|
|
22
|
+
}),
|
|
21
23
|
];
|
|
22
24
|
export const articlesProjectChildren = [
|
|
23
|
-
command("article", "Inspect project
|
|
24
|
-
pagedRead("list <project>", "List
|
|
25
|
+
command("article", "Inspect the project's articles", [
|
|
26
|
+
pagedRead("list <project>", "List the project's articles", listProjectArticles, articleTable),
|
|
25
27
|
]),
|
|
26
28
|
];
|
|
27
29
|
//# sourceMappingURL=articles-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"articles-commands.js","sourceRoot":"","sources":["../../src/articles-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"articles-commands.js","sourceRoot":"","sources":["../../src/articles-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,CAAC,SAAS,EAAE,wCAAwC,EAAE;QAC3D,GAAG,qBAAqB;QACxB,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,CAAC;QAC9D,aAAa,CAAC,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,CAAC;QAC5E,QAAQ,CAAC,eAAe,EAAE,WAAW,CACnC,kBAAkB,EAClB,oCAAoC,EACpC,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,aAAa,CAC7D,UAAU,EACV,IAAI,CAAC,OAAO,EACZ,OAAO,CAAC,GAAG,EACX,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAChE,EACD,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,gEAAgE,EAAE,CAAC,CAC9G,CAAC;QACF,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,CAAC;QAC5F,mBAAmB,CAAC,kBAAkB,EAAE,+BAA+B,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,CAAC;QAClH,OAAO,CAAC,SAAS,EAAE,iCAAiC,EAAE;YACpD,SAAS,CAAC,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,CAAC;YAC/E,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,CAAC;YAC3F,mBAAmB,CAAC,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;YACzG,mBAAmB,CACjB,4BAA4B,EAC5B,0BAA0B,EAC1B,oBAAoB,EACpB,MAAM,EACN,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CACrC;SACF,CAAC;KACH,EAAE;QACD,QAAQ,EAAE,CAAC,uBAAuB,EAAE,oBAAoB,EAAE,8CAA8C,CAAC;KAC1G,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO,CAAC,SAAS,EAAE,gCAAgC,EAAE;QACnD,SAAS,CAAC,gBAAgB,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,YAAY,CAAC;KAC9F,CAAC;CACH,CAAC"}
|
package/dist/src/articles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PublishedFile } from "@eyeauras/cli-factory";
|
|
2
2
|
import { type Connection, type ProjectionOptions, type YouTrackObject } from "./client.js";
|
|
3
3
|
export declare const listArticles: (connection: Connection, options?: import("./client.js").PageOptions | undefined) => Promise<YouTrackObject[]>;
|
|
4
4
|
export declare const getArticle: (connection: Connection, articleID: string, options?: ProjectionOptions | undefined) => Promise<YouTrackObject>;
|
|
@@ -6,10 +6,10 @@ export declare const getArticle: (connection: Connection, articleID: string, opt
|
|
|
6
6
|
* Save the scrubbed article content as a profile-owned file for a fetch/edit/update workflow.
|
|
7
7
|
* `redacted` warns that URL placeholders would replace the originals if the file were sent back.
|
|
8
8
|
*/
|
|
9
|
-
export declare function exportArticle(connection: Connection, articleID: string,
|
|
9
|
+
export declare function exportArticle(connection: Connection, articleID: string, cwd: string, output?: string): Promise<{
|
|
10
10
|
id: string;
|
|
11
11
|
redacted: boolean;
|
|
12
|
-
} &
|
|
12
|
+
} & PublishedFile>;
|
|
13
13
|
export declare function createArticle(connection: Connection, input: unknown, options?: ProjectionOptions): Promise<YouTrackObject | null>;
|
|
14
14
|
export declare function updateArticle(connection: Connection, articleID: string, input: unknown, options?: ProjectionOptions): Promise<YouTrackObject | null>;
|
|
15
15
|
export declare const listArticleComments: (connection: Connection, articleID: string, options?: import("./client.js").PageOptions | undefined) => Promise<YouTrackObject[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"articles.d.ts","sourceRoot":"","sources":["../../src/articles.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"articles.d.ts","sourceRoot":"","sources":["../../src/articles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EASL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAWrB,eAAO,MAAM,YAAY,gHAAsD,CAAC;AAChF,eAAO,MAAM,UAAU,iHAAiD,CAAC;AAEzE;;;GAGG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,GAAG,EA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