@nickchristensen/ppls 1.0.4 → 1.0.5
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 +32 -32
- package/dist/base-command.d.ts +0 -3
- package/dist/base-command.js +0 -26
- package/dist/commands/documents/list.d.ts +1 -0
- package/dist/commands/documents/list.js +7 -0
- package/dist/paginated-command.d.ts +1 -1
- package/dist/paginated-command.js +9 -9
- package/oclif.manifest.json +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -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.0.
|
|
111
|
+
_See code: [src/commands/config/get.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
134
|
+
_See code: [src/commands/config/init.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
158
|
+
_See code: [src/commands/config/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
181
|
+
_See code: [src/commands/config/remove.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
207
|
+
_See code: [src/commands/config/set.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
239
|
+
_See code: [src/commands/correspondents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/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.0.
|
|
274
|
+
_See code: [src/commands/correspondents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/correspondents/delete.ts)_
|
|
275
275
|
|
|
276
276
|
## `ppls correspondents list`
|
|
277
277
|
|
|
@@ -308,7 +308,7 @@ EXAMPLES
|
|
|
308
308
|
$ ppls correspondents list
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
_See code: [src/commands/correspondents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
311
|
+
_See code: [src/commands/correspondents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/correspondents/list.ts)_
|
|
312
312
|
|
|
313
313
|
## `ppls correspondents show ID`
|
|
314
314
|
|
|
@@ -340,7 +340,7 @@ EXAMPLES
|
|
|
340
340
|
$ ppls correspondents show 123
|
|
341
341
|
```
|
|
342
342
|
|
|
343
|
-
_See code: [src/commands/correspondents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
343
|
+
_See code: [src/commands/correspondents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/correspondents/show.ts)_
|
|
344
344
|
|
|
345
345
|
## `ppls correspondents update ID`
|
|
346
346
|
|
|
@@ -375,7 +375,7 @@ EXAMPLES
|
|
|
375
375
|
$ ppls correspondents update 123 --name "Acme Corp"
|
|
376
376
|
```
|
|
377
377
|
|
|
378
|
-
_See code: [src/commands/correspondents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
378
|
+
_See code: [src/commands/correspondents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/correspondents/update.ts)_
|
|
379
379
|
|
|
380
380
|
## `ppls custom-fields add NAME`
|
|
381
381
|
|
|
@@ -413,7 +413,7 @@ EXAMPLES
|
|
|
413
413
|
$ ppls custom-fields add "Due Date" --data-type date
|
|
414
414
|
```
|
|
415
415
|
|
|
416
|
-
_See code: [src/commands/custom-fields/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
416
|
+
_See code: [src/commands/custom-fields/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/custom-fields/add.ts)_
|
|
417
417
|
|
|
418
418
|
## `ppls custom-fields delete ID`
|
|
419
419
|
|
|
@@ -448,7 +448,7 @@ EXAMPLES
|
|
|
448
448
|
$ ppls custom-fields delete 123
|
|
449
449
|
```
|
|
450
450
|
|
|
451
|
-
_See code: [src/commands/custom-fields/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
451
|
+
_See code: [src/commands/custom-fields/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/custom-fields/delete.ts)_
|
|
452
452
|
|
|
453
453
|
## `ppls custom-fields list`
|
|
454
454
|
|
|
@@ -485,7 +485,7 @@ EXAMPLES
|
|
|
485
485
|
$ ppls custom-fields list
|
|
486
486
|
```
|
|
487
487
|
|
|
488
|
-
_See code: [src/commands/custom-fields/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
488
|
+
_See code: [src/commands/custom-fields/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/custom-fields/list.ts)_
|
|
489
489
|
|
|
490
490
|
## `ppls custom-fields show ID`
|
|
491
491
|
|
|
@@ -517,7 +517,7 @@ EXAMPLES
|
|
|
517
517
|
$ ppls custom-fields show 123
|
|
518
518
|
```
|
|
519
519
|
|
|
520
|
-
_See code: [src/commands/custom-fields/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
520
|
+
_See code: [src/commands/custom-fields/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/custom-fields/show.ts)_
|
|
521
521
|
|
|
522
522
|
## `ppls custom-fields update ID`
|
|
523
523
|
|
|
@@ -556,7 +556,7 @@ EXAMPLES
|
|
|
556
556
|
$ ppls custom-fields update 123 --name "Due Date"
|
|
557
557
|
```
|
|
558
558
|
|
|
559
|
-
_See code: [src/commands/custom-fields/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
559
|
+
_See code: [src/commands/custom-fields/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/custom-fields/update.ts)_
|
|
560
560
|
|
|
561
561
|
## `ppls document-types add NAME`
|
|
562
562
|
|
|
@@ -588,7 +588,7 @@ EXAMPLES
|
|
|
588
588
|
$ ppls document-types add "Invoice"
|
|
589
589
|
```
|
|
590
590
|
|
|
591
|
-
_See code: [src/commands/document-types/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
591
|
+
_See code: [src/commands/document-types/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/document-types/add.ts)_
|
|
592
592
|
|
|
593
593
|
## `ppls document-types delete ID`
|
|
594
594
|
|
|
@@ -623,7 +623,7 @@ EXAMPLES
|
|
|
623
623
|
$ ppls document-types delete 123
|
|
624
624
|
```
|
|
625
625
|
|
|
626
|
-
_See code: [src/commands/document-types/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
626
|
+
_See code: [src/commands/document-types/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/document-types/delete.ts)_
|
|
627
627
|
|
|
628
628
|
## `ppls document-types list`
|
|
629
629
|
|
|
@@ -660,7 +660,7 @@ EXAMPLES
|
|
|
660
660
|
$ ppls document-types list
|
|
661
661
|
```
|
|
662
662
|
|
|
663
|
-
_See code: [src/commands/document-types/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
663
|
+
_See code: [src/commands/document-types/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/document-types/list.ts)_
|
|
664
664
|
|
|
665
665
|
## `ppls document-types show ID`
|
|
666
666
|
|
|
@@ -692,7 +692,7 @@ EXAMPLES
|
|
|
692
692
|
$ ppls document-types show 123
|
|
693
693
|
```
|
|
694
694
|
|
|
695
|
-
_See code: [src/commands/document-types/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
695
|
+
_See code: [src/commands/document-types/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/document-types/show.ts)_
|
|
696
696
|
|
|
697
697
|
## `ppls document-types update ID`
|
|
698
698
|
|
|
@@ -727,7 +727,7 @@ EXAMPLES
|
|
|
727
727
|
$ ppls document-types update 123 --name "Invoice"
|
|
728
728
|
```
|
|
729
729
|
|
|
730
|
-
_See code: [src/commands/document-types/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
730
|
+
_See code: [src/commands/document-types/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/document-types/update.ts)_
|
|
731
731
|
|
|
732
732
|
## `ppls documents add [PATH]`
|
|
733
733
|
|
|
@@ -769,7 +769,7 @@ EXAMPLES
|
|
|
769
769
|
$ ppls documents add ./receipt.pdf --title "Receipt"
|
|
770
770
|
```
|
|
771
771
|
|
|
772
|
-
_See code: [src/commands/documents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
772
|
+
_See code: [src/commands/documents/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/add.ts)_
|
|
773
773
|
|
|
774
774
|
## `ppls documents delete ID`
|
|
775
775
|
|
|
@@ -804,7 +804,7 @@ EXAMPLES
|
|
|
804
804
|
$ ppls documents delete 123
|
|
805
805
|
```
|
|
806
806
|
|
|
807
|
-
_See code: [src/commands/documents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
807
|
+
_See code: [src/commands/documents/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/delete.ts)_
|
|
808
808
|
|
|
809
809
|
## `ppls documents download ID`
|
|
810
810
|
|
|
@@ -843,7 +843,7 @@ EXAMPLES
|
|
|
843
843
|
$ ppls documents download 123,124 --output-dir ./downloads
|
|
844
844
|
```
|
|
845
845
|
|
|
846
|
-
_See code: [src/commands/documents/download.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
846
|
+
_See code: [src/commands/documents/download.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/download.ts)_
|
|
847
847
|
|
|
848
848
|
## `ppls documents list`
|
|
849
849
|
|
|
@@ -880,7 +880,7 @@ EXAMPLES
|
|
|
880
880
|
$ ppls documents list
|
|
881
881
|
```
|
|
882
882
|
|
|
883
|
-
_See code: [src/commands/documents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
883
|
+
_See code: [src/commands/documents/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/list.ts)_
|
|
884
884
|
|
|
885
885
|
## `ppls documents show ID`
|
|
886
886
|
|
|
@@ -912,7 +912,7 @@ EXAMPLES
|
|
|
912
912
|
$ ppls documents show 123
|
|
913
913
|
```
|
|
914
914
|
|
|
915
|
-
_See code: [src/commands/documents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
915
|
+
_See code: [src/commands/documents/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/show.ts)_
|
|
916
916
|
|
|
917
917
|
## `ppls documents update ID`
|
|
918
918
|
|
|
@@ -955,7 +955,7 @@ EXAMPLES
|
|
|
955
955
|
$ ppls documents update 123 --title "Receipt"
|
|
956
956
|
```
|
|
957
957
|
|
|
958
|
-
_See code: [src/commands/documents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
958
|
+
_See code: [src/commands/documents/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/documents/update.ts)_
|
|
959
959
|
|
|
960
960
|
## `ppls help [COMMAND]`
|
|
961
961
|
|
|
@@ -1007,7 +1007,7 @@ EXAMPLES
|
|
|
1007
1007
|
$ ppls profile
|
|
1008
1008
|
```
|
|
1009
1009
|
|
|
1010
|
-
_See code: [src/commands/profile.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1010
|
+
_See code: [src/commands/profile.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/profile.ts)_
|
|
1011
1011
|
|
|
1012
1012
|
## `ppls tags add NAME`
|
|
1013
1013
|
|
|
@@ -1044,7 +1044,7 @@ EXAMPLES
|
|
|
1044
1044
|
$ ppls tags add Inbox
|
|
1045
1045
|
```
|
|
1046
1046
|
|
|
1047
|
-
_See code: [src/commands/tags/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1047
|
+
_See code: [src/commands/tags/add.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/tags/add.ts)_
|
|
1048
1048
|
|
|
1049
1049
|
## `ppls tags delete ID`
|
|
1050
1050
|
|
|
@@ -1079,7 +1079,7 @@ EXAMPLES
|
|
|
1079
1079
|
$ ppls tags delete 123
|
|
1080
1080
|
```
|
|
1081
1081
|
|
|
1082
|
-
_See code: [src/commands/tags/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1082
|
+
_See code: [src/commands/tags/delete.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/tags/delete.ts)_
|
|
1083
1083
|
|
|
1084
1084
|
## `ppls tags list`
|
|
1085
1085
|
|
|
@@ -1116,7 +1116,7 @@ EXAMPLES
|
|
|
1116
1116
|
$ ppls tags list
|
|
1117
1117
|
```
|
|
1118
1118
|
|
|
1119
|
-
_See code: [src/commands/tags/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1119
|
+
_See code: [src/commands/tags/list.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/tags/list.ts)_
|
|
1120
1120
|
|
|
1121
1121
|
## `ppls tags show ID`
|
|
1122
1122
|
|
|
@@ -1148,7 +1148,7 @@ EXAMPLES
|
|
|
1148
1148
|
$ ppls tags show 123
|
|
1149
1149
|
```
|
|
1150
1150
|
|
|
1151
|
-
_See code: [src/commands/tags/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1151
|
+
_See code: [src/commands/tags/show.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/tags/show.ts)_
|
|
1152
1152
|
|
|
1153
1153
|
## `ppls tags update ID`
|
|
1154
1154
|
|
|
@@ -1186,5 +1186,5 @@ EXAMPLES
|
|
|
1186
1186
|
$ ppls tags update 123 --name Inbox
|
|
1187
1187
|
```
|
|
1188
1188
|
|
|
1189
|
-
_See code: [src/commands/tags/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.
|
|
1189
|
+
_See code: [src/commands/tags/update.ts](https://github.com/nickchristensen/ppls/blob/v1.0.5/src/commands/tags/update.ts)_
|
|
1190
1190
|
<!-- commandsstop -->
|
package/dist/base-command.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ export declare abstract class BaseCommand extends Command {
|
|
|
40
40
|
protected fetchJson<T>(url: URL, tokenValue: string, headers?: Record<string, string>): Promise<T>;
|
|
41
41
|
protected formatErrorMessage(response: Response): Promise<string>;
|
|
42
42
|
protected loadUserConfig(): Promise<UserConfig>;
|
|
43
|
-
protected logRequestHeaders(label: string, headers: Record<string, string>): void;
|
|
44
43
|
protected logTable(headers: TableColumn[], rows: TableRow[], options?: TableOptions): void;
|
|
45
44
|
protected parseHeaderEntries(entries: string[], source: string): Record<string, string>;
|
|
46
45
|
protected parseHeadersConfig(input: unknown, source: string): Record<string, string>;
|
|
@@ -48,7 +47,6 @@ export declare abstract class BaseCommand extends Command {
|
|
|
48
47
|
protected patchApiJson<T>(flags: ApiFlags, path: string, body: unknown): Promise<T>;
|
|
49
48
|
protected postApiFormData<T>(flags: ApiFlags, path: string, body: FormData): Promise<T>;
|
|
50
49
|
protected postApiJson<T>(flags: ApiFlags, path: string, body: unknown): Promise<T>;
|
|
51
|
-
protected redactHeaderValue(key: string, value: string): string;
|
|
52
50
|
protected requestJson<T>(options: {
|
|
53
51
|
body?: unknown;
|
|
54
52
|
headers: Record<string, string>;
|
|
@@ -59,7 +57,6 @@ export declare abstract class BaseCommand extends Command {
|
|
|
59
57
|
protected resolveDateFormat(flags: Record<string, unknown>, metadata: CommandMetadata | undefined, userConfig: UserConfig): string;
|
|
60
58
|
protected resolveGlobalFlags(flags: Record<string, unknown>, metadata?: CommandMetadata): Promise<ResolvedGlobalFlags>;
|
|
61
59
|
protected resolveHeaders(flags: Record<string, unknown>, userConfig: UserConfig): Record<string, string>;
|
|
62
|
-
protected shouldLogHeaders(): boolean;
|
|
63
60
|
protected shouldShowSpinner(): boolean;
|
|
64
61
|
protected startSpinner(text: string): null | ReturnType<typeof yoctoSpinner>;
|
|
65
62
|
}
|
package/dist/base-command.js
CHANGED
|
@@ -64,7 +64,6 @@ export class BaseCommand extends Command {
|
|
|
64
64
|
Authorization: `Token ${flags.token}`,
|
|
65
65
|
...flags.headers,
|
|
66
66
|
};
|
|
67
|
-
this.logRequestHeaders(`DELETE ${url.toString()}`, requestHeaders);
|
|
68
67
|
const response = await fetch(url, {
|
|
69
68
|
headers: requestHeaders,
|
|
70
69
|
method: 'DELETE',
|
|
@@ -89,7 +88,6 @@ export class BaseCommand extends Command {
|
|
|
89
88
|
Authorization: `Token ${flags.token}`,
|
|
90
89
|
...flags.headers,
|
|
91
90
|
};
|
|
92
|
-
this.logRequestHeaders(`GET ${url.toString()}`, requestHeaders);
|
|
93
91
|
const response = await fetch(url, {
|
|
94
92
|
headers: requestHeaders,
|
|
95
93
|
});
|
|
@@ -146,13 +144,6 @@ export class BaseCommand extends Command {
|
|
|
146
144
|
})();
|
|
147
145
|
return this.userConfigPromise;
|
|
148
146
|
}
|
|
149
|
-
logRequestHeaders(label, headers) {
|
|
150
|
-
if (!this.shouldLogHeaders()) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const maskedHeaders = Object.fromEntries(Object.entries(headers).map(([key, value]) => [key, this.redactHeaderValue(key, value)]));
|
|
154
|
-
this.logToStderr(`${label} headers: ${JSON.stringify(maskedHeaders)}`);
|
|
155
|
-
}
|
|
156
147
|
logTable(headers, rows, options) {
|
|
157
148
|
this.log(renderTable(headers, rows, options));
|
|
158
149
|
}
|
|
@@ -230,7 +221,6 @@ export class BaseCommand extends Command {
|
|
|
230
221
|
Authorization: `Token ${flags.token}`,
|
|
231
222
|
...flags.headers,
|
|
232
223
|
};
|
|
233
|
-
this.logRequestHeaders(`POST ${url.toString()}`, requestHeaders);
|
|
234
224
|
const response = await fetch(url, {
|
|
235
225
|
body,
|
|
236
226
|
headers: requestHeaders,
|
|
@@ -255,17 +245,6 @@ export class BaseCommand extends Command {
|
|
|
255
245
|
url,
|
|
256
246
|
});
|
|
257
247
|
}
|
|
258
|
-
redactHeaderValue(key, value) {
|
|
259
|
-
const normalized = key.toLowerCase();
|
|
260
|
-
if (normalized === 'authorization') {
|
|
261
|
-
const [scheme] = value.split(' ');
|
|
262
|
-
return scheme ? `${scheme} [REDACTED]` : '[REDACTED]';
|
|
263
|
-
}
|
|
264
|
-
if (normalized.includes('token') || normalized.includes('secret') || normalized.includes('api-key')) {
|
|
265
|
-
return '[REDACTED]';
|
|
266
|
-
}
|
|
267
|
-
return value;
|
|
268
|
-
}
|
|
269
248
|
async requestJson(options) {
|
|
270
249
|
const { body, headers, method, token, url } = options;
|
|
271
250
|
const requestHeaders = {
|
|
@@ -274,7 +253,6 @@ export class BaseCommand extends Command {
|
|
|
274
253
|
...(body === undefined ? {} : { 'Content-Type': 'application/json' }),
|
|
275
254
|
...headers,
|
|
276
255
|
};
|
|
277
|
-
this.logRequestHeaders(`${method} ${url.toString()}`, requestHeaders);
|
|
278
256
|
const response = await fetch(url, {
|
|
279
257
|
body: body === undefined ? undefined : JSON.stringify(body),
|
|
280
258
|
headers: requestHeaders,
|
|
@@ -319,10 +297,6 @@ export class BaseCommand extends Command {
|
|
|
319
297
|
...flagHeaders,
|
|
320
298
|
};
|
|
321
299
|
}
|
|
322
|
-
shouldLogHeaders() {
|
|
323
|
-
const value = process.env.PPLS_DEBUG_HEADERS?.toLowerCase();
|
|
324
|
-
return value === '1' || value === 'true' || value === 'yes';
|
|
325
|
-
}
|
|
326
300
|
shouldShowSpinner() {
|
|
327
301
|
return Boolean(process.stderr.isTTY);
|
|
328
302
|
}
|
|
@@ -5,5 +5,6 @@ export default class DocumentsList extends ListCommand<Document> {
|
|
|
5
5
|
static examples: string[];
|
|
6
6
|
protected listPath: string;
|
|
7
7
|
protected tableAttrs: string[];
|
|
8
|
+
protected listParams(flags: Parameters<ListCommand['listParams']>[0]): Record<string, number | string | undefined>;
|
|
8
9
|
protected plainTemplate(document: Document): string | undefined;
|
|
9
10
|
}
|
|
@@ -4,6 +4,13 @@ export default class DocumentsList extends ListCommand {
|
|
|
4
4
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
5
5
|
listPath = '/api/documents/';
|
|
6
6
|
tableAttrs = ['id', 'title', 'created', 'added', 'correspondent', 'document_type', 'tags'];
|
|
7
|
+
listParams(flags) {
|
|
8
|
+
const params = super.listParams(flags);
|
|
9
|
+
delete params.name__icontains;
|
|
10
|
+
// eslint-disable-next-line camelcase -- API uses double-underscore field names.
|
|
11
|
+
params.title__icontains = flags['name-contains'];
|
|
12
|
+
return params;
|
|
13
|
+
}
|
|
7
14
|
plainTemplate(document) {
|
|
8
15
|
const title = document.title?.trim();
|
|
9
16
|
if (!title) {
|
|
@@ -43,7 +43,7 @@ export declare abstract class PaginatedCommand extends BaseCommand {
|
|
|
43
43
|
spinnerText?: string;
|
|
44
44
|
url: URL;
|
|
45
45
|
}): Promise<T[]>;
|
|
46
|
-
protected paginate<T>(url: URL, tokenValue: string, headers: Record<string, string>, autoPaginate: boolean): AsyncGenerator<T>;
|
|
47
46
|
protected normalizeNextUrl(nextUrl: URL, currentUrl: URL): URL;
|
|
47
|
+
protected paginate<T>(url: URL, tokenValue: string, headers: Record<string, string>, autoPaginate: boolean): AsyncGenerator<T>;
|
|
48
48
|
}
|
|
49
49
|
export {};
|
|
@@ -68,6 +68,15 @@ export class PaginatedCommand extends BaseCommand {
|
|
|
68
68
|
url,
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
normalizeNextUrl(nextUrl, currentUrl) {
|
|
72
|
+
if (currentUrl.protocol === 'https:' && nextUrl.protocol === 'http:' && nextUrl.hostname === currentUrl.hostname) {
|
|
73
|
+
nextUrl.protocol = currentUrl.protocol;
|
|
74
|
+
if (currentUrl.port) {
|
|
75
|
+
nextUrl.port = currentUrl.port;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return nextUrl;
|
|
79
|
+
}
|
|
71
80
|
async *paginate(url, tokenValue, headers, autoPaginate) {
|
|
72
81
|
let nextUrl = url;
|
|
73
82
|
while (nextUrl) {
|
|
@@ -90,13 +99,4 @@ export class PaginatedCommand extends BaseCommand {
|
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
|
-
normalizeNextUrl(nextUrl, currentUrl) {
|
|
94
|
-
if (currentUrl.protocol === 'https:' && nextUrl.protocol === 'http:' && nextUrl.hostname === currentUrl.hostname) {
|
|
95
|
-
nextUrl.protocol = currentUrl.protocol;
|
|
96
|
-
if (currentUrl.port) {
|
|
97
|
-
nextUrl.port = currentUrl.port;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return nextUrl;
|
|
101
|
-
}
|
|
102
102
|
}
|
package/oclif.manifest.json
CHANGED
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.0.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"author": "Nick Christensen",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ppls": "bin/run.js"
|
|
@@ -80,11 +80,10 @@
|
|
|
80
80
|
"lint": "eslint",
|
|
81
81
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
82
82
|
"posttest": "npm run lint",
|
|
83
|
-
"prepack": "
|
|
83
|
+
"prepack": "npm run build",
|
|
84
84
|
"postbuild": "oclif manifest && oclif readme --no-aliases",
|
|
85
85
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
86
|
-
"version": "oclif readme --no-aliases && git add README.md"
|
|
87
|
-
"publish": "npm publish --access public"
|
|
86
|
+
"version": "oclif readme --no-aliases && git add README.md"
|
|
88
87
|
},
|
|
89
88
|
"types": "dist/index.d.ts"
|
|
90
89
|
}
|