@nickchristensen/ppls 1.1.0 → 1.2.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 +106 -74
- package/dist/base-command.d.ts +5 -4
- package/dist/commands/documents/download.d.ts +2 -2
- package/dist/commands/documents/download.js +24 -17
- package/dist/commands/documents/list.d.ts +31 -1
- package/dist/commands/documents/list.js +165 -1
- package/dist/flags/date-like.d.ts +4 -0
- package/dist/flags/date-like.js +11 -0
- package/dist/list-command.d.ts +5 -4
- package/dist/list-command.js +9 -1
- package/oclif.manifest.json +225 -17
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ $ ppls config get hostname
|
|
|
75
75
|
* [`ppls document-types update ID`](#ppls-document-types-update-id)
|
|
76
76
|
* [`ppls documents add [PATH]`](#ppls-documents-add-path)
|
|
77
77
|
* [`ppls documents delete ID`](#ppls-documents-delete-id)
|
|
78
|
-
* [`ppls documents download ID`](#ppls-documents-download-id)
|
|
78
|
+
* [`ppls documents download [ID]`](#ppls-documents-download-id)
|
|
79
79
|
* [`ppls documents list`](#ppls-documents-list)
|
|
80
80
|
* [`ppls documents show ID`](#ppls-documents-show-id)
|
|
81
81
|
* [`ppls documents update ID`](#ppls-documents-update-id)
|
|
@@ -108,7 +108,7 @@ EXAMPLES
|
|
|
108
108
|
$ ppls config get hostname
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
_See code: [src/commands/config/get.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
111
|
+
_See code: [src/commands/config/get.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/config/get.ts)_
|
|
112
112
|
|
|
113
113
|
## `ppls config init`
|
|
114
114
|
|
|
@@ -131,7 +131,7 @@ EXAMPLES
|
|
|
131
131
|
$ ppls config init
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
_See code: [src/commands/config/init.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
134
|
+
_See code: [src/commands/config/init.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/config/init.ts)_
|
|
135
135
|
|
|
136
136
|
## `ppls config list`
|
|
137
137
|
|
|
@@ -155,7 +155,7 @@ EXAMPLES
|
|
|
155
155
|
$ ppls config list
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
_See code: [src/commands/config/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
158
|
+
_See code: [src/commands/config/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/config/list.ts)_
|
|
159
159
|
|
|
160
160
|
## `ppls config remove KEY`
|
|
161
161
|
|
|
@@ -178,7 +178,7 @@ EXAMPLES
|
|
|
178
178
|
$ ppls config remove token
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
_See code: [src/commands/config/remove.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
181
|
+
_See code: [src/commands/config/remove.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/config/remove.ts)_
|
|
182
182
|
|
|
183
183
|
## `ppls config set KEY VALUE`
|
|
184
184
|
|
|
@@ -204,7 +204,7 @@ EXAMPLES
|
|
|
204
204
|
$ ppls config set headers '{"X-Api-Key":"token"}'
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
_See code: [src/commands/config/set.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
207
|
+
_See code: [src/commands/config/set.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/config/set.ts)_
|
|
208
208
|
|
|
209
209
|
## `ppls correspondents add NAME`
|
|
210
210
|
|
|
@@ -236,7 +236,7 @@ EXAMPLES
|
|
|
236
236
|
$ ppls correspondents add "Acme Corp"
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
_See code: [src/commands/correspondents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
239
|
+
_See code: [src/commands/correspondents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/correspondents/add.ts)_
|
|
240
240
|
|
|
241
241
|
## `ppls correspondents delete ID`
|
|
242
242
|
|
|
@@ -271,7 +271,7 @@ EXAMPLES
|
|
|
271
271
|
$ ppls correspondents delete 123
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
-
_See code: [src/commands/correspondents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
274
|
+
_See code: [src/commands/correspondents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/correspondents/delete.ts)_
|
|
275
275
|
|
|
276
276
|
## `ppls correspondents list`
|
|
277
277
|
|
|
@@ -280,15 +280,13 @@ List correspondents
|
|
|
280
280
|
```
|
|
281
281
|
USAGE
|
|
282
282
|
$ ppls correspondents list [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json |
|
|
283
|
-
--table] [--token <value>] [--id-in <value
|
|
284
|
-
<value>]
|
|
283
|
+
--table] [--token <value>] [--id-in <value>... | --name-contains <value>] [--page <value> --page-size <value>]
|
|
284
|
+
[--sort <value>]
|
|
285
285
|
|
|
286
286
|
FLAGS
|
|
287
|
-
--
|
|
288
|
-
--
|
|
289
|
-
--
|
|
290
|
-
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
291
|
-
--sort=<value> Sort results by the provided field
|
|
287
|
+
--page=<value> Page number to fetch
|
|
288
|
+
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
289
|
+
--sort=<value> Sort results by the provided field
|
|
292
290
|
|
|
293
291
|
GLOBAL FLAGS
|
|
294
292
|
--date-format=<value> [default: yyyy-MM-dd, env: PPLS_DATE_FORMAT] Format output dates using a template.
|
|
@@ -301,6 +299,10 @@ ENVIRONMENT FLAGS
|
|
|
301
299
|
--hostname=<value> [env: PPLS_HOSTNAME] Paperless-ngx base URL
|
|
302
300
|
--token=<value> [env: PPLS_TOKEN] Paperless-ngx API token
|
|
303
301
|
|
|
302
|
+
FILTER FLAGS
|
|
303
|
+
--id-in=<value>... Filter by id list (repeatable or comma-separated)
|
|
304
|
+
--name-contains=<value> Filter by name substring
|
|
305
|
+
|
|
304
306
|
DESCRIPTION
|
|
305
307
|
List correspondents
|
|
306
308
|
|
|
@@ -308,7 +310,7 @@ EXAMPLES
|
|
|
308
310
|
$ ppls correspondents list
|
|
309
311
|
```
|
|
310
312
|
|
|
311
|
-
_See code: [src/commands/correspondents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
313
|
+
_See code: [src/commands/correspondents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/correspondents/list.ts)_
|
|
312
314
|
|
|
313
315
|
## `ppls correspondents show ID`
|
|
314
316
|
|
|
@@ -340,7 +342,7 @@ EXAMPLES
|
|
|
340
342
|
$ ppls correspondents show 123
|
|
341
343
|
```
|
|
342
344
|
|
|
343
|
-
_See code: [src/commands/correspondents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
345
|
+
_See code: [src/commands/correspondents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/correspondents/show.ts)_
|
|
344
346
|
|
|
345
347
|
## `ppls correspondents update ID`
|
|
346
348
|
|
|
@@ -375,7 +377,7 @@ EXAMPLES
|
|
|
375
377
|
$ ppls correspondents update 123 --name "Acme Corp"
|
|
376
378
|
```
|
|
377
379
|
|
|
378
|
-
_See code: [src/commands/correspondents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
380
|
+
_See code: [src/commands/correspondents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/correspondents/update.ts)_
|
|
379
381
|
|
|
380
382
|
## `ppls custom-fields add NAME`
|
|
381
383
|
|
|
@@ -413,7 +415,7 @@ EXAMPLES
|
|
|
413
415
|
$ ppls custom-fields add "Due Date" --data-type date
|
|
414
416
|
```
|
|
415
417
|
|
|
416
|
-
_See code: [src/commands/custom-fields/add.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
418
|
+
_See code: [src/commands/custom-fields/add.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/custom-fields/add.ts)_
|
|
417
419
|
|
|
418
420
|
## `ppls custom-fields delete ID`
|
|
419
421
|
|
|
@@ -448,7 +450,7 @@ EXAMPLES
|
|
|
448
450
|
$ ppls custom-fields delete 123
|
|
449
451
|
```
|
|
450
452
|
|
|
451
|
-
_See code: [src/commands/custom-fields/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
453
|
+
_See code: [src/commands/custom-fields/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/custom-fields/delete.ts)_
|
|
452
454
|
|
|
453
455
|
## `ppls custom-fields list`
|
|
454
456
|
|
|
@@ -457,15 +459,13 @@ List custom fields
|
|
|
457
459
|
```
|
|
458
460
|
USAGE
|
|
459
461
|
$ ppls custom-fields list [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json |
|
|
460
|
-
--table] [--token <value>] [--id-in <value
|
|
461
|
-
<value>]
|
|
462
|
+
--table] [--token <value>] [--id-in <value>... | --name-contains <value>] [--page <value> --page-size <value>]
|
|
463
|
+
[--sort <value>]
|
|
462
464
|
|
|
463
465
|
FLAGS
|
|
464
|
-
--
|
|
465
|
-
--
|
|
466
|
-
--
|
|
467
|
-
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
468
|
-
--sort=<value> Sort results by the provided field
|
|
466
|
+
--page=<value> Page number to fetch
|
|
467
|
+
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
468
|
+
--sort=<value> Sort results by the provided field
|
|
469
469
|
|
|
470
470
|
GLOBAL FLAGS
|
|
471
471
|
--date-format=<value> [default: yyyy-MM-dd, env: PPLS_DATE_FORMAT] Format output dates using a template.
|
|
@@ -478,6 +478,10 @@ ENVIRONMENT FLAGS
|
|
|
478
478
|
--hostname=<value> [env: PPLS_HOSTNAME] Paperless-ngx base URL
|
|
479
479
|
--token=<value> [env: PPLS_TOKEN] Paperless-ngx API token
|
|
480
480
|
|
|
481
|
+
FILTER FLAGS
|
|
482
|
+
--id-in=<value>... Filter by id list (repeatable or comma-separated)
|
|
483
|
+
--name-contains=<value> Filter by name substring
|
|
484
|
+
|
|
481
485
|
DESCRIPTION
|
|
482
486
|
List custom fields
|
|
483
487
|
|
|
@@ -485,7 +489,7 @@ EXAMPLES
|
|
|
485
489
|
$ ppls custom-fields list
|
|
486
490
|
```
|
|
487
491
|
|
|
488
|
-
_See code: [src/commands/custom-fields/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
492
|
+
_See code: [src/commands/custom-fields/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/custom-fields/list.ts)_
|
|
489
493
|
|
|
490
494
|
## `ppls custom-fields show ID`
|
|
491
495
|
|
|
@@ -517,7 +521,7 @@ EXAMPLES
|
|
|
517
521
|
$ ppls custom-fields show 123
|
|
518
522
|
```
|
|
519
523
|
|
|
520
|
-
_See code: [src/commands/custom-fields/show.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
524
|
+
_See code: [src/commands/custom-fields/show.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/custom-fields/show.ts)_
|
|
521
525
|
|
|
522
526
|
## `ppls custom-fields update ID`
|
|
523
527
|
|
|
@@ -556,7 +560,7 @@ EXAMPLES
|
|
|
556
560
|
$ ppls custom-fields update 123 --name "Due Date"
|
|
557
561
|
```
|
|
558
562
|
|
|
559
|
-
_See code: [src/commands/custom-fields/update.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
563
|
+
_See code: [src/commands/custom-fields/update.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/custom-fields/update.ts)_
|
|
560
564
|
|
|
561
565
|
## `ppls document-types add NAME`
|
|
562
566
|
|
|
@@ -588,7 +592,7 @@ EXAMPLES
|
|
|
588
592
|
$ ppls document-types add "Invoice"
|
|
589
593
|
```
|
|
590
594
|
|
|
591
|
-
_See code: [src/commands/document-types/add.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
595
|
+
_See code: [src/commands/document-types/add.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/document-types/add.ts)_
|
|
592
596
|
|
|
593
597
|
## `ppls document-types delete ID`
|
|
594
598
|
|
|
@@ -623,7 +627,7 @@ EXAMPLES
|
|
|
623
627
|
$ ppls document-types delete 123
|
|
624
628
|
```
|
|
625
629
|
|
|
626
|
-
_See code: [src/commands/document-types/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
630
|
+
_See code: [src/commands/document-types/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/document-types/delete.ts)_
|
|
627
631
|
|
|
628
632
|
## `ppls document-types list`
|
|
629
633
|
|
|
@@ -632,15 +636,13 @@ List document types
|
|
|
632
636
|
```
|
|
633
637
|
USAGE
|
|
634
638
|
$ ppls document-types list [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json |
|
|
635
|
-
--table] [--token <value>] [--id-in <value
|
|
636
|
-
<value>]
|
|
639
|
+
--table] [--token <value>] [--id-in <value>... | --name-contains <value>] [--page <value> --page-size <value>]
|
|
640
|
+
[--sort <value>]
|
|
637
641
|
|
|
638
642
|
FLAGS
|
|
639
|
-
--
|
|
640
|
-
--
|
|
641
|
-
--
|
|
642
|
-
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
643
|
-
--sort=<value> Sort results by the provided field
|
|
643
|
+
--page=<value> Page number to fetch
|
|
644
|
+
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
645
|
+
--sort=<value> Sort results by the provided field
|
|
644
646
|
|
|
645
647
|
GLOBAL FLAGS
|
|
646
648
|
--date-format=<value> [default: yyyy-MM-dd, env: PPLS_DATE_FORMAT] Format output dates using a template.
|
|
@@ -653,6 +655,10 @@ ENVIRONMENT FLAGS
|
|
|
653
655
|
--hostname=<value> [env: PPLS_HOSTNAME] Paperless-ngx base URL
|
|
654
656
|
--token=<value> [env: PPLS_TOKEN] Paperless-ngx API token
|
|
655
657
|
|
|
658
|
+
FILTER FLAGS
|
|
659
|
+
--id-in=<value>... Filter by id list (repeatable or comma-separated)
|
|
660
|
+
--name-contains=<value> Filter by name substring
|
|
661
|
+
|
|
656
662
|
DESCRIPTION
|
|
657
663
|
List document types
|
|
658
664
|
|
|
@@ -660,7 +666,7 @@ EXAMPLES
|
|
|
660
666
|
$ ppls document-types list
|
|
661
667
|
```
|
|
662
668
|
|
|
663
|
-
_See code: [src/commands/document-types/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
669
|
+
_See code: [src/commands/document-types/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/document-types/list.ts)_
|
|
664
670
|
|
|
665
671
|
## `ppls document-types show ID`
|
|
666
672
|
|
|
@@ -692,7 +698,7 @@ EXAMPLES
|
|
|
692
698
|
$ ppls document-types show 123
|
|
693
699
|
```
|
|
694
700
|
|
|
695
|
-
_See code: [src/commands/document-types/show.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
701
|
+
_See code: [src/commands/document-types/show.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/document-types/show.ts)_
|
|
696
702
|
|
|
697
703
|
## `ppls document-types update ID`
|
|
698
704
|
|
|
@@ -727,7 +733,7 @@ EXAMPLES
|
|
|
727
733
|
$ ppls document-types update 123 --name "Invoice"
|
|
728
734
|
```
|
|
729
735
|
|
|
730
|
-
_See code: [src/commands/document-types/update.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
736
|
+
_See code: [src/commands/document-types/update.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/document-types/update.ts)_
|
|
731
737
|
|
|
732
738
|
## `ppls documents add [PATH]`
|
|
733
739
|
|
|
@@ -769,7 +775,7 @@ EXAMPLES
|
|
|
769
775
|
$ ppls documents add ./receipt.pdf --title "Receipt"
|
|
770
776
|
```
|
|
771
777
|
|
|
772
|
-
_See code: [src/commands/documents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
778
|
+
_See code: [src/commands/documents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/add.ts)_
|
|
773
779
|
|
|
774
780
|
## `ppls documents delete ID`
|
|
775
781
|
|
|
@@ -804,19 +810,19 @@ EXAMPLES
|
|
|
804
810
|
$ ppls documents delete 123
|
|
805
811
|
```
|
|
806
812
|
|
|
807
|
-
_See code: [src/commands/documents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
813
|
+
_See code: [src/commands/documents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/delete.ts)_
|
|
808
814
|
|
|
809
|
-
## `ppls documents download ID`
|
|
815
|
+
## `ppls documents download [ID]`
|
|
810
816
|
|
|
811
817
|
Download one or more documents
|
|
812
818
|
|
|
813
819
|
```
|
|
814
820
|
USAGE
|
|
815
|
-
$ ppls documents download ID [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json
|
|
816
|
-
--table] [--token <value>] [--original] [-o <value> | --output-dir <value>]
|
|
821
|
+
$ ppls documents download [ID...] [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json
|
|
822
|
+
| --table] [--token <value>] [--original] [-o <value> | --output-dir <value>]
|
|
817
823
|
|
|
818
824
|
ARGUMENTS
|
|
819
|
-
ID Document id or comma-separated
|
|
825
|
+
[ID...] Document id (repeatable or comma-separated)
|
|
820
826
|
|
|
821
827
|
FLAGS
|
|
822
828
|
-o, --output=<value> Output file path (single document)
|
|
@@ -838,12 +844,14 @@ DESCRIPTION
|
|
|
838
844
|
Download one or more documents
|
|
839
845
|
|
|
840
846
|
EXAMPLES
|
|
841
|
-
$ ppls documents download
|
|
847
|
+
$ ppls documents download --output document.pdf 123
|
|
842
848
|
|
|
843
|
-
$ ppls documents download
|
|
849
|
+
$ ppls documents download --output-dir ./downloads 123 456
|
|
850
|
+
|
|
851
|
+
$ ppls documents download --output-dir ./downloads 123,456
|
|
844
852
|
```
|
|
845
853
|
|
|
846
|
-
_See code: [src/commands/documents/download.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
854
|
+
_See code: [src/commands/documents/download.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/download.ts)_
|
|
847
855
|
|
|
848
856
|
## `ppls documents list`
|
|
849
857
|
|
|
@@ -852,15 +860,37 @@ List documents
|
|
|
852
860
|
```
|
|
853
861
|
USAGE
|
|
854
862
|
$ ppls documents list [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json |
|
|
855
|
-
--table] [--token <value>] [--
|
|
856
|
-
<value>]
|
|
863
|
+
--table] [--token <value>] [--page <value> --page-size <value>] [--sort <value>] [--added-after YYYY-MM-DD|ISO-8601
|
|
864
|
+
| [--id-in <value>... | --name-contains <value>]] [--added-before YYYY-MM-DD|ISO-8601 | ] [--created-after
|
|
865
|
+
YYYY-MM-DD|ISO-8601 | ] [--created-before YYYY-MM-DD|ISO-8601 | ] [--modified-after YYYY-MM-DD|ISO-8601 | ]
|
|
866
|
+
[--modified-before YYYY-MM-DD|ISO-8601 | ] [--no-correspondent | [--correspondent <value>... | ] |
|
|
867
|
+
[--correspondent-not <value>... | ] | ] [--no-document-type | [--document-type <value>... | ] | [--document-type-not
|
|
868
|
+
<value>... | ] | ] [--no-tag | --tag <value>... | --tag-all <value>... | --tag-not <value>... | ]
|
|
857
869
|
|
|
858
870
|
FLAGS
|
|
859
|
-
--
|
|
860
|
-
--
|
|
861
|
-
--
|
|
862
|
-
|
|
863
|
-
|
|
871
|
+
--page=<value> Page number to fetch
|
|
872
|
+
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
873
|
+
--sort=<value> Sort results by the provided field
|
|
874
|
+
|
|
875
|
+
FILTER FLAGS
|
|
876
|
+
--added-after=YYYY-MM-DD|ISO-8601 Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) >= value
|
|
877
|
+
--added-before=YYYY-MM-DD|ISO-8601 Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) <= value
|
|
878
|
+
--correspondent=<value>... Filter by correspondent ids (repeatable or comma-separated)
|
|
879
|
+
--correspondent-not=<value>... Exclude correspondent ids (repeatable or comma-separated)
|
|
880
|
+
--created-after=YYYY-MM-DD|ISO-8601 Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) >= value
|
|
881
|
+
--created-before=YYYY-MM-DD|ISO-8601 Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) <= value
|
|
882
|
+
--document-type=<value>... Filter by document type ids (repeatable or comma-separated)
|
|
883
|
+
--document-type-not=<value>... Exclude document type ids (repeatable or comma-separated)
|
|
884
|
+
--id-in=<value>... Filter by id list (repeatable or comma-separated)
|
|
885
|
+
--modified-after=YYYY-MM-DD|ISO-8601 Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) >= value
|
|
886
|
+
--modified-before=YYYY-MM-DD|ISO-8601 Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) <= value
|
|
887
|
+
--name-contains=<value> Filter by name substring
|
|
888
|
+
--no-correspondent Filter documents with no correspondent
|
|
889
|
+
--no-document-type Filter documents with no document type
|
|
890
|
+
--no-tag Filter documents with no tags
|
|
891
|
+
--tag=<value>... Filter by tag ids (repeatable or comma-separated, OR)
|
|
892
|
+
--tag-all=<value>... Filter by tag ids (repeatable or comma-separated, AND)
|
|
893
|
+
--tag-not=<value>... Exclude tag ids (repeatable or comma-separated)
|
|
864
894
|
|
|
865
895
|
GLOBAL FLAGS
|
|
866
896
|
--date-format=<value> [default: yyyy-MM-dd, env: PPLS_DATE_FORMAT] Format output dates using a template.
|
|
@@ -880,7 +910,7 @@ EXAMPLES
|
|
|
880
910
|
$ ppls documents list
|
|
881
911
|
```
|
|
882
912
|
|
|
883
|
-
_See code: [src/commands/documents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
913
|
+
_See code: [src/commands/documents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/list.ts)_
|
|
884
914
|
|
|
885
915
|
## `ppls documents show ID`
|
|
886
916
|
|
|
@@ -912,7 +942,7 @@ EXAMPLES
|
|
|
912
942
|
$ ppls documents show 123
|
|
913
943
|
```
|
|
914
944
|
|
|
915
|
-
_See code: [src/commands/documents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
945
|
+
_See code: [src/commands/documents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/show.ts)_
|
|
916
946
|
|
|
917
947
|
## `ppls documents update ID`
|
|
918
948
|
|
|
@@ -955,7 +985,7 @@ EXAMPLES
|
|
|
955
985
|
$ ppls documents update 123 --title "Receipt"
|
|
956
986
|
```
|
|
957
987
|
|
|
958
|
-
_See code: [src/commands/documents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
988
|
+
_See code: [src/commands/documents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/documents/update.ts)_
|
|
959
989
|
|
|
960
990
|
## `ppls help [COMMAND]`
|
|
961
991
|
|
|
@@ -1007,7 +1037,7 @@ EXAMPLES
|
|
|
1007
1037
|
$ ppls profile
|
|
1008
1038
|
```
|
|
1009
1039
|
|
|
1010
|
-
_See code: [src/commands/profile.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1040
|
+
_See code: [src/commands/profile.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/profile.ts)_
|
|
1011
1041
|
|
|
1012
1042
|
## `ppls tags add NAME`
|
|
1013
1043
|
|
|
@@ -1044,7 +1074,7 @@ EXAMPLES
|
|
|
1044
1074
|
$ ppls tags add Inbox
|
|
1045
1075
|
```
|
|
1046
1076
|
|
|
1047
|
-
_See code: [src/commands/tags/add.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1077
|
+
_See code: [src/commands/tags/add.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/tags/add.ts)_
|
|
1048
1078
|
|
|
1049
1079
|
## `ppls tags delete ID`
|
|
1050
1080
|
|
|
@@ -1079,7 +1109,7 @@ EXAMPLES
|
|
|
1079
1109
|
$ ppls tags delete 123
|
|
1080
1110
|
```
|
|
1081
1111
|
|
|
1082
|
-
_See code: [src/commands/tags/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1112
|
+
_See code: [src/commands/tags/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/tags/delete.ts)_
|
|
1083
1113
|
|
|
1084
1114
|
## `ppls tags list`
|
|
1085
1115
|
|
|
@@ -1088,15 +1118,13 @@ List tags
|
|
|
1088
1118
|
```
|
|
1089
1119
|
USAGE
|
|
1090
1120
|
$ ppls tags list [--date-format <value>] [--header <value>...] [--hostname <value>] [--plain | --json |
|
|
1091
|
-
--table] [--token <value>] [--id-in <value
|
|
1092
|
-
<value>]
|
|
1121
|
+
--table] [--token <value>] [--id-in <value>... | --name-contains <value>] [--page <value> --page-size <value>]
|
|
1122
|
+
[--sort <value>]
|
|
1093
1123
|
|
|
1094
1124
|
FLAGS
|
|
1095
|
-
--
|
|
1096
|
-
--
|
|
1097
|
-
--
|
|
1098
|
-
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
1099
|
-
--sort=<value> Sort results by the provided field
|
|
1125
|
+
--page=<value> Page number to fetch
|
|
1126
|
+
--page-size=<value> [default: disable pagination, all results] Number of results per page
|
|
1127
|
+
--sort=<value> Sort results by the provided field
|
|
1100
1128
|
|
|
1101
1129
|
GLOBAL FLAGS
|
|
1102
1130
|
--date-format=<value> [default: yyyy-MM-dd, env: PPLS_DATE_FORMAT] Format output dates using a template.
|
|
@@ -1109,6 +1137,10 @@ ENVIRONMENT FLAGS
|
|
|
1109
1137
|
--hostname=<value> [env: PPLS_HOSTNAME] Paperless-ngx base URL
|
|
1110
1138
|
--token=<value> [env: PPLS_TOKEN] Paperless-ngx API token
|
|
1111
1139
|
|
|
1140
|
+
FILTER FLAGS
|
|
1141
|
+
--id-in=<value>... Filter by id list (repeatable or comma-separated)
|
|
1142
|
+
--name-contains=<value> Filter by name substring
|
|
1143
|
+
|
|
1112
1144
|
DESCRIPTION
|
|
1113
1145
|
List tags
|
|
1114
1146
|
|
|
@@ -1116,7 +1148,7 @@ EXAMPLES
|
|
|
1116
1148
|
$ ppls tags list
|
|
1117
1149
|
```
|
|
1118
1150
|
|
|
1119
|
-
_See code: [src/commands/tags/list.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1151
|
+
_See code: [src/commands/tags/list.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/tags/list.ts)_
|
|
1120
1152
|
|
|
1121
1153
|
## `ppls tags show ID`
|
|
1122
1154
|
|
|
@@ -1148,7 +1180,7 @@ EXAMPLES
|
|
|
1148
1180
|
$ ppls tags show 123
|
|
1149
1181
|
```
|
|
1150
1182
|
|
|
1151
|
-
_See code: [src/commands/tags/show.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1183
|
+
_See code: [src/commands/tags/show.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/tags/show.ts)_
|
|
1152
1184
|
|
|
1153
1185
|
## `ppls tags update ID`
|
|
1154
1186
|
|
|
@@ -1186,5 +1218,5 @@ EXAMPLES
|
|
|
1186
1218
|
$ ppls tags update 123 --name Inbox
|
|
1187
1219
|
```
|
|
1188
1220
|
|
|
1189
|
-
_See code: [src/commands/tags/update.ts](https://github.com/nickchristensen/ppls/blob/v1.
|
|
1221
|
+
_See code: [src/commands/tags/update.ts](https://github.com/nickchristensen/ppls/blob/v1.2.0/src/commands/tags/update.ts)_
|
|
1190
1222
|
<!-- commandsstop -->
|
package/dist/base-command.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type ApiFlags = {
|
|
|
6
6
|
hostname: string;
|
|
7
7
|
token: string;
|
|
8
8
|
};
|
|
9
|
+
type QueryParams = Record<string, number | number[] | string | string[] | undefined>;
|
|
9
10
|
type ResolvedGlobalFlags = ApiFlags & {
|
|
10
11
|
dateFormat: string;
|
|
11
12
|
};
|
|
@@ -29,14 +30,14 @@ export declare abstract class BaseCommand extends Command {
|
|
|
29
30
|
};
|
|
30
31
|
static enableJsonFlag: boolean;
|
|
31
32
|
private userConfigPromise?;
|
|
32
|
-
protected buildApiUrl(hostnameValue: string, path: string, params?:
|
|
33
|
-
protected buildApiUrlFromFlags(flags: ApiFlags, path: string, params?:
|
|
33
|
+
protected buildApiUrl(hostnameValue: string, path: string, params?: QueryParams): URL;
|
|
34
|
+
protected buildApiUrlFromFlags(flags: ApiFlags, path: string, params?: QueryParams): URL;
|
|
34
35
|
protected deleteApiJson<T>(flags: ApiFlags, path: string): Promise<null | T>;
|
|
35
|
-
protected fetchApiBinary(flags: ApiFlags, path: string, params?:
|
|
36
|
+
protected fetchApiBinary(flags: ApiFlags, path: string, params?: QueryParams): Promise<{
|
|
36
37
|
data: Uint8Array;
|
|
37
38
|
headers: Headers;
|
|
38
39
|
}>;
|
|
39
|
-
protected fetchApiJson<T>(flags: ApiFlags, path: string, params?:
|
|
40
|
+
protected fetchApiJson<T>(flags: ApiFlags, path: string, params?: QueryParams): Promise<T>;
|
|
40
41
|
protected fetchJson<T>(url: URL, tokenValue: string, headers?: Record<string, string>): Promise<T>;
|
|
41
42
|
protected formatErrorMessage(response: Response): Promise<string>;
|
|
42
43
|
protected loadUserConfig(): Promise<UserConfig>;
|
|
@@ -31,7 +31,7 @@ type DownloadDocumentsOptions = {
|
|
|
31
31
|
};
|
|
32
32
|
export default class DocumentsDownload extends BaseCommand {
|
|
33
33
|
static args: {
|
|
34
|
-
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
34
|
+
id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
35
35
|
};
|
|
36
36
|
static description: string;
|
|
37
37
|
static examples: string[];
|
|
@@ -40,9 +40,9 @@ export default class DocumentsDownload extends BaseCommand {
|
|
|
40
40
|
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
41
41
|
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
42
42
|
};
|
|
43
|
+
static strict: boolean;
|
|
43
44
|
protected downloadDocument(options: DownloadDocumentOptions): Promise<DownloadResult>;
|
|
44
45
|
protected downloadDocuments(options: DownloadDocumentsOptions): Promise<DownloadResult[]>;
|
|
45
|
-
protected parseIds(raw: string): number[];
|
|
46
46
|
run(): Promise<DownloadResult | DownloadResult[]>;
|
|
47
47
|
}
|
|
48
48
|
export {};
|
|
@@ -40,14 +40,26 @@ const resolveOutputPath = async (output, filename) => {
|
|
|
40
40
|
}
|
|
41
41
|
return resolved;
|
|
42
42
|
};
|
|
43
|
+
const splitDelimitedValues = (input, delimiter) => {
|
|
44
|
+
const splitRegex = new RegExp(`(?<!\\\\)${delimiter}`);
|
|
45
|
+
return input
|
|
46
|
+
.split(splitRegex)
|
|
47
|
+
.map((value) => value.trim())
|
|
48
|
+
.map((value) => value
|
|
49
|
+
.replaceAll(new RegExp(`\\\\${delimiter}`, 'g'), delimiter)
|
|
50
|
+
.replace(/^"(.*)"$/, '$1')
|
|
51
|
+
.replace(/^'(.*)'$/, '$1'))
|
|
52
|
+
.filter((value) => value.length > 0);
|
|
53
|
+
};
|
|
43
54
|
export default class DocumentsDownload extends BaseCommand {
|
|
44
55
|
static args = {
|
|
45
|
-
id: Args.string({ description: 'Document id or comma-separated
|
|
56
|
+
id: Args.string({ description: 'Document id (repeatable or comma-separated)' }),
|
|
46
57
|
};
|
|
47
58
|
static description = 'Download one or more documents';
|
|
48
59
|
static examples = [
|
|
49
|
-
'<%= config.bin %> <%= command.id %>
|
|
50
|
-
'<%= config.bin %> <%= command.id %>
|
|
60
|
+
'<%= config.bin %> <%= command.id %> --output document.pdf 123',
|
|
61
|
+
'<%= config.bin %> <%= command.id %> --output-dir ./downloads 123 456',
|
|
62
|
+
'<%= config.bin %> <%= command.id %> --output-dir ./downloads 123,456',
|
|
51
63
|
];
|
|
52
64
|
static flags = {
|
|
53
65
|
original: Flags.boolean({ description: 'Download original file' }),
|
|
@@ -62,6 +74,7 @@ export default class DocumentsDownload extends BaseCommand {
|
|
|
62
74
|
exists: true,
|
|
63
75
|
}),
|
|
64
76
|
};
|
|
77
|
+
static strict = false;
|
|
65
78
|
async downloadDocument(options) {
|
|
66
79
|
const { apiFlags, id, original, output, outputDir } = options;
|
|
67
80
|
const { data, headers: responseHeaders } = await this.fetchApiBinary(apiFlags, `/api/documents/${id}/download/`, {
|
|
@@ -103,28 +116,22 @@ export default class DocumentsDownload extends BaseCommand {
|
|
|
103
116
|
}
|
|
104
117
|
return results;
|
|
105
118
|
}
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
async run() {
|
|
120
|
+
const { flags, metadata, raw } = await this.parse();
|
|
121
|
+
const { headers: apiHeaders, hostname, token } = await this.resolveGlobalFlags(flags, metadata);
|
|
122
|
+
const apiFlags = { headers: apiHeaders, hostname, token };
|
|
123
|
+
const typedFlags = flags;
|
|
124
|
+
const rawArgs = raw.filter((token) => token.type === 'arg').map((token) => token.input);
|
|
125
|
+
const values = rawArgs.flatMap((value) => splitDelimitedValues(value, ','));
|
|
111
126
|
if (values.length === 0) {
|
|
112
127
|
this.error('Provide at least one document id.');
|
|
113
128
|
}
|
|
114
|
-
|
|
129
|
+
const ids = values.map((value) => {
|
|
115
130
|
if (!/^-?\d+$/.test(value)) {
|
|
116
131
|
this.error(`Invalid document id: ${value}`);
|
|
117
132
|
}
|
|
118
133
|
return Number.parseInt(value, 10);
|
|
119
134
|
});
|
|
120
|
-
}
|
|
121
|
-
async run() {
|
|
122
|
-
const { args, flags, metadata } = await this.parse();
|
|
123
|
-
const { headers: apiHeaders, hostname, token } = await this.resolveGlobalFlags(flags, metadata);
|
|
124
|
-
const apiFlags = { headers: apiHeaders, hostname, token };
|
|
125
|
-
const typedArgs = args;
|
|
126
|
-
const typedFlags = flags;
|
|
127
|
-
const ids = this.parseIds(typedArgs.id);
|
|
128
135
|
let outputDir = typedFlags['output-dir'];
|
|
129
136
|
if (ids.length > 1) {
|
|
130
137
|
if (typedFlags.output) {
|
|
@@ -3,8 +3,38 @@ import { ListCommand } from '../../list-command.js';
|
|
|
3
3
|
export default class DocumentsList extends ListCommand<Document> {
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'added-after': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'added-before': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
correspondent: import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'correspondent-not': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'created-after': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'created-before': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'document-type': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'document-type-not': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'modified-after': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'modified-before': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'no-correspondent': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
'no-document-type': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'no-tag': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
tag: import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'tag-all': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'tag-not': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'id-in': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'name-contains': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
page: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
sort: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
'date-format': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
29
|
+
header: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
30
|
+
hostname: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
31
|
+
plain: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
32
|
+
table: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
33
|
+
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
34
|
+
};
|
|
6
35
|
protected listPath: string;
|
|
7
36
|
protected tableAttrs: string[];
|
|
8
|
-
protected
|
|
37
|
+
protected extraListFlags(flags: Record<string, unknown>): Record<string, unknown>;
|
|
38
|
+
protected listParams(flags: Parameters<ListCommand['listParams']>[0]): Record<string, number | number[] | string | string[] | undefined>;
|
|
9
39
|
protected plainTemplate(document: Document): string | undefined;
|
|
10
40
|
}
|
|
@@ -1,14 +1,178 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { dateLike } from '../../flags/date-like.js';
|
|
3
|
+
import { isDateOnly } from '../../helpers/date-utils.js';
|
|
1
4
|
import { ListCommand } from '../../list-command.js';
|
|
5
|
+
const DATE_RANGE_FLAGS = {
|
|
6
|
+
added: {
|
|
7
|
+
after: 'added-after',
|
|
8
|
+
before: 'added-before',
|
|
9
|
+
},
|
|
10
|
+
created: {
|
|
11
|
+
after: 'created-after',
|
|
12
|
+
before: 'created-before',
|
|
13
|
+
},
|
|
14
|
+
modified: {
|
|
15
|
+
after: 'modified-after',
|
|
16
|
+
before: 'modified-before',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const addDateRangeParams = (params, field, flags) => {
|
|
20
|
+
const { after, before } = DATE_RANGE_FLAGS[field];
|
|
21
|
+
const typedFlags = flags;
|
|
22
|
+
const afterValue = typedFlags[after];
|
|
23
|
+
const beforeValue = typedFlags[before];
|
|
24
|
+
if (afterValue) {
|
|
25
|
+
const key = isDateOnly(afterValue) ? `${field}__date__gte` : `${field}__gte`;
|
|
26
|
+
params[key] = afterValue;
|
|
27
|
+
}
|
|
28
|
+
if (beforeValue) {
|
|
29
|
+
const key = isDateOnly(beforeValue) ? `${field}__date__lte` : `${field}__lte`;
|
|
30
|
+
params[key] = beforeValue;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
2
33
|
export default class DocumentsList extends ListCommand {
|
|
3
34
|
static description = 'List documents';
|
|
4
35
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
36
|
+
static flags = {
|
|
37
|
+
...ListCommand.baseFlags,
|
|
38
|
+
'added-after': dateLike({
|
|
39
|
+
description: 'Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) >= value',
|
|
40
|
+
exclusive: ['id-in'],
|
|
41
|
+
helpGroup: 'FILTER',
|
|
42
|
+
}),
|
|
43
|
+
'added-before': dateLike({
|
|
44
|
+
description: 'Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) <= value',
|
|
45
|
+
exclusive: ['id-in'],
|
|
46
|
+
helpGroup: 'FILTER',
|
|
47
|
+
}),
|
|
48
|
+
correspondent: Flags.integer({
|
|
49
|
+
delimiter: ',',
|
|
50
|
+
description: 'Filter by correspondent ids (repeatable or comma-separated)',
|
|
51
|
+
exclusive: ['id-in'],
|
|
52
|
+
helpGroup: 'FILTER',
|
|
53
|
+
multiple: true,
|
|
54
|
+
}),
|
|
55
|
+
'correspondent-not': Flags.integer({
|
|
56
|
+
delimiter: ',',
|
|
57
|
+
description: 'Exclude correspondent ids (repeatable or comma-separated)',
|
|
58
|
+
exclusive: ['id-in'],
|
|
59
|
+
helpGroup: 'FILTER',
|
|
60
|
+
multiple: true,
|
|
61
|
+
}),
|
|
62
|
+
'created-after': dateLike({
|
|
63
|
+
description: 'Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) >= value',
|
|
64
|
+
exclusive: ['id-in'],
|
|
65
|
+
helpGroup: 'FILTER',
|
|
66
|
+
}),
|
|
67
|
+
'created-before': dateLike({
|
|
68
|
+
description: 'Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) <= value',
|
|
69
|
+
exclusive: ['id-in'],
|
|
70
|
+
helpGroup: 'FILTER',
|
|
71
|
+
}),
|
|
72
|
+
'document-type': Flags.integer({
|
|
73
|
+
delimiter: ',',
|
|
74
|
+
description: 'Filter by document type ids (repeatable or comma-separated)',
|
|
75
|
+
exclusive: ['id-in'],
|
|
76
|
+
helpGroup: 'FILTER',
|
|
77
|
+
multiple: true,
|
|
78
|
+
}),
|
|
79
|
+
'document-type-not': Flags.integer({
|
|
80
|
+
delimiter: ',',
|
|
81
|
+
description: 'Exclude document type ids (repeatable or comma-separated)',
|
|
82
|
+
exclusive: ['id-in'],
|
|
83
|
+
helpGroup: 'FILTER',
|
|
84
|
+
multiple: true,
|
|
85
|
+
}),
|
|
86
|
+
'modified-after': dateLike({
|
|
87
|
+
description: 'Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) >= value',
|
|
88
|
+
exclusive: ['id-in'],
|
|
89
|
+
helpGroup: 'FILTER',
|
|
90
|
+
}),
|
|
91
|
+
'modified-before': dateLike({
|
|
92
|
+
description: 'Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) <= value',
|
|
93
|
+
exclusive: ['id-in'],
|
|
94
|
+
helpGroup: 'FILTER',
|
|
95
|
+
}),
|
|
96
|
+
'no-correspondent': Flags.boolean({
|
|
97
|
+
description: 'Filter documents with no correspondent',
|
|
98
|
+
exclusive: ['correspondent', 'correspondent-not', 'id-in'],
|
|
99
|
+
helpGroup: 'FILTER',
|
|
100
|
+
}),
|
|
101
|
+
'no-document-type': Flags.boolean({
|
|
102
|
+
description: 'Filter documents with no document type',
|
|
103
|
+
exclusive: ['document-type', 'document-type-not', 'id-in'],
|
|
104
|
+
helpGroup: 'FILTER',
|
|
105
|
+
}),
|
|
106
|
+
'no-tag': Flags.boolean({
|
|
107
|
+
description: 'Filter documents with no tags',
|
|
108
|
+
exclusive: ['tag', 'tag-all', 'tag-not', 'id-in'],
|
|
109
|
+
helpGroup: 'FILTER',
|
|
110
|
+
}),
|
|
111
|
+
tag: Flags.integer({
|
|
112
|
+
delimiter: ',',
|
|
113
|
+
description: 'Filter by tag ids (repeatable or comma-separated, OR)',
|
|
114
|
+
exclusive: ['id-in'],
|
|
115
|
+
helpGroup: 'FILTER',
|
|
116
|
+
multiple: true,
|
|
117
|
+
}),
|
|
118
|
+
'tag-all': Flags.integer({
|
|
119
|
+
delimiter: ',',
|
|
120
|
+
description: 'Filter by tag ids (repeatable or comma-separated, AND)',
|
|
121
|
+
exclusive: ['id-in'],
|
|
122
|
+
helpGroup: 'FILTER',
|
|
123
|
+
multiple: true,
|
|
124
|
+
}),
|
|
125
|
+
'tag-not': Flags.integer({
|
|
126
|
+
delimiter: ',',
|
|
127
|
+
description: 'Exclude tag ids (repeatable or comma-separated)',
|
|
128
|
+
exclusive: ['id-in'],
|
|
129
|
+
helpGroup: 'FILTER',
|
|
130
|
+
multiple: true,
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
5
133
|
listPath = '/api/documents/';
|
|
6
134
|
tableAttrs = ['id', 'title', 'created', 'added', 'correspondent', 'document_type', 'tags'];
|
|
135
|
+
extraListFlags(flags) {
|
|
136
|
+
const typedFlags = flags;
|
|
137
|
+
return {
|
|
138
|
+
'added-after': typedFlags['added-after'],
|
|
139
|
+
'added-before': typedFlags['added-before'],
|
|
140
|
+
correspondent: typedFlags.correspondent,
|
|
141
|
+
'correspondent-not': typedFlags['correspondent-not'],
|
|
142
|
+
'created-after': typedFlags['created-after'],
|
|
143
|
+
'created-before': typedFlags['created-before'],
|
|
144
|
+
'document-type': typedFlags['document-type'],
|
|
145
|
+
'document-type-not': typedFlags['document-type-not'],
|
|
146
|
+
'modified-after': typedFlags['modified-after'],
|
|
147
|
+
'modified-before': typedFlags['modified-before'],
|
|
148
|
+
'no-correspondent': typedFlags['no-correspondent'],
|
|
149
|
+
'no-document-type': typedFlags['no-document-type'],
|
|
150
|
+
'no-tag': typedFlags['no-tag'],
|
|
151
|
+
tag: typedFlags.tag,
|
|
152
|
+
'tag-all': typedFlags['tag-all'],
|
|
153
|
+
'tag-not': typedFlags['tag-not'],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
7
156
|
listParams(flags) {
|
|
157
|
+
const typedFlags = flags;
|
|
8
158
|
const params = super.listParams(flags);
|
|
9
159
|
delete params.name__icontains;
|
|
10
|
-
|
|
160
|
+
/* eslint-disable camelcase -- API uses double-underscore field names. */
|
|
11
161
|
params.title__icontains = flags['name-contains'];
|
|
162
|
+
params.tags__id__in = typedFlags.tag;
|
|
163
|
+
params.tags__id__all = typedFlags['tag-all'];
|
|
164
|
+
params.tags__id__none = typedFlags['tag-not'];
|
|
165
|
+
params.is_tagged = typedFlags['no-tag'] ? 'false' : undefined;
|
|
166
|
+
params.correspondent__id__in = typedFlags.correspondent;
|
|
167
|
+
params.correspondent__id__none = typedFlags['correspondent-not'];
|
|
168
|
+
params.correspondent__isnull = typedFlags['no-correspondent'] ? 'true' : undefined;
|
|
169
|
+
params.document_type__id__in = typedFlags['document-type'];
|
|
170
|
+
params.document_type__id__none = typedFlags['document-type-not'];
|
|
171
|
+
params.document_type__isnull = typedFlags['no-document-type'] ? 'true' : undefined;
|
|
172
|
+
/* eslint-enable camelcase */
|
|
173
|
+
addDateRangeParams(params, 'added', typedFlags);
|
|
174
|
+
addDateRangeParams(params, 'created', typedFlags);
|
|
175
|
+
addDateRangeParams(params, 'modified', typedFlags);
|
|
12
176
|
return params;
|
|
13
177
|
}
|
|
14
178
|
plainTemplate(document) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { isDateOnly, isDateTime } from '../helpers/date-utils.js';
|
|
3
|
+
export const dateLike = Flags.custom({
|
|
4
|
+
helpValue: 'YYYY-MM-DD|ISO-8601',
|
|
5
|
+
async parse(input) {
|
|
6
|
+
if (isDateOnly(input) || isDateTime(input)) {
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
throw new Error('Use YYYY-MM-DD or an ISO 8601 datetime.');
|
|
10
|
+
},
|
|
11
|
+
});
|
package/dist/list-command.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ApiFlags } from './base-command.js';
|
|
|
2
2
|
import { BaseCommand } from './base-command.js';
|
|
3
3
|
import { type TableColumn, type TableRow } from './helpers/table.js';
|
|
4
4
|
type ListCommandFlags = ApiFlags & {
|
|
5
|
-
'id-in'?: string;
|
|
5
|
+
'id-in'?: string[];
|
|
6
6
|
'name-contains'?: string;
|
|
7
7
|
page?: number;
|
|
8
8
|
'page-size': number;
|
|
@@ -16,7 +16,7 @@ type ListOutputFlags = ListCommandFlags & {
|
|
|
16
16
|
type TableColumnInput = string | TableColumn;
|
|
17
17
|
export declare abstract class ListCommand<TRaw extends TableRow = TableRow, TOutput extends TableRow = TRaw> extends BaseCommand {
|
|
18
18
|
static baseFlags: {
|
|
19
|
-
'id-in': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
'id-in': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
20
|
'name-contains': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
21
|
page: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
22
|
'page-size': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -30,12 +30,13 @@ export declare abstract class ListCommand<TRaw extends TableRow = TableRow, TOut
|
|
|
30
30
|
};
|
|
31
31
|
protected abstract listPath: string;
|
|
32
32
|
protected abstract tableAttrs: TableColumnInput[];
|
|
33
|
+
protected extraListFlags(_flags: Record<string, unknown>): Record<string, unknown>;
|
|
33
34
|
protected fetchListResults<T>(options: {
|
|
34
35
|
flags: ListCommandFlags;
|
|
35
|
-
params?: Record<string, number | string | undefined>;
|
|
36
|
+
params?: Record<string, number | number[] | string | string[] | undefined>;
|
|
36
37
|
path: string;
|
|
37
38
|
}): Promise<T[]>;
|
|
38
|
-
protected listParams(flags: ListCommandFlags): Record<string, number | string | undefined>;
|
|
39
|
+
protected listParams(flags: ListCommandFlags): Record<string, number | number[] | string | string[] | undefined>;
|
|
39
40
|
protected abstract plainTemplate(item: TOutput): null | string | undefined;
|
|
40
41
|
protected renderListOutput(options: {
|
|
41
42
|
flags: ListOutputFlags;
|
package/dist/list-command.js
CHANGED
|
@@ -5,12 +5,16 @@ export class ListCommand extends BaseCommand {
|
|
|
5
5
|
static baseFlags = {
|
|
6
6
|
...BaseCommand.baseFlags,
|
|
7
7
|
'id-in': Flags.string({
|
|
8
|
-
|
|
8
|
+
delimiter: ',',
|
|
9
|
+
description: 'Filter by id list (repeatable or comma-separated)',
|
|
9
10
|
exclusive: ['name-contains'],
|
|
11
|
+
helpGroup: 'FILTER',
|
|
12
|
+
multiple: true,
|
|
10
13
|
}),
|
|
11
14
|
'name-contains': Flags.string({
|
|
12
15
|
description: 'Filter by name substring',
|
|
13
16
|
exclusive: ['id-in'],
|
|
17
|
+
helpGroup: 'FILTER',
|
|
14
18
|
}),
|
|
15
19
|
page: Flags.integer({
|
|
16
20
|
dependsOn: ['page-size'],
|
|
@@ -25,6 +29,9 @@ export class ListCommand extends BaseCommand {
|
|
|
25
29
|
}),
|
|
26
30
|
sort: Flags.string({ description: 'Sort results by the provided field' }),
|
|
27
31
|
};
|
|
32
|
+
extraListFlags(_flags) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
28
35
|
async fetchListResults(options) {
|
|
29
36
|
const { flags, params = {}, path } = options;
|
|
30
37
|
const url = this.buildListUrl({
|
|
@@ -81,6 +88,7 @@ export class ListCommand extends BaseCommand {
|
|
|
81
88
|
'page-size': flags['page-size'],
|
|
82
89
|
sort: flags.sort,
|
|
83
90
|
token: apiFlags.token,
|
|
91
|
+
...this.extraListFlags(flags),
|
|
84
92
|
};
|
|
85
93
|
const outputFlags = {
|
|
86
94
|
...listFlags,
|
package/oclif.manifest.json
CHANGED
|
@@ -576,13 +576,15 @@
|
|
|
576
576
|
"type": "option"
|
|
577
577
|
},
|
|
578
578
|
"id-in": {
|
|
579
|
-
"description": "Filter by id list (comma-separated)",
|
|
579
|
+
"description": "Filter by id list (repeatable or comma-separated)",
|
|
580
580
|
"exclusive": [
|
|
581
581
|
"name-contains"
|
|
582
582
|
],
|
|
583
|
+
"helpGroup": "FILTER",
|
|
583
584
|
"name": "id-in",
|
|
585
|
+
"delimiter": ",",
|
|
584
586
|
"hasDynamicHelp": false,
|
|
585
|
-
"multiple":
|
|
587
|
+
"multiple": true,
|
|
586
588
|
"type": "option"
|
|
587
589
|
},
|
|
588
590
|
"name-contains": {
|
|
@@ -590,6 +592,7 @@
|
|
|
590
592
|
"exclusive": [
|
|
591
593
|
"id-in"
|
|
592
594
|
],
|
|
595
|
+
"helpGroup": "FILTER",
|
|
593
596
|
"name": "name-contains",
|
|
594
597
|
"hasDynamicHelp": false,
|
|
595
598
|
"multiple": false,
|
|
@@ -1157,13 +1160,15 @@
|
|
|
1157
1160
|
"type": "option"
|
|
1158
1161
|
},
|
|
1159
1162
|
"id-in": {
|
|
1160
|
-
"description": "Filter by id list (comma-separated)",
|
|
1163
|
+
"description": "Filter by id list (repeatable or comma-separated)",
|
|
1161
1164
|
"exclusive": [
|
|
1162
1165
|
"name-contains"
|
|
1163
1166
|
],
|
|
1167
|
+
"helpGroup": "FILTER",
|
|
1164
1168
|
"name": "id-in",
|
|
1169
|
+
"delimiter": ",",
|
|
1165
1170
|
"hasDynamicHelp": false,
|
|
1166
|
-
"multiple":
|
|
1171
|
+
"multiple": true,
|
|
1167
1172
|
"type": "option"
|
|
1168
1173
|
},
|
|
1169
1174
|
"name-contains": {
|
|
@@ -1171,6 +1176,7 @@
|
|
|
1171
1176
|
"exclusive": [
|
|
1172
1177
|
"id-in"
|
|
1173
1178
|
],
|
|
1179
|
+
"helpGroup": "FILTER",
|
|
1174
1180
|
"name": "name-contains",
|
|
1175
1181
|
"hasDynamicHelp": false,
|
|
1176
1182
|
"multiple": false,
|
|
@@ -1737,13 +1743,15 @@
|
|
|
1737
1743
|
"type": "option"
|
|
1738
1744
|
},
|
|
1739
1745
|
"id-in": {
|
|
1740
|
-
"description": "Filter by id list (comma-separated)",
|
|
1746
|
+
"description": "Filter by id list (repeatable or comma-separated)",
|
|
1741
1747
|
"exclusive": [
|
|
1742
1748
|
"name-contains"
|
|
1743
1749
|
],
|
|
1750
|
+
"helpGroup": "FILTER",
|
|
1744
1751
|
"name": "id-in",
|
|
1752
|
+
"delimiter": ",",
|
|
1745
1753
|
"hasDynamicHelp": false,
|
|
1746
|
-
"multiple":
|
|
1754
|
+
"multiple": true,
|
|
1747
1755
|
"type": "option"
|
|
1748
1756
|
},
|
|
1749
1757
|
"name-contains": {
|
|
@@ -1751,6 +1759,7 @@
|
|
|
1751
1759
|
"exclusive": [
|
|
1752
1760
|
"id-in"
|
|
1753
1761
|
],
|
|
1762
|
+
"helpGroup": "FILTER",
|
|
1754
1763
|
"name": "name-contains",
|
|
1755
1764
|
"hasDynamicHelp": false,
|
|
1756
1765
|
"multiple": false,
|
|
@@ -2249,15 +2258,15 @@
|
|
|
2249
2258
|
"aliases": [],
|
|
2250
2259
|
"args": {
|
|
2251
2260
|
"id": {
|
|
2252
|
-
"description": "Document id or comma-separated
|
|
2253
|
-
"name": "id"
|
|
2254
|
-
"required": true
|
|
2261
|
+
"description": "Document id (repeatable or comma-separated)",
|
|
2262
|
+
"name": "id"
|
|
2255
2263
|
}
|
|
2256
2264
|
},
|
|
2257
2265
|
"description": "Download one or more documents",
|
|
2258
2266
|
"examples": [
|
|
2259
|
-
"<%= config.bin %> <%= command.id %>
|
|
2260
|
-
"<%= config.bin %> <%= command.id %>
|
|
2267
|
+
"<%= config.bin %> <%= command.id %> --output document.pdf 123",
|
|
2268
|
+
"<%= config.bin %> <%= command.id %> --output-dir ./downloads 123 456",
|
|
2269
|
+
"<%= config.bin %> <%= command.id %> --output-dir ./downloads 123,456"
|
|
2261
2270
|
],
|
|
2262
2271
|
"flags": {
|
|
2263
2272
|
"json": {
|
|
@@ -2360,7 +2369,7 @@
|
|
|
2360
2369
|
"pluginAlias": "@nickchristensen/ppls",
|
|
2361
2370
|
"pluginName": "@nickchristensen/ppls",
|
|
2362
2371
|
"pluginType": "core",
|
|
2363
|
-
"strict":
|
|
2372
|
+
"strict": false,
|
|
2364
2373
|
"enableJsonFlag": true,
|
|
2365
2374
|
"isESM": true,
|
|
2366
2375
|
"relativePath": [
|
|
@@ -2445,13 +2454,15 @@
|
|
|
2445
2454
|
"type": "option"
|
|
2446
2455
|
},
|
|
2447
2456
|
"id-in": {
|
|
2448
|
-
"description": "Filter by id list (comma-separated)",
|
|
2457
|
+
"description": "Filter by id list (repeatable or comma-separated)",
|
|
2449
2458
|
"exclusive": [
|
|
2450
2459
|
"name-contains"
|
|
2451
2460
|
],
|
|
2461
|
+
"helpGroup": "FILTER",
|
|
2452
2462
|
"name": "id-in",
|
|
2463
|
+
"delimiter": ",",
|
|
2453
2464
|
"hasDynamicHelp": false,
|
|
2454
|
-
"multiple":
|
|
2465
|
+
"multiple": true,
|
|
2455
2466
|
"type": "option"
|
|
2456
2467
|
},
|
|
2457
2468
|
"name-contains": {
|
|
@@ -2459,6 +2470,7 @@
|
|
|
2459
2470
|
"exclusive": [
|
|
2460
2471
|
"id-in"
|
|
2461
2472
|
],
|
|
2473
|
+
"helpGroup": "FILTER",
|
|
2462
2474
|
"name": "name-contains",
|
|
2463
2475
|
"hasDynamicHelp": false,
|
|
2464
2476
|
"multiple": false,
|
|
@@ -2488,6 +2500,199 @@
|
|
|
2488
2500
|
"hasDynamicHelp": false,
|
|
2489
2501
|
"multiple": false,
|
|
2490
2502
|
"type": "option"
|
|
2503
|
+
},
|
|
2504
|
+
"added-after": {
|
|
2505
|
+
"description": "Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) >= value",
|
|
2506
|
+
"exclusive": [
|
|
2507
|
+
"id-in"
|
|
2508
|
+
],
|
|
2509
|
+
"helpGroup": "FILTER",
|
|
2510
|
+
"name": "added-after",
|
|
2511
|
+
"hasDynamicHelp": false,
|
|
2512
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2513
|
+
"multiple": false,
|
|
2514
|
+
"type": "option"
|
|
2515
|
+
},
|
|
2516
|
+
"added-before": {
|
|
2517
|
+
"description": "Filter by added date (YYYY-MM-DD) or datetime (ISO 8601) <= value",
|
|
2518
|
+
"exclusive": [
|
|
2519
|
+
"id-in"
|
|
2520
|
+
],
|
|
2521
|
+
"helpGroup": "FILTER",
|
|
2522
|
+
"name": "added-before",
|
|
2523
|
+
"hasDynamicHelp": false,
|
|
2524
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2525
|
+
"multiple": false,
|
|
2526
|
+
"type": "option"
|
|
2527
|
+
},
|
|
2528
|
+
"correspondent": {
|
|
2529
|
+
"description": "Filter by correspondent ids (repeatable or comma-separated)",
|
|
2530
|
+
"exclusive": [
|
|
2531
|
+
"id-in"
|
|
2532
|
+
],
|
|
2533
|
+
"helpGroup": "FILTER",
|
|
2534
|
+
"name": "correspondent",
|
|
2535
|
+
"delimiter": ",",
|
|
2536
|
+
"hasDynamicHelp": false,
|
|
2537
|
+
"multiple": true,
|
|
2538
|
+
"type": "option"
|
|
2539
|
+
},
|
|
2540
|
+
"correspondent-not": {
|
|
2541
|
+
"description": "Exclude correspondent ids (repeatable or comma-separated)",
|
|
2542
|
+
"exclusive": [
|
|
2543
|
+
"id-in"
|
|
2544
|
+
],
|
|
2545
|
+
"helpGroup": "FILTER",
|
|
2546
|
+
"name": "correspondent-not",
|
|
2547
|
+
"delimiter": ",",
|
|
2548
|
+
"hasDynamicHelp": false,
|
|
2549
|
+
"multiple": true,
|
|
2550
|
+
"type": "option"
|
|
2551
|
+
},
|
|
2552
|
+
"created-after": {
|
|
2553
|
+
"description": "Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) >= value",
|
|
2554
|
+
"exclusive": [
|
|
2555
|
+
"id-in"
|
|
2556
|
+
],
|
|
2557
|
+
"helpGroup": "FILTER",
|
|
2558
|
+
"name": "created-after",
|
|
2559
|
+
"hasDynamicHelp": false,
|
|
2560
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2561
|
+
"multiple": false,
|
|
2562
|
+
"type": "option"
|
|
2563
|
+
},
|
|
2564
|
+
"created-before": {
|
|
2565
|
+
"description": "Filter by created date (YYYY-MM-DD) or datetime (ISO 8601) <= value",
|
|
2566
|
+
"exclusive": [
|
|
2567
|
+
"id-in"
|
|
2568
|
+
],
|
|
2569
|
+
"helpGroup": "FILTER",
|
|
2570
|
+
"name": "created-before",
|
|
2571
|
+
"hasDynamicHelp": false,
|
|
2572
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2573
|
+
"multiple": false,
|
|
2574
|
+
"type": "option"
|
|
2575
|
+
},
|
|
2576
|
+
"document-type": {
|
|
2577
|
+
"description": "Filter by document type ids (repeatable or comma-separated)",
|
|
2578
|
+
"exclusive": [
|
|
2579
|
+
"id-in"
|
|
2580
|
+
],
|
|
2581
|
+
"helpGroup": "FILTER",
|
|
2582
|
+
"name": "document-type",
|
|
2583
|
+
"delimiter": ",",
|
|
2584
|
+
"hasDynamicHelp": false,
|
|
2585
|
+
"multiple": true,
|
|
2586
|
+
"type": "option"
|
|
2587
|
+
},
|
|
2588
|
+
"document-type-not": {
|
|
2589
|
+
"description": "Exclude document type ids (repeatable or comma-separated)",
|
|
2590
|
+
"exclusive": [
|
|
2591
|
+
"id-in"
|
|
2592
|
+
],
|
|
2593
|
+
"helpGroup": "FILTER",
|
|
2594
|
+
"name": "document-type-not",
|
|
2595
|
+
"delimiter": ",",
|
|
2596
|
+
"hasDynamicHelp": false,
|
|
2597
|
+
"multiple": true,
|
|
2598
|
+
"type": "option"
|
|
2599
|
+
},
|
|
2600
|
+
"modified-after": {
|
|
2601
|
+
"description": "Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) >= value",
|
|
2602
|
+
"exclusive": [
|
|
2603
|
+
"id-in"
|
|
2604
|
+
],
|
|
2605
|
+
"helpGroup": "FILTER",
|
|
2606
|
+
"name": "modified-after",
|
|
2607
|
+
"hasDynamicHelp": false,
|
|
2608
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2609
|
+
"multiple": false,
|
|
2610
|
+
"type": "option"
|
|
2611
|
+
},
|
|
2612
|
+
"modified-before": {
|
|
2613
|
+
"description": "Filter by modified date (YYYY-MM-DD) or datetime (ISO 8601) <= value",
|
|
2614
|
+
"exclusive": [
|
|
2615
|
+
"id-in"
|
|
2616
|
+
],
|
|
2617
|
+
"helpGroup": "FILTER",
|
|
2618
|
+
"name": "modified-before",
|
|
2619
|
+
"hasDynamicHelp": false,
|
|
2620
|
+
"helpValue": "YYYY-MM-DD|ISO-8601",
|
|
2621
|
+
"multiple": false,
|
|
2622
|
+
"type": "option"
|
|
2623
|
+
},
|
|
2624
|
+
"no-correspondent": {
|
|
2625
|
+
"description": "Filter documents with no correspondent",
|
|
2626
|
+
"exclusive": [
|
|
2627
|
+
"correspondent",
|
|
2628
|
+
"correspondent-not",
|
|
2629
|
+
"id-in"
|
|
2630
|
+
],
|
|
2631
|
+
"helpGroup": "FILTER",
|
|
2632
|
+
"name": "no-correspondent",
|
|
2633
|
+
"allowNo": false,
|
|
2634
|
+
"type": "boolean"
|
|
2635
|
+
},
|
|
2636
|
+
"no-document-type": {
|
|
2637
|
+
"description": "Filter documents with no document type",
|
|
2638
|
+
"exclusive": [
|
|
2639
|
+
"document-type",
|
|
2640
|
+
"document-type-not",
|
|
2641
|
+
"id-in"
|
|
2642
|
+
],
|
|
2643
|
+
"helpGroup": "FILTER",
|
|
2644
|
+
"name": "no-document-type",
|
|
2645
|
+
"allowNo": false,
|
|
2646
|
+
"type": "boolean"
|
|
2647
|
+
},
|
|
2648
|
+
"no-tag": {
|
|
2649
|
+
"description": "Filter documents with no tags",
|
|
2650
|
+
"exclusive": [
|
|
2651
|
+
"tag",
|
|
2652
|
+
"tag-all",
|
|
2653
|
+
"tag-not",
|
|
2654
|
+
"id-in"
|
|
2655
|
+
],
|
|
2656
|
+
"helpGroup": "FILTER",
|
|
2657
|
+
"name": "no-tag",
|
|
2658
|
+
"allowNo": false,
|
|
2659
|
+
"type": "boolean"
|
|
2660
|
+
},
|
|
2661
|
+
"tag": {
|
|
2662
|
+
"description": "Filter by tag ids (repeatable or comma-separated, OR)",
|
|
2663
|
+
"exclusive": [
|
|
2664
|
+
"id-in"
|
|
2665
|
+
],
|
|
2666
|
+
"helpGroup": "FILTER",
|
|
2667
|
+
"name": "tag",
|
|
2668
|
+
"delimiter": ",",
|
|
2669
|
+
"hasDynamicHelp": false,
|
|
2670
|
+
"multiple": true,
|
|
2671
|
+
"type": "option"
|
|
2672
|
+
},
|
|
2673
|
+
"tag-all": {
|
|
2674
|
+
"description": "Filter by tag ids (repeatable or comma-separated, AND)",
|
|
2675
|
+
"exclusive": [
|
|
2676
|
+
"id-in"
|
|
2677
|
+
],
|
|
2678
|
+
"helpGroup": "FILTER",
|
|
2679
|
+
"name": "tag-all",
|
|
2680
|
+
"delimiter": ",",
|
|
2681
|
+
"hasDynamicHelp": false,
|
|
2682
|
+
"multiple": true,
|
|
2683
|
+
"type": "option"
|
|
2684
|
+
},
|
|
2685
|
+
"tag-not": {
|
|
2686
|
+
"description": "Exclude tag ids (repeatable or comma-separated)",
|
|
2687
|
+
"exclusive": [
|
|
2688
|
+
"id-in"
|
|
2689
|
+
],
|
|
2690
|
+
"helpGroup": "FILTER",
|
|
2691
|
+
"name": "tag-not",
|
|
2692
|
+
"delimiter": ",",
|
|
2693
|
+
"hasDynamicHelp": false,
|
|
2694
|
+
"multiple": true,
|
|
2695
|
+
"type": "option"
|
|
2491
2696
|
}
|
|
2492
2697
|
},
|
|
2493
2698
|
"hasDynamicHelp": true,
|
|
@@ -3048,13 +3253,15 @@
|
|
|
3048
3253
|
"type": "option"
|
|
3049
3254
|
},
|
|
3050
3255
|
"id-in": {
|
|
3051
|
-
"description": "Filter by id list (comma-separated)",
|
|
3256
|
+
"description": "Filter by id list (repeatable or comma-separated)",
|
|
3052
3257
|
"exclusive": [
|
|
3053
3258
|
"name-contains"
|
|
3054
3259
|
],
|
|
3260
|
+
"helpGroup": "FILTER",
|
|
3055
3261
|
"name": "id-in",
|
|
3262
|
+
"delimiter": ",",
|
|
3056
3263
|
"hasDynamicHelp": false,
|
|
3057
|
-
"multiple":
|
|
3264
|
+
"multiple": true,
|
|
3058
3265
|
"type": "option"
|
|
3059
3266
|
},
|
|
3060
3267
|
"name-contains": {
|
|
@@ -3062,6 +3269,7 @@
|
|
|
3062
3269
|
"exclusive": [
|
|
3063
3270
|
"id-in"
|
|
3064
3271
|
],
|
|
3272
|
+
"helpGroup": "FILTER",
|
|
3065
3273
|
"name": "name-contains",
|
|
3066
3274
|
"hasDynamicHelp": false,
|
|
3067
3275
|
"multiple": false,
|
|
@@ -3329,5 +3537,5 @@
|
|
|
3329
3537
|
]
|
|
3330
3538
|
}
|
|
3331
3539
|
},
|
|
3332
|
-
"version": "1.
|
|
3540
|
+
"version": "1.2.0"
|
|
3333
3541
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nickchristensen/ppls",
|
|
3
3
|
"description": "A node-based paperless-ngx cli",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"author": "Nick Christensen",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ppls": "bin/run.js"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"eslint": "^9",
|
|
26
26
|
"eslint-config-oclif": "^6",
|
|
27
27
|
"eslint-config-prettier": "^10",
|
|
28
|
+
"husky": "^9.1.7",
|
|
28
29
|
"mocha": "^10",
|
|
29
30
|
"oclif": "^4",
|
|
30
31
|
"shx": "^0.3.3",
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"lint": "eslint",
|
|
81
82
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
82
83
|
"posttest": "npm run lint",
|
|
84
|
+
"prepare": "husky install",
|
|
83
85
|
"prepack": "npm run build",
|
|
84
86
|
"postbuild": "oclif manifest && oclif readme --no-aliases",
|
|
85
87
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|