proca 1.1.4 → 1.1.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 CHANGED
@@ -18,7 +18,7 @@ $ npm install -g proca
18
18
  $ proca COMMAND
19
19
  running command...
20
20
  $ proca (--version)
21
- proca/1.1.4 linux-x64 node-v22.14.0
21
+ proca/1.1.5 linux-x64 node-v20.12.2
22
22
  $ proca --help [COMMAND]
23
23
  USAGE
24
24
  $ proca COMMAND
@@ -40,13 +40,8 @@ USAGE
40
40
  - campaign Handle campaigns
41
41
  - org
42
42
  - config create setting to access the server authentication
43
-
44
- ### TODO TOPICS
45
-
46
43
  - widget
47
- - actions
48
- - service
49
- - target
44
+ - supporters (counter)
50
45
 
51
46
  # Commands
52
47
  <!-- commands -->
@@ -61,6 +56,7 @@ USAGE
61
56
  * [`proca config get`](#proca-config-get)
62
57
  * [`proca config set [KEY] [VALUE]`](#proca-config-set-key-value)
63
58
  * [`proca config setup [ENVIRONMENT]`](#proca-config-setup-environment)
59
+ * [`proca config token`](#proca-config-token)
64
60
  * [`proca config user`](#proca-config-user)
65
61
  * [`proca help [COMMAND]`](#proca-help-command)
66
62
  * [`proca org add`](#proca-org-add)
@@ -83,6 +79,7 @@ USAGE
83
79
  * [`proca user leave`](#proca-user-leave)
84
80
  * [`proca user list`](#proca-user-list)
85
81
  * [`proca widget add`](#proca-widget-add)
82
+ * [`proca widget cache`](#proca-widget-cache)
86
83
  * [`proca widget get`](#proca-widget-get)
87
84
  * [`proca widget list`](#proca-widget-list)
88
85
 
@@ -92,7 +89,7 @@ counter of actions
92
89
 
93
90
  ```
94
91
  USAGE
95
- $ proca action count [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
92
+ $ proca action count [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
96
93
  | -n <the_short_name> | -x <value>]
97
94
 
98
95
  FLAGS
@@ -101,10 +98,10 @@ FLAGS
101
98
  -x, --dxid=<value> dxid
102
99
 
103
100
  OUTPUT FLAGS
104
- --csv Format output as csv
105
- --human Format output to be read on screen by a human [default]
106
- --json Format output as json
107
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
101
+ --csv Format output as csv
102
+ --human Format output to be read on screen by a human [default]
103
+ --json Format output as json
104
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
108
105
 
109
106
  DESCRIPTION
110
107
  counter of actions
@@ -119,8 +116,9 @@ EXAMPLES
119
116
 
120
117
  ```
121
118
  USAGE
122
- $ proca action list [TITLE] -o <organisation name> [--simplify [--json | --human |
123
- --csv]] [-c <campaign title>] [--limit <value>] [--optin] [--testing] [--doi] [--utm]
119
+ $ proca action list [TITLE] -o <organisation name> [--json | --human | --csv] [-c
120
+ <campaign title>] [--limit <value>] [--today | --after 2025-04-09] [--optin] [--testing] [--doi] [--utm |
121
+ --simplify] [--comment | ]
124
122
 
125
123
  ARGUMENTS
126
124
  TITLE name of the campaign, % for wildchar
@@ -128,17 +126,20 @@ ARGUMENTS
128
126
  FLAGS
129
127
  -c, --campaign=<campaign title> name of the campaign, % for wildchar
130
128
  -o, --org=<organisation name> (required) campaigns of the organisation (coordinator or partner)
129
+ --after=2025-04-09 only actions after a date
130
+ --[no-]comment display the comment
131
131
  --doi only export the double optin actions
132
132
  --limit=<value> max number of actions
133
133
  --optin only export the optin actions
134
134
  --testing also export the test actions
135
+ --today only actions today
135
136
  --[no-]utm display the utm tracking parameters
136
137
 
137
138
  OUTPUT FLAGS
138
- --csv Format output as csv
139
- --human Format output to be read on screen by a human [default]
140
- --json Format output as json
141
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
139
+ --csv Format output as csv
140
+ --human Format output to be read on screen by a human [default]
141
+ --json Format output as json
142
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
142
143
 
143
144
  EXAMPLES
144
145
  $ proca action list %pizza%
@@ -148,7 +149,7 @@ EXAMPLES
148
149
 
149
150
  ```
150
151
  USAGE
151
- $ proca action replay -o <organisation name> [--simplify [--json | --human | --csv]] [-c
152
+ $ proca action replay -o <organisation name> [--json | --human | --csv] [--simplify] [-c
152
153
  <campaign title>]
153
154
 
154
155
  FLAGS
@@ -156,10 +157,10 @@ FLAGS
156
157
  -o, --org=<organisation name> (required) campaigns of the organisation (coordinator or partner)
157
158
 
158
159
  OUTPUT FLAGS
159
- --csv Format output as csv
160
- --human Format output to be read on screen by a human [default]
161
- --json Format output as json
162
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
160
+ --csv Format output as csv
161
+ --human Format output to be read on screen by a human [default]
162
+ --json Format output as json
163
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
163
164
 
164
165
  EXAMPLES
165
166
  $ proca action replay %pizza%
@@ -169,8 +170,8 @@ EXAMPLES
169
170
 
170
171
  ```
171
172
  USAGE
172
- $ proca campaign add [TITLE] -n <campaign name> -o <org name> [--simplify [--json |
173
- --human | --csv]]
173
+ $ proca campaign add [TITLE] -n <campaign name> -o <org name> [--json | --human |
174
+ --csv] [--simplify]
174
175
 
175
176
  ARGUMENTS
176
177
  TITLE title of the campaign
@@ -180,10 +181,10 @@ FLAGS
180
181
  -o, --org=<org name> (required) name of the coordinator
181
182
 
182
183
  OUTPUT FLAGS
183
- --csv Format output as csv
184
- --human Format output to be read on screen by a human [default]
185
- --json Format output as json
186
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
184
+ --csv Format output as csv
185
+ --human Format output to be read on screen by a human [default]
186
+ --json Format output as json
187
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
187
188
 
188
189
  EXAMPLES
189
190
  $ proca campaign add -n <new_campaign> the full name of the campaign
@@ -195,7 +196,7 @@ delete a campaign
195
196
 
196
197
  ```
197
198
  USAGE
198
- $ proca campaign delete [--simplify [--json | --human | --csv]] [-i <organisation name>]
199
+ $ proca campaign delete [--json | --human | --csv] [--simplify] [-i <organisation name>]
199
200
  [-n <campaign name>]
200
201
 
201
202
  FLAGS
@@ -203,10 +204,10 @@ FLAGS
203
204
  -n, --name=<campaign name> name of the campaign
204
205
 
205
206
  OUTPUT FLAGS
206
- --csv Format output as csv
207
- --human Format output to be read on screen by a human [default]
208
- --json Format output as json
209
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
207
+ --csv Format output as csv
208
+ --human Format output to be read on screen by a human [default]
209
+ --json Format output as json
210
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
210
211
 
211
212
  DESCRIPTION
212
213
  delete a campaign
@@ -221,7 +222,7 @@ view a campaign
221
222
 
222
223
  ```
223
224
  USAGE
224
- $ proca campaign get [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
225
+ $ proca campaign get [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
225
226
  | -n <the_short_name> | -x <value>] [--config] [--stats] [--locale <value>]
226
227
 
227
228
  FLAGS
@@ -233,10 +234,10 @@ FLAGS
233
234
  --[no-]stats display the stats
234
235
 
235
236
  OUTPUT FLAGS
236
- --csv Format output as csv
237
- --human Format output to be read on screen by a human [default]
238
- --json Format output as json
239
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
237
+ --csv Format output as csv
238
+ --human Format output to be read on screen by a human [default]
239
+ --json Format output as json
240
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
240
241
 
241
242
  DESCRIPTION
242
243
  view a campaign
@@ -251,7 +252,7 @@ list all the campaigns
251
252
 
252
253
  ```
253
254
  USAGE
254
- $ proca campaign list [TITLE] [--simplify [--json | --human | --csv]] [-o <organisation
255
+ $ proca campaign list [TITLE] [--json | --human | --csv] [--simplify] [-o <organisation
255
256
  name>] [-t <campaign title>] [--stats]
256
257
 
257
258
  ARGUMENTS
@@ -263,10 +264,10 @@ FLAGS
263
264
  --[no-]stats display the stats
264
265
 
265
266
  OUTPUT FLAGS
266
- --csv Format output as csv
267
- --human Format output to be read on screen by a human [default]
268
- --json Format output as json
269
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
267
+ --csv Format output as csv
268
+ --human Format output to be read on screen by a human [default]
269
+ --json Format output as json
270
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
270
271
 
271
272
  DESCRIPTION
272
273
  list all the campaigns
@@ -281,8 +282,8 @@ create setting to access the server authentication
281
282
 
282
283
  ```
283
284
  USAGE
284
- $ proca config add [ENVIRONMENT] --token <API-token> [--simplify [--json | --human |
285
- --csv]] [--force] [--url <url>] [--n8n <n8n api>] [--supabase <url>] [--supabase-anon-key <value>]
285
+ $ proca config add [ENVIRONMENT] --token <API-token> [--json | --human | --csv]
286
+ [--simplify] [--force] [--url <url>] [--n8n <n8n api>] [--supabase <url>] [--supabase-anon-key <value>]
286
287
  [--supabase-secrey-key <value>]
287
288
 
288
289
  ARGUMENTS
@@ -298,10 +299,10 @@ FLAGS
298
299
  --url=<url> [default: https://api.proca.app/api] url of the proca server api
299
300
 
300
301
  OUTPUT FLAGS
301
- --csv Format output as csv
302
- --human Format output to be read on screen by a human [default]
303
- --json Format output as json
304
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
302
+ --csv Format output as csv
303
+ --human Format output to be read on screen by a human [default]
304
+ --json Format output as json
305
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
305
306
 
306
307
  DESCRIPTION
307
308
  create setting to access the server authentication
@@ -319,13 +320,13 @@ get the server config
319
320
 
320
321
  ```
321
322
  USAGE
322
- $ proca config get [--simplify [--json | --human | --csv]]
323
+ $ proca config get [--json | --human | --csv] [--simplify]
323
324
 
324
325
  OUTPUT FLAGS
325
- --csv Format output as csv
326
- --human Format output to be read on screen by a human [default]
327
- --json Format output as json
328
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
326
+ --csv Format output as csv
327
+ --human Format output to be read on screen by a human [default]
328
+ --json Format output as json
329
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
329
330
 
330
331
  DESCRIPTION
331
332
  get the server config
@@ -337,7 +338,7 @@ update the setting used to authenticate to the servers and services
337
338
 
338
339
  ```
339
340
  USAGE
340
- $ proca config set [KEY] [VALUE] [--simplify [--json | --human | --csv]]
341
+ $ proca config set [KEY] [VALUE] [--json | --human | --csv] [--simplify]
341
342
  [--environment <value>] [--url <url>] [--token <API-token>]
342
343
 
343
344
  ARGUMENTS
@@ -350,10 +351,10 @@ FLAGS
350
351
  --url=<url> [default: https://api.proca.app/api] url of the proca server api
351
352
 
352
353
  OUTPUT FLAGS
353
- --csv Format output as csv
354
- --human Format output to be read on screen by a human [default]
355
- --json Format output as json
356
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
354
+ --csv Format output as csv
355
+ --human Format output to be read on screen by a human [default]
356
+ --json Format output as json
357
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
357
358
 
358
359
  DESCRIPTION
359
360
  update the setting used to authenticate to the servers and services
@@ -373,8 +374,8 @@ create setting to access the server authentication
373
374
 
374
375
  ```
375
376
  USAGE
376
- $ proca config setup [ENVIRONMENT] --token <API-token> [--simplify [--json | --human |
377
- --csv]] [--force] [--url <url>] [--n8n <n8n api>] [--supabase <url>] [--supabase-anon-key <value>]
377
+ $ proca config setup [ENVIRONMENT] --token <API-token> [--json | --human | --csv]
378
+ [--simplify] [--force] [--url <url>] [--n8n <n8n api>] [--supabase <url>] [--supabase-anon-key <value>]
378
379
  [--supabase-secrey-key <value>]
379
380
 
380
381
  ARGUMENTS
@@ -390,10 +391,10 @@ FLAGS
390
391
  --url=<url> [default: https://api.proca.app/api] url of the proca server api
391
392
 
392
393
  OUTPUT FLAGS
393
- --csv Format output as csv
394
- --human Format output to be read on screen by a human [default]
395
- --json Format output as json
396
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
394
+ --csv Format output as csv
395
+ --human Format output to be read on screen by a human [default]
396
+ --json Format output as json
397
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
397
398
 
398
399
  DESCRIPTION
399
400
  create setting to access the server authentication
@@ -405,19 +406,40 @@ EXAMPLES
405
406
  $ proca config setup --user=xavier@example.org --token=API-12345789
406
407
  ```
407
408
 
409
+ ## `proca config token`
410
+
411
+ convert between token and sql value
412
+
413
+ ```
414
+ USAGE
415
+ $ proca config token [--json | --human | --csv] [--simplify] [--token API-xxx]
416
+
417
+ FLAGS
418
+ --token=API-xxx the token in your config
419
+
420
+ OUTPUT FLAGS
421
+ --csv Format output as csv
422
+ --human Format output to be read on screen by a human [default]
423
+ --json Format output as json
424
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
425
+
426
+ DESCRIPTION
427
+ convert between token and sql value
428
+ ```
429
+
408
430
  ## `proca config user`
409
431
 
410
432
  fetch the information about the current user (based on the token)
411
433
 
412
434
  ```
413
435
  USAGE
414
- $ proca config user [--simplify [--json | --human | --csv]]
436
+ $ proca config user [--json | --human | --csv] [--simplify]
415
437
 
416
438
  OUTPUT FLAGS
417
- --csv Format output as csv
418
- --human Format output to be read on screen by a human [default]
419
- --json Format output as json
420
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
439
+ --csv Format output as csv
440
+ --human Format output to be read on screen by a human [default]
441
+ --json Format output as json
442
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
421
443
 
422
444
  DESCRIPTION
423
445
  fetch the information about the current user (based on the token)
@@ -450,7 +472,7 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.2
450
472
 
451
473
  ```
452
474
  USAGE
453
- $ proca org add [--simplify [--json | --human | --csv]] [--twitter <screen name>]
475
+ $ proca org add [--json | --human | --csv] [--simplify] [--twitter <screen name>]
454
476
  [-n <org name>]
455
477
 
456
478
  FLAGS
@@ -458,10 +480,10 @@ FLAGS
458
480
  --twitter=<screen name> twitter account
459
481
 
460
482
  OUTPUT FLAGS
461
- --csv Format output as csv
462
- --human Format output to be read on screen by a human [default]
463
- --json Format output as json
464
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
483
+ --csv Format output as csv
484
+ --human Format output to be read on screen by a human [default]
485
+ --json Format output as json
486
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
465
487
 
466
488
  EXAMPLES
467
489
  $ proca org add --twitter <twitter of the organisation>
@@ -473,7 +495,7 @@ view a org crm synchroniser
473
495
 
474
496
  ```
475
497
  USAGE
476
- $ proca org crm -n <org name> [--simplify [--json | --human | --csv]]
498
+ $ proca org crm -n <org name> [--json | --human | --csv] [--simplify]
477
499
  [--synchronize]
478
500
 
479
501
  FLAGS
@@ -481,10 +503,10 @@ FLAGS
481
503
  --[no-]synchronize enable or disable the synchronisation queue
482
504
 
483
505
  OUTPUT FLAGS
484
- --csv Format output as csv
485
- --human Format output to be read on screen by a human [default]
486
- --json Format output as json
487
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
506
+ --csv Format output as csv
507
+ --human Format output to be read on screen by a human [default]
508
+ --json Format output as json
509
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
488
510
 
489
511
  DESCRIPTION
490
512
  view a org crm synchroniser
@@ -494,7 +516,7 @@ DESCRIPTION
494
516
 
495
517
  ```
496
518
  USAGE
497
- $ proca org delete [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
519
+ $ proca org delete [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
498
520
  | -n <org name> | -x <value>]
499
521
 
500
522
  FLAGS
@@ -503,10 +525,10 @@ FLAGS
503
525
  -x, --dxid=<value> dxid
504
526
 
505
527
  OUTPUT FLAGS
506
- --csv Format output as csv
507
- --human Format output to be read on screen by a human [default]
508
- --json Format output as json
509
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
528
+ --csv Format output as csv
529
+ --human Format output to be read on screen by a human [default]
530
+ --json Format output as json
531
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
510
532
 
511
533
  EXAMPLES
512
534
  $ proca org delete <organisation_name>
@@ -518,7 +540,7 @@ view a org
518
540
 
519
541
  ```
520
542
  USAGE
521
- $ proca org get [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-n <org
543
+ $ proca org get [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-n <org
522
544
  name>] [--config] [--keys] [--campaigns] [--widgets] [--users]
523
545
 
524
546
  FLAGS
@@ -530,10 +552,10 @@ FLAGS
530
552
  --[no-]widgets
531
553
 
532
554
  OUTPUT FLAGS
533
- --csv Format output as csv
534
- --human Format output to be read on screen by a human [default]
535
- --json Format output as json
536
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
555
+ --csv Format output as csv
556
+ --human Format output to be read on screen by a human [default]
557
+ --json Format output as json
558
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
537
559
 
538
560
  DESCRIPTION
539
561
  view a org
@@ -548,7 +570,7 @@ let a user join an organisation with a role
548
570
 
549
571
  ```
550
572
  USAGE
551
- $ proca org join -o <org name> [--simplify [--json | --human | --csv]] [--user
573
+ $ proca org join -o <org name> [--json | --human | --csv] [--simplify] [--user
552
574
  <value>] [--role owner|campaigner|coordinator|translator]
553
575
 
554
576
  FLAGS
@@ -558,10 +580,10 @@ FLAGS
558
580
  --user=<value> user email
559
581
 
560
582
  OUTPUT FLAGS
561
- --csv Format output as csv
562
- --human Format output to be read on screen by a human [default]
563
- --json Format output as json
564
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
583
+ --csv Format output as csv
584
+ --human Format output to be read on screen by a human [default]
585
+ --json Format output as json
586
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
565
587
 
566
588
  DESCRIPTION
567
589
  let a user join an organisation with a role
@@ -866,7 +888,7 @@ counter of supporters
866
888
 
867
889
  ```
868
890
  USAGE
869
- $ proca supporter count [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
891
+ $ proca supporter count [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
870
892
  | -n <the_short_name> | -x <value>] [--org] [--area] [--number --without <value>]
871
893
 
872
894
  FLAGS
@@ -879,10 +901,10 @@ FLAGS
879
901
  --without=<value> total to add to the partner's counter
880
902
 
881
903
  OUTPUT FLAGS
882
- --csv Format output as csv
883
- --human Format output to be read on screen by a human [default]
884
- --json Format output as json
885
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
904
+ --csv Format output as csv
905
+ --human Format output to be read on screen by a human [default]
906
+ --json Format output as json
907
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
886
908
 
887
909
  DESCRIPTION
888
910
  counter of supporters
@@ -899,7 +921,7 @@ fetch the information about a user
899
921
 
900
922
  ```
901
923
  USAGE
902
- $ proca user get [--simplify [--json | --human | --csv]] [--email <value>] [-o <org
924
+ $ proca user get [--json | --human | --csv] [--simplify] [--email <value>] [-o <org
903
925
  name>] [-i <value>]
904
926
 
905
927
  FLAGS
@@ -908,10 +930,10 @@ FLAGS
908
930
  --email=<value> user email
909
931
 
910
932
  OUTPUT FLAGS
911
- --csv Format output as csv
912
- --human Format output to be read on screen by a human [default]
913
- --json Format output as json
914
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
933
+ --csv Format output as csv
934
+ --human Format output to be read on screen by a human [default]
935
+ --json Format output as json
936
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
915
937
 
916
938
  DESCRIPTION
917
939
  fetch the information about a user
@@ -926,18 +948,18 @@ leave a org
926
948
 
927
949
  ```
928
950
  USAGE
929
- $ proca user leave --email <user email> -o <org name> [--simplify [--json | --human |
930
- --csv]]
951
+ $ proca user leave --email <user email> -o <org name> [--json | --human | --csv]
952
+ [--simplify]
931
953
 
932
954
  FLAGS
933
955
  -o, --org=<org name> (required) name of the org
934
956
  --email=<user email> (required) email
935
957
 
936
958
  OUTPUT FLAGS
937
- --csv Format output as csv
938
- --human Format output to be read on screen by a human [default]
939
- --json Format output as json
940
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
959
+ --csv Format output as csv
960
+ --human Format output to be read on screen by a human [default]
961
+ --json Format output as json
962
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
941
963
 
942
964
  DESCRIPTION
943
965
  leave a org
@@ -952,16 +974,16 @@ list all the users
952
974
 
953
975
  ```
954
976
  USAGE
955
- $ proca user list -o <value> [--simplify [--json | --human | --csv]]
977
+ $ proca user list -o <value> [--json | --human | --csv] [--simplify]
956
978
 
957
979
  FLAGS
958
980
  -o, --org=<value> (required) organisation
959
981
 
960
982
  OUTPUT FLAGS
961
- --csv Format output as csv
962
- --human Format output to be read on screen by a human [default]
963
- --json Format output as json
964
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
983
+ --csv Format output as csv
984
+ --human Format output to be read on screen by a human [default]
985
+ --json Format output as json
986
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
965
987
 
966
988
  DESCRIPTION
967
989
  list all the users
@@ -974,7 +996,7 @@ EXAMPLES
974
996
 
975
997
  ```
976
998
  USAGE
977
- $ proca widget add -c <campaign name> [--simplify [--json | --human | --csv]] [-o
999
+ $ proca widget add -c <campaign name> [--json | --human | --csv] [--simplify] [-o
978
1000
  <en>] [-l <en>] [-n by default <campaign>/<org>/<lang>]
979
1001
 
980
1002
  FLAGS
@@ -984,10 +1006,40 @@ FLAGS
984
1006
  -o, --org=<en> organisation
985
1007
 
986
1008
  OUTPUT FLAGS
987
- --csv Format output as csv
988
- --human Format output to be read on screen by a human [default]
989
- --json Format output as json
990
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
1009
+ --csv Format output as csv
1010
+ --human Format output to be read on screen by a human [default]
1011
+ --json Format output as json
1012
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
1013
+ ```
1014
+
1015
+ ## `proca widget cache`
1016
+
1017
+ clear the cdn cache of a widget
1018
+
1019
+ ```
1020
+ USAGE
1021
+ $ proca widget cache [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
1022
+ | -n <the_short_name> | -x <value>] [--url <value>]
1023
+
1024
+ FLAGS
1025
+ -i, --id=<value>
1026
+ -n, --name=<the_short_name> name
1027
+ -x, --dxid=<value> dxid
1028
+ --url=<value> url of the widget on the CDN
1029
+
1030
+ OUTPUT FLAGS
1031
+ --csv Format output as csv
1032
+ --human Format output to be read on screen by a human [default]
1033
+ --json Format output as json
1034
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
1035
+
1036
+ DESCRIPTION
1037
+ clear the cdn cache of a widget
1038
+
1039
+ EXAMPLES
1040
+ $ proca widget cache --url https://cdn.proca.app/d/[campaign]/[org]/[locale]
1041
+
1042
+ $ proca widget cache --name [campaign]/[org]/[locale]
991
1043
  ```
992
1044
 
993
1045
  ## `proca widget get`
@@ -996,7 +1048,7 @@ view a widget
996
1048
 
997
1049
  ```
998
1050
  USAGE
999
- $ proca widget get [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
1051
+ $ proca widget get [ID_NAME_DXID] [--json | --human | --csv] [--simplify] [-i <value>
1000
1052
  | -n <the_short_name> | -x <value>] [--config]
1001
1053
 
1002
1054
  FLAGS
@@ -1006,10 +1058,10 @@ FLAGS
1006
1058
  --[no-]config display the config
1007
1059
 
1008
1060
  OUTPUT FLAGS
1009
- --csv Format output as csv
1010
- --human Format output to be read on screen by a human [default]
1011
- --json Format output as json
1012
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
1061
+ --csv Format output as csv
1062
+ --human Format output to be read on screen by a human [default]
1063
+ --json Format output as json
1064
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
1013
1065
 
1014
1066
  DESCRIPTION
1015
1067
  view a widget
@@ -1024,7 +1076,7 @@ list all the widgets of an org or campaign
1024
1076
 
1025
1077
  ```
1026
1078
  USAGE
1027
- $ proca widget list [--simplify [--json | --human | --csv]] [-o <organisation name>]
1079
+ $ proca widget list [--json | --human | --csv] [--simplify] [-o <organisation name>]
1028
1080
  [-c <campaign name>] [--config]
1029
1081
 
1030
1082
  FLAGS
@@ -1033,10 +1085,10 @@ FLAGS
1033
1085
  --[no-]config get the config
1034
1086
 
1035
1087
  OUTPUT FLAGS
1036
- --csv Format output as csv
1037
- --human Format output to be read on screen by a human [default]
1038
- --json Format output as json
1039
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
1088
+ --csv Format output as csv
1089
+ --human Format output to be read on screen by a human [default]
1090
+ --json Format output as json
1091
+ --[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
1040
1092
 
1041
1093
  DESCRIPTION
1042
1094
  list all the widgets of an org or campaign
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "proca",
3
3
  "description": "Access the proca api",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "author": "Xavier",
6
6
  "bin": {
7
7
  "proca": "proca-cli"
@@ -36,6 +36,16 @@ export default class CampaignList extends Command {
36
36
  description: "max number of actions",
37
37
  parse: (input) => Number.parseInt(input, 10),
38
38
  }),
39
+ after: Flags.string({
40
+ description: "only actions after a date",
41
+ helpValue: "2025-04-09",
42
+ parse: (input) => new Date(input).toISOString(),
43
+ }),
44
+ today: Flags.boolean({
45
+ description: "only actions today",
46
+ exclusive: ["after"],
47
+ parse: (input) => `${new Date().toISOString().split("T")[0]}T00:00:00Z`,
48
+ }),
39
49
  optin: Flags.boolean({
40
50
  description: "only export the optin actions",
41
51
  default: false,
@@ -52,6 +62,13 @@ export default class CampaignList extends Command {
52
62
  description: "display the utm tracking parameters",
53
63
  default: true,
54
64
  allowNo: true,
65
+ exclusive: ["simplify"],
66
+ }),
67
+ comment: Flags.boolean({
68
+ description: "display the comment",
69
+ default: true,
70
+ allowNo: true,
71
+ exclusive: ["simplify"],
55
72
  }),
56
73
  };
57
74
 
@@ -114,8 +131,7 @@ export default class CampaignList extends Command {
114
131
  }
115
132
  }
116
133
  `;
117
-
118
- const variables = {
134
+ const result = await query(Document, {
119
135
  after: flags.after,
120
136
  // "campaignId": 42,
121
137
  campaignName: flags.campaign,
@@ -125,10 +141,7 @@ export default class CampaignList extends Command {
125
141
  onlyOptIn: flags.optin,
126
142
  orgName: flags.org,
127
143
  start: flags.start,
128
- };
129
- console.log("fetching actions", variables);
130
- const result = await query(Document, variables);
131
- console.log("result", result);
144
+ });
132
145
  return result.exportActions.map((d) => {
133
146
  d.customFields = JSON.parse(d.customFields);
134
147
  if (!d.contact.publicKey) {
@@ -151,14 +164,15 @@ export default class CampaignList extends Command {
151
164
  firstname: d.contact.firstName,
152
165
  country: d.contact.country,
153
166
  email: d.contact.email,
154
- widget: d.actionPage.name,
155
167
  type: d.actionType,
156
168
  date: d.createdAt,
157
169
  campaign: d.campaign.name,
158
170
  widget_id: d.actionPage.id,
171
+ widget: d.actionPage.name,
159
172
  // customFields
160
173
  };
161
- if (d.customFields?.comment) result.comment = d.customFields.comment;
174
+ if (this.flags.comment && d.customFields?.comment)
175
+ result.comment = d.customFields.comment;
162
176
  if (d.customFields?.emailProvider)
163
177
  result.provider = d.customFields.emailProvider;
164
178
  if (this.flags.utm && d.tracking) {
@@ -181,9 +195,10 @@ export default class CampaignList extends Command {
181
195
 
182
196
  async run() {
183
197
  const { args, flags } = await this.parse();
198
+ if (flags.today) flags.after = flags.today;
184
199
  let data = [];
185
200
 
186
201
  data = await this.fetch(flags);
187
- //return this.output(data);
202
+ return this.output(data);
188
203
  }
189
204
  }
@@ -0,0 +1,34 @@
1
+ import crypto from "node:crypto";
2
+ import { Args, Flags } from "@oclif/core";
3
+ import { error, stdout, ux } from "@oclif/core/ux";
4
+ import Command from "#src/procaCommand.mjs";
5
+
6
+ export default class UserList extends Command {
7
+ static description = "convert between token and sql value";
8
+
9
+ static flags = {
10
+ token: Flags.string({
11
+ exactlyOne: ["token"],
12
+ description: "the token in your config",
13
+ helpValue: "API-xxx",
14
+ }),
15
+ };
16
+
17
+ async run() {
18
+ const { args, flags } = await this.parse();
19
+ if (flags.token) {
20
+ const token = flags.token
21
+ .replace("API-", "")
22
+ .replace(/-/g, "+")
23
+ .replace(/_/g, "/");
24
+ const decoded = Buffer.from(token, "base64").toString("utf-8");
25
+ const hexa = crypto.createHash("sha256").update(decoded).digest("hex");
26
+ console.log(token, decoded, hexa);
27
+
28
+ return this.output({ hexa: `\\x${hexa}` });
29
+ }
30
+ const data = flags;
31
+
32
+ return this.output(data);
33
+ }
34
+ }
@@ -0,0 +1,29 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { error, stdout, ux } from "@oclif/core/ux";
3
+ import Command from "#src/procaCommand.mjs";
4
+ import { FragmentSummary } from "#src/queries/widget.mjs";
5
+ import { gql, query } from "#src/urql.mjs";
6
+
7
+ export default class WidgetGet extends Command {
8
+ static description = "clear the cdn cache of a widget";
9
+
10
+ static examples = [
11
+ "<%= config.bin %> <%= command.id %> --url https://cdn.proca.app/d/[campaign]/[org]/[locale]",
12
+ "<%= config.bin %> <%= command.id %> --name [campaign]/[org]/[locale]",
13
+ ];
14
+ static args = this.multiid();
15
+
16
+ static flags = {
17
+ // flag with no value (-f, --force)
18
+ ...this.flagify({ multiid: true }),
19
+ url: Flags.string ({
20
+ description: "url of the widget on the CDN",
21
+ }),
22
+ };
23
+
24
+ async run() {
25
+ const { args, flags } = await this.parse();
26
+ console.log(flags);
27
+ }
28
+ }
29
+
@@ -31,7 +31,7 @@ class ProcaCommand extends Command {
31
31
  helpGroup: "OUTPUT",
32
32
  description:
33
33
  "flatten and filter to output only the most important attributes, mostly relevant for json",
34
- dependsOn: ["json"],
34
+ allowNo: true,
35
35
  }),
36
36
  };
37
37
 
@@ -112,6 +112,19 @@ class ProcaCommand extends Command {
112
112
  }
113
113
  }
114
114
 
115
+ flatten = (obj, prefix = "", result = {}) => {
116
+ Object.entries(obj).forEach(([k, v]) => {
117
+ const newKey = Object.hasOwn(result, k) && prefix ? `${prefix}-${k}` : k;
118
+
119
+ if (v?.constructor === Object) {
120
+ this.flatten(v, newKey, result);
121
+ } else {
122
+ result[newKey] = v;
123
+ }
124
+ });
125
+ return result;
126
+ };
127
+
115
128
  simplify = (d) => {
116
129
  const r = {};
117
130
  for (const [key, value] of Object.entries(d)) {
@@ -159,10 +172,13 @@ class ProcaCommand extends Command {
159
172
  async csv(data) {
160
173
  return new Promise((resolve, reject) => {
161
174
  let d = null;
175
+ const format = this.flags.simplify
176
+ ? this.simplify
177
+ : (d) => this.flatten(d, "");
162
178
  if (Array.isArray(data)) {
163
- d = data.map(this.simplify);
179
+ d = data.map(format);
164
180
  } else {
165
- d = [this.simplify(data)];
181
+ d = [format(data)];
166
182
  }
167
183
  const stream = fastcsv
168
184
  .write(d, { headers: true })
@@ -178,11 +194,19 @@ class ProcaCommand extends Command {
178
194
 
179
195
  table(data, transformRow, print = (table) => table.toString()) {
180
196
  if (!transformRow) {
181
- transformRow = (d, cell) => {
182
- for (const [key, value] of Object.entries(this.simplify(d))) {
183
- cell(key, value);
184
- }
185
- };
197
+ if (this.flags.simplify !== false) {
198
+ transformRow = (d, cell) => {
199
+ for (const [key, value] of Object.entries(this.simplify(d))) {
200
+ cell(key, value);
201
+ }
202
+ };
203
+ } else {
204
+ transformRow = (d, cell) => {
205
+ for (const [key, value] of Object.entries(this.flatten(d))) {
206
+ cell(key, value);
207
+ }
208
+ };
209
+ }
186
210
  }
187
211
  const theme = this.config.theme;
188
212
  Table.prototype.pushDelimeter = function (cols) {