pm-csv 2026.6.1 → 2026.6.2-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/CHANGELOG.md +29 -1
- package/README.md +110 -21
- package/dist/index.d.ts +117 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +662 -189
- package/dist/index.js.map +1 -1
- package/manifest.json +3 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2026.6.1 - 2026-06-
|
|
3
|
+
## 2026.6.2-1 - 2026-06-02
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Deepen SDK surface: relational columns, validate, encoding, excel, csv\_source schema field ([pm-csv-aoox](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/features/pm-csv-aoox.toon))
|
|
8
|
+
- New command: pm csv validate <file\> ([pm-csv-rq5q](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-rq5q.toon))
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fix --key dedup duplication \(pm tag case-folding\) ([pm-csv-bvz5](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-bvz5.toon))
|
|
13
|
+
|
|
14
|
+
### Other
|
|
15
|
+
|
|
16
|
+
- validate exit-code policy ([pm-csv-yhp9](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/decisions/pm-csv-yhp9.toon))
|
|
17
|
+
- csv\_source persisted as tag, not scalar field ([pm-csv-vp1u](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/decisions/pm-csv-vp1u.toon))
|
|
18
|
+
- Which extra pm fields to round-trip ([pm-csv-ry94](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/decisions/pm-csv-ry94.toon))
|
|
19
|
+
- Unit tests + functional test with real data ([pm-csv-z5f5](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-z5f5.toon))
|
|
20
|
+
- Register csv\_source schema field \(schema capability\) ([pm-csv-w1k3](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-w1k3.toon))
|
|
21
|
+
- Export --excel \(CRLF + UTF-8 BOM\) ([pm-csv-vxz6](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-vxz6.toon))
|
|
22
|
+
- Import --encoding \(utf-8/utf16le/latin1\) ([pm-csv-z3lo](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-z3lo.toon))
|
|
23
|
+
- Round-trip parent/assignee/sprint/release/blocked\_by columns ([pm-csv-6kyh](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/tasks/pm-csv-6kyh.toon))
|
|
24
|
+
|
|
25
|
+
## 2026.06.02 - 2026-06-02
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Add native csv-export exporter + --columns selection \(importer/exporter pair, full SDK importers capability\) ([pm-csv-7qh3](https://github.com/unbraind/pm-csv/blob/main/.agents/pm/features/pm-csv-7qh3.toon))
|
|
30
|
+
|
|
31
|
+
## 2026.06.01 - 2026-06-01
|
|
4
32
|
|
|
5
33
|
### Fixed
|
|
6
34
|
|
package/README.md
CHANGED
|
@@ -29,6 +29,11 @@ Read a CSV file and create or update pm items.
|
|
|
29
29
|
```
|
|
30
30
|
pm csv import tasks.csv
|
|
31
31
|
pm csv import backlog.csv --delimiter ';'
|
|
32
|
+
pm csv import data.tsv --delimiter tab
|
|
33
|
+
pm csv import jira.csv --map 'Summary=title,Owner=assignee'
|
|
34
|
+
pm csv import items.csv --key title # idempotent re-import (no duplicates)
|
|
35
|
+
pm csv import legacy.csv --encoding latin1 # non-UTF-8 source
|
|
36
|
+
pm csv import sprint12.csv --source 'jira-export-2026-06'
|
|
32
37
|
pm csv import items.csv --dry-run
|
|
33
38
|
```
|
|
34
39
|
|
|
@@ -36,12 +41,43 @@ pm csv import items.csv --dry-run
|
|
|
36
41
|
|
|
37
42
|
| Flag | Type | Default | Description |
|
|
38
43
|
|---|---|---|---|
|
|
39
|
-
| `--delimiter <char>` | string | `,` |
|
|
44
|
+
| `--delimiter <char>` | string | `,` | Field delimiter, or alias `tab` / `comma` / `semicolon` / `pipe` |
|
|
45
|
+
| `--map <col=field>` | string | — | Remap a CSV header to a pm field (repeatable, comma-joined), e.g. `--map 'Summary=title'` |
|
|
46
|
+
| `--key <field>` | string | — | Dedup key column: a re-import **updates** the matching item instead of creating a duplicate |
|
|
47
|
+
| `--encoding <enc>` | string | `utf-8` | Source file encoding: `utf-8` \| `utf16le` \| `latin1` |
|
|
48
|
+
| `--source <label>` | string | — | Record an import-provenance label in the `csv_source` field of created/updated items |
|
|
40
49
|
| `--dry-run` | boolean | false | Preview what would be imported without writing any data |
|
|
41
50
|
|
|
42
51
|
**Required column:** `title`
|
|
43
52
|
|
|
44
|
-
**Optional columns:** `type`, `status`, `priority`, `tags`, `
|
|
53
|
+
**Optional columns:** `type`, `status`, `priority`, `tags`, `deadline`, `body`, `parent`, `assignee`, `sprint`, `release`, `blocked_by`
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### `pm csv validate <file>`
|
|
58
|
+
|
|
59
|
+
Parse a CSV and report data-quality issues **without importing**. Exits non-zero
|
|
60
|
+
(usage error) when there is a structural problem (no `title` column after `--map`
|
|
61
|
+
or an empty file); otherwise exits `0` even when it reports row-level warnings.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
pm csv validate tasks.csv
|
|
65
|
+
pm csv validate jira.csv --map 'Summary=title'
|
|
66
|
+
pm csv validate data.tsv --delimiter tab --json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The report includes: row count, detected columns, mapped columns (after `--map`),
|
|
70
|
+
whether the required `title` column is present, and counts of rows missing a
|
|
71
|
+
title, rows with an unrecognized status, and rows with a non-integer priority.
|
|
72
|
+
|
|
73
|
+
**Flags**
|
|
74
|
+
|
|
75
|
+
| Flag | Type | Default | Description |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| `--delimiter <char>` | string | `,` | Field delimiter, or alias `tab` / `comma` / `semicolon` / `pipe` |
|
|
78
|
+
| `--map <col=field>` | string | — | Remap a CSV header to a pm field before validating |
|
|
79
|
+
| `--encoding <enc>` | string | `utf-8` | Source file encoding: `utf-8` \| `utf16le` \| `latin1` |
|
|
80
|
+
| `--json` | boolean | false | Emit the report as JSON |
|
|
45
81
|
|
|
46
82
|
---
|
|
47
83
|
|
|
@@ -53,8 +89,9 @@ Export all pm items (or a filtered subset) to CSV. Without `--output` the CSV is
|
|
|
53
89
|
pm csv export
|
|
54
90
|
pm csv export --output items.csv
|
|
55
91
|
pm csv export --output backlog.csv --delimiter ';'
|
|
56
|
-
pm csv export --status
|
|
92
|
+
pm csv export --status open --output todos.csv
|
|
57
93
|
pm csv export --type Feature --output features.csv
|
|
94
|
+
pm csv export --excel --output for-excel.csv
|
|
58
95
|
```
|
|
59
96
|
|
|
60
97
|
**Flags**
|
|
@@ -62,12 +99,16 @@ pm csv export --type Feature --output features.csv
|
|
|
62
99
|
| Flag | Type | Default | Description |
|
|
63
100
|
|---|---|---|---|
|
|
64
101
|
| `--output <file>` | string | — | Write CSV to this file path instead of returning it |
|
|
65
|
-
| `--delimiter <char>` | string | `,` |
|
|
66
|
-
| `--status <status>` | string | — | Filter: `
|
|
102
|
+
| `--delimiter <char>` | string | `,` | Field delimiter, or alias `tab` / `comma` / `semicolon` / `pipe` |
|
|
103
|
+
| `--status <status>` | string | — | Filter: `open` \| `in_progress` \| `blocked` \| `closed` \| `canceled` \| `draft` |
|
|
67
104
|
| `--type <type>` | string | — | Filter by item type |
|
|
105
|
+
| `--columns <list>` | string | all | Comma-separated columns to export, in order |
|
|
106
|
+
| `--no-header` | boolean | false | Omit the CSV header row |
|
|
107
|
+
| `--crlf` | boolean | false | Use CRLF line endings (RFC-4180 / Excel) |
|
|
108
|
+
| `--excel` | boolean | false | Excel-friendly output: CRLF line endings **and** a UTF-8 BOM prefix |
|
|
68
109
|
|
|
69
110
|
**Export columns (fixed order):**
|
|
70
|
-
`id, title, type, status, priority, tags,
|
|
111
|
+
`id, title, type, status, priority, tags, deadline, body, parent, assignee, sprint, release, blocked_by, csv_source, created_at, updated_at`
|
|
71
112
|
|
|
72
113
|
---
|
|
73
114
|
|
|
@@ -94,7 +135,11 @@ Register the importer in your pm-cli config to automatically pull from a CSV fil
|
|
|
94
135
|
| Key | Type | Required | Description |
|
|
95
136
|
|---|---|---|---|
|
|
96
137
|
| `file` | string | yes | Path to the CSV file to import |
|
|
97
|
-
| `delimiter` | string | no (default `,`) | CSV field delimiter |
|
|
138
|
+
| `delimiter` | string | no (default `,`) | CSV field delimiter (or alias `tab`/`comma`/`semicolon`/`pipe`) |
|
|
139
|
+
| `map` | string | no | Header remap, e.g. `Summary=title` |
|
|
140
|
+
| `key` | string | no | Dedup key column for idempotent re-import |
|
|
141
|
+
| `encoding` | string | no (default `utf-8`) | `utf-8` \| `utf16le` \| `latin1` |
|
|
142
|
+
| `source` | string | no | Provenance label recorded in `csv_source` |
|
|
98
143
|
|
|
99
144
|
---
|
|
100
145
|
|
|
@@ -105,10 +150,10 @@ Register the importer in your pm-cli config to automatically pull from a CSV fil
|
|
|
105
150
|
The first row must be a header row. Column names are **case-insensitive**. Column order does not matter. Only `title` is required.
|
|
106
151
|
|
|
107
152
|
```csv
|
|
108
|
-
title,type,status,priority,tags,
|
|
109
|
-
"Add login page",Feature,open,2,"auth,ui",
|
|
110
|
-
"Fix navbar bug",Issue,in_progress,1,"bug,ui"
|
|
111
|
-
"Write API docs",Task,
|
|
153
|
+
title,type,status,priority,tags,deadline,body,parent,assignee,sprint,release,blocked_by
|
|
154
|
+
"Add login page",Feature,open,2,"auth,ui",2026-05-30,"Landing page with email+password login",,alice,Sprint-12,v1.0,
|
|
155
|
+
"Fix navbar bug",Issue,in_progress,1,"bug,ui",,"Navbar collapses on mobile Safari",,bob,Sprint-12,v1.0,
|
|
156
|
+
"Write API docs",Task,open,3,docs,,,,,Sprint-13,v1.1,Fix navbar bug
|
|
112
157
|
```
|
|
113
158
|
|
|
114
159
|
### Column reference
|
|
@@ -116,13 +161,19 @@ title,type,status,priority,tags,milestone,due_date,body
|
|
|
116
161
|
| Column | Description | Notes |
|
|
117
162
|
|---|---|---|
|
|
118
163
|
| `title` | Item title | **Required** |
|
|
119
|
-
| `type` | Item type | Any string, e.g. `Feature`, `
|
|
164
|
+
| `type` | Item type | Any string, e.g. `Feature`, `Issue`, `Task` |
|
|
120
165
|
| `status` | Item status | See status mapping below |
|
|
121
166
|
| `priority` | Numeric priority | Integer |
|
|
122
167
|
| `tags` | Comma-separated tags | Quote the field if tags contain commas |
|
|
123
|
-
| `
|
|
124
|
-
| `due_date` | Due date | ISO 8601 format recommended, e.g. `2026-05-30` |
|
|
168
|
+
| `deadline` | Deadline | ISO 8601, e.g. `2026-05-30` (legacy `due_date` header accepted) |
|
|
125
169
|
| `body` | Description / body text | Supports multiline when quoted |
|
|
170
|
+
| `parent` | Parent item id | Maps to `pm create --parent` |
|
|
171
|
+
| `assignee` | Assignee | Maps to `pm create --assignee` |
|
|
172
|
+
| `sprint` | Sprint identifier | Maps to `pm create --sprint` |
|
|
173
|
+
| `release` | Release identifier | Maps to `pm create --release` |
|
|
174
|
+
| `blocked_by` | Blocked-by item id or reason | Maps to `pm create --blocked-by` (legacy `blocked-by` header accepted) |
|
|
175
|
+
|
|
176
|
+
All columns except `title` are optional. Round-tripping (`export` then `import --key`) is lossless for these fields.
|
|
126
177
|
|
|
127
178
|
### Status mapping
|
|
128
179
|
|
|
@@ -130,24 +181,50 @@ The importer accepts common status strings and maps them to pm-cli statuses:
|
|
|
130
181
|
|
|
131
182
|
| Input values | pm-cli status |
|
|
132
183
|
|---|---|
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
135
|
-
| `wip`, `in_progress`, `in progress`, `doing` | `wip` |
|
|
184
|
+
| `open`, `todo`, `new` | `open` |
|
|
185
|
+
| `in_progress`, `wip`, `in progress`, `doing` | `in_progress` |
|
|
136
186
|
| `blocked`, `on_hold`, `on hold` | `blocked` |
|
|
187
|
+
| `closed`, `done`, `complete`, `completed` | `closed` |
|
|
188
|
+
| `canceled`, `cancelled` | `canceled` |
|
|
189
|
+
| `draft` | `draft` |
|
|
137
190
|
|
|
138
|
-
Unrecognized values default to `
|
|
191
|
+
Unrecognized values default to `open`.
|
|
139
192
|
|
|
140
193
|
### Export format
|
|
141
194
|
|
|
142
|
-
Exports use the same CSV format and can be re-imported
|
|
195
|
+
Exports use the same CSV format and can be re-imported. An extra read-only
|
|
196
|
+
`csv_source` column surfaces the import-provenance label (see `--source`); it is
|
|
197
|
+
ignored on import.
|
|
143
198
|
|
|
144
199
|
```csv
|
|
145
|
-
id,title,type,status,priority,tags,
|
|
146
|
-
|
|
200
|
+
id,title,type,status,priority,tags,deadline,body,parent,assignee,sprint,release,blocked_by,csv_source,created_at,updated_at
|
|
201
|
+
pm-abc123,Add login page,Feature,open,2,"auth,ui",2026-05-30,Landing page,,alice,Sprint-12,v1.0,,jira-export,2026-05-01T10:00:00Z,2026-05-09T12:00:00Z
|
|
147
202
|
```
|
|
148
203
|
|
|
149
204
|
---
|
|
150
205
|
|
|
206
|
+
## Idempotent re-import (`--key`)
|
|
207
|
+
|
|
208
|
+
`--key <field>` makes re-imports update existing items instead of creating
|
|
209
|
+
duplicates. The first import tags each created item with an internal
|
|
210
|
+
`csv-key:<value>` provenance tag; a later import keyed on the same column finds
|
|
211
|
+
and updates the matching item. Key matching is case-insensitive (pm folds tag
|
|
212
|
+
case on storage). The internal `csv-key:` and `csv-source:` tags are stripped
|
|
213
|
+
from exports so round-trips stay clean.
|
|
214
|
+
|
|
215
|
+
## Provenance & the `csv_source` schema field (`--source`)
|
|
216
|
+
|
|
217
|
+
The extension registers an optional `csv_source` schema item field (via the
|
|
218
|
+
`schema` capability). When you import with `--source <label>`, the label is
|
|
219
|
+
recorded on each created/updated item and is surfaced back in the `csv_source`
|
|
220
|
+
export column. Note: as of pm 2026.5.31 the CLI does not expose a scalar setter
|
|
221
|
+
for extension-registered fields, so the value is persisted as an internal
|
|
222
|
+
`csv-source:<label>` tag (stripped from the normal `tags` export column). On
|
|
223
|
+
hosts whose SDK lacks `registerItemFields`, schema registration degrades to a
|
|
224
|
+
no-op without breaking any other behavior.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
151
228
|
## CSV parsing rules
|
|
152
229
|
|
|
153
230
|
- Fields containing the delimiter, double-quotes, or newlines must be wrapped in double-quotes.
|
|
@@ -168,6 +245,18 @@ TypeScript 5, ES2022 target, NodeNext module resolution, strict mode. Zero runti
|
|
|
168
245
|
|
|
169
246
|
---
|
|
170
247
|
|
|
248
|
+
|
|
249
|
+
## Exporter & column selection (added)
|
|
250
|
+
|
|
251
|
+
`pm csv export` and the native `pm csv-export export` both accept `--columns` to pick and order columns:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
pm csv export --columns id,title,status --output todos.csv
|
|
255
|
+
pm csv-export export --columns title,priority # native export pipeline
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Valid columns: id, title, type, status, priority, tags, deadline, body, parent, assignee, sprint, release, blocked_by, csv_source, created_at, updated_at.
|
|
259
|
+
|
|
171
260
|
## License
|
|
172
261
|
|
|
173
262
|
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,124 @@
|
|
|
1
|
+
type ItemStatus = "open" | "in_progress" | "blocked" | "closed" | "canceled" | "draft";
|
|
2
|
+
interface PmItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
status: ItemStatus;
|
|
7
|
+
priority?: number;
|
|
8
|
+
type?: string;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
created_at?: string;
|
|
11
|
+
updated_at?: string;
|
|
12
|
+
deadline?: string;
|
|
13
|
+
parent?: string;
|
|
14
|
+
assignee?: string;
|
|
15
|
+
sprint?: string;
|
|
16
|
+
release?: string;
|
|
17
|
+
blocked_by?: string;
|
|
18
|
+
/** Derived on export from the csv-source: provenance tag (not a stored field). */
|
|
19
|
+
csv_source?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const IMPORT_COLUMNS: readonly ["title", "type", "status", "priority", "tags", "deadline", "body", "parent", "assignee", "sprint", "release", "blocked_by"];
|
|
22
|
+
declare const EXPORT_COLUMNS: Array<keyof PmItem>;
|
|
23
|
+
/** Supported file encodings for `--encoding` on import. */
|
|
24
|
+
declare const SUPPORTED_ENCODINGS: readonly ["utf-8", "utf8", "utf16le", "latin1"];
|
|
25
|
+
type SupportedEncoding = (typeof SUPPORTED_ENCODINGS)[number];
|
|
26
|
+
/**
|
|
27
|
+
* Parse a full CSV string into rows of string arrays.
|
|
28
|
+
* Handles:
|
|
29
|
+
* - Quoted fields (double-quotes), including embedded newlines inside quotes
|
|
30
|
+
* - Escaped quotes ("" inside a quoted field → single ")
|
|
31
|
+
* - Custom delimiter
|
|
32
|
+
* - CRLF and LF line endings
|
|
33
|
+
*/
|
|
34
|
+
declare function parseCSV(text: string, delimiter?: string): string[][];
|
|
35
|
+
/**
|
|
36
|
+
* Strip a leading UTF-8 BOM (U+FEFF) if present. Files exported by Excel and
|
|
37
|
+
* many Windows tools start with a BOM; without removing it the first header
|
|
38
|
+
* name silently becomes "title" and the required-column check fails.
|
|
39
|
+
*/
|
|
40
|
+
declare function stripBOM(text: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Serialize a single field value for CSV output.
|
|
43
|
+
* Wraps in double-quotes when the value contains the delimiter, quotes, or newlines.
|
|
44
|
+
*/
|
|
45
|
+
declare function serializeField(value: string, delimiter: string): string;
|
|
46
|
+
interface SerializeOptions {
|
|
47
|
+
delimiter: string;
|
|
48
|
+
/** Line terminator. RFC-4180 mandates CRLF; we default to LF for unix-friendliness. */
|
|
49
|
+
eol?: "\n" | "\r\n";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Serialize a full array of rows into a CSV string.
|
|
53
|
+
*/
|
|
54
|
+
declare function serializeCSV(rows: string[][], delimiterOrOpts: string | SerializeOptions): string;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve a user-supplied delimiter, accepting friendly aliases so TSV is easy:
|
|
57
|
+
* --delimiter tab --delimiter "\t" --delimiter ";"
|
|
58
|
+
* A literal backslash-t is interpreted as a tab.
|
|
59
|
+
*/
|
|
60
|
+
declare function resolveDelimiter(raw: string | undefined): string;
|
|
61
|
+
/**
|
|
62
|
+
* Normalize a dedup key value for stable matching. pm lower-cases tags on
|
|
63
|
+
* storage, so a `csv-key:` tag written from "Fix Bug" comes back as
|
|
64
|
+
* "fix bug"; we therefore fold the key to lower-case on BOTH write and lookup
|
|
65
|
+
* so re-imports match (and thus update) instead of duplicating.
|
|
66
|
+
*/
|
|
67
|
+
declare function normalizeKeyValue(value: string): string;
|
|
68
|
+
declare function encodeKeyTagValue(value: string): string;
|
|
69
|
+
declare function decodeKeyTagValue(value: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Parse a `--map csvHeader=field` spec (repeatable / comma-joined) into a
|
|
72
|
+
* lookup from a normalized CSV header name to the canonical pm field name.
|
|
73
|
+
* Example: `--map "Summary=title,Owner=tags"`.
|
|
74
|
+
*/
|
|
75
|
+
declare function parseFieldMap(spec: string | string[] | undefined): Record<string, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Apply a field map to a list of header names, producing the effective
|
|
78
|
+
* (canonical) header used for column lookup.
|
|
79
|
+
*/
|
|
80
|
+
declare function applyFieldMap(headers: string[], fieldMap: Record<string, string>): string[];
|
|
81
|
+
/**
|
|
82
|
+
* Map an arbitrary status string (from the CSV) to a valid SDK status.
|
|
83
|
+
* Falls back to "open".
|
|
84
|
+
*/
|
|
85
|
+
declare function normalizeStatus(raw: string): ItemStatus;
|
|
86
|
+
/**
|
|
87
|
+
* Parse a comma-separated tags string into an array, stripping whitespace.
|
|
88
|
+
*/
|
|
89
|
+
declare function parseTags(raw: string): string[];
|
|
90
|
+
/**
|
|
91
|
+
* Stringify a tags array back to a semicolon-free comma-separated string
|
|
92
|
+
* (safe to embed in a single CSV field).
|
|
93
|
+
*/
|
|
94
|
+
declare function stringifyTags(tags: string[] | undefined): string;
|
|
95
|
+
/**
|
|
96
|
+
* Validate and normalize a user-supplied `--encoding` value to a Node-supported
|
|
97
|
+
* BufferEncoding. Accepts utf-8/utf8, utf16le, latin1. Throws USAGE otherwise.
|
|
98
|
+
*/
|
|
99
|
+
declare function resolveEncoding(raw: string | undefined): SupportedEncoding;
|
|
100
|
+
interface CsvValidateReport {
|
|
101
|
+
ok: boolean;
|
|
102
|
+
rowCount: number;
|
|
103
|
+
detectedColumns: string[];
|
|
104
|
+
mappedColumns: string[];
|
|
105
|
+
hasTitleColumn: boolean;
|
|
106
|
+
rowsMissingTitle: number;
|
|
107
|
+
rowsWithUnknownStatus: number;
|
|
108
|
+
rowsWithNonIntegerPriority: number;
|
|
109
|
+
issues: string[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Core validation logic over already-parsed headers + rows. Pure and
|
|
113
|
+
* side-effect-free so it can be unit tested directly.
|
|
114
|
+
*/
|
|
115
|
+
declare function validateParsedCSV(rawHeaders: string[], dataRows: string[][], fieldMap: Record<string, string>): CsvValidateReport;
|
|
116
|
+
declare function selectExportColumns(spec: string | undefined): Array<keyof PmItem>;
|
|
1
117
|
declare const _default: {
|
|
2
118
|
name: string;
|
|
3
119
|
version: string;
|
|
4
120
|
activate(api: import("@unbrained/pm-cli/sdk").ExtensionApi): void;
|
|
5
121
|
};
|
|
6
122
|
export default _default;
|
|
123
|
+
export { parseCSV, serializeCSV, serializeField, stripBOM, resolveDelimiter, parseFieldMap, applyFieldMap, normalizeStatus, parseTags, stringifyTags, encodeKeyTagValue, decodeKeyTagValue, normalizeKeyValue, selectExportColumns, resolveEncoding, validateParsedCSV, EXPORT_COLUMNS, IMPORT_COLUMNS, };
|
|
7
124
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAsCA,KAAK,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAEvF,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD,QAAA,MAAM,cAAc,uIAaV,CAAC;AAGX,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,MAAM,MAAM,CAiBvC,CAAC;AAYF,2DAA2D;AAC3D,QAAA,MAAM,mBAAmB,iDAAkD,CAAC;AAC5E,KAAK,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM9D;;;;;;;GAOG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,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