proca 1.5.0 → 1.7.2
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 +323 -73
- package/package.json +1 -1
- package/src/commands/action/add.mjs +26 -3
- package/src/commands/action/confirm.mjs +93 -0
- package/src/commands/campaign/get.mjs +17 -0
- package/src/commands/campaign/mtt.mjs +108 -0
- package/src/commands/config/add.mjs +7 -3
- package/src/commands/config/user.mjs +2 -2
- package/src/commands/org/add.mjs +0 -1
- package/src/commands/org/email.mjs +83 -0
- package/src/commands/org/get.mjs +0 -1
- package/src/commands/service/add.mjs +78 -0
- package/src/commands/service/list.mjs +24 -0
- package/src/commands/target/add.mjs +94 -0
- package/src/commands/template/add.mjs +97 -0
- package/src/commands/template/list.mjs +61 -0
- package/src/commands/{org → user}/join.mjs +13 -9
- package/src/commands/user/leave.mjs +11 -6
- package/src/commands/widget/list.mjs +3 -2
- package/src/procaCommand.mjs +8 -3
- package/src/queries/campaign.mjs +11 -0
- package/src/queries/widget.mjs +2 -1
package/README.md
CHANGED
|
@@ -12,19 +12,18 @@ One of Proca's standout features is its robust support for coalition campaigns,
|
|
|
12
12
|
|
|
13
13
|
### global installation
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
if you have or plan to have multiple servers (eg. production and staging) or multiple users, you can setup multiple environments. each proca command support a --env <environment> param (optional, 'default' if not specified.
|
|
16
|
+
|
|
17
|
+
All the examples are using the default environment, add --env=staging if you need to access another server than your default one. By convention, we keep default for production.
|
|
18
|
+
|
|
16
19
|
```sh-session
|
|
17
20
|
$ npm install -g proca
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
$ proca
|
|
21
|
-
proca/1.5.0 linux-x64 node-v20.12.2
|
|
22
|
-
$ proca --help [COMMAND]
|
|
23
|
-
USAGE
|
|
24
|
-
$ proca COMMAND
|
|
25
|
-
...
|
|
21
|
+
$# if you don't have your API token, generate one
|
|
22
|
+
$ proca user reset --email <your_email> --passowrd <your password>
|
|
23
|
+
$ proca config init --token=<API-token>
|
|
26
24
|
```
|
|
27
|
-
|
|
25
|
+
you can set up the config folder the widget builder will use to store the caches. skip unless you want a different one than the default (your/widget/folder/config).
|
|
26
|
+
|
|
28
27
|
|
|
29
28
|
### local development
|
|
30
29
|
|
|
@@ -36,31 +35,20 @@ USAGE
|
|
|
36
35
|
$./proca-cli config add --env=local --url=http://localhost:4000/api
|
|
37
36
|
$./proca-cli config server --env=local #check if the config is working
|
|
38
37
|
$./proca-cli config user #check if the config is working
|
|
39
|
-
|
|
38
|
+
````
|
|
40
39
|
|
|
41
40
|
you should also use the local proca-api in your [widget generator](https://github.com/fixthestatusquo/proca)
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
````sh-session
|
|
44
43
|
$ cd /your/path/to/proca
|
|
45
|
-
$ npm link proca-api
|
|
46
44
|
$ npm link proca # use the local proca-cli repo
|
|
47
|
-
...
|
|
48
|
-
|
|
49
|
-
|
|
50
45
|
````
|
|
51
46
|
|
|
52
|
-
### TOPICS
|
|
53
|
-
|
|
54
|
-
- campaign Handle campaigns
|
|
55
|
-
- org
|
|
56
|
-
- config create setting to access the server authentication
|
|
57
|
-
- widget
|
|
58
|
-
- supporters (counter)
|
|
59
|
-
|
|
60
47
|
# Commands
|
|
61
48
|
|
|
62
49
|
<!-- commands -->
|
|
63
50
|
* [`proca action add`](#proca-action-add)
|
|
51
|
+
* [`proca action confirm`](#proca-action-confirm)
|
|
64
52
|
* [`proca action count`](#proca-action-count)
|
|
65
53
|
* [`proca action list [TITLE]`](#proca-action-list-title)
|
|
66
54
|
* [`proca action replay`](#proca-action-replay)
|
|
@@ -69,6 +57,7 @@ you should also use the local proca-api in your [widget generator](https://githu
|
|
|
69
57
|
* [`proca campaign delete`](#proca-campaign-delete)
|
|
70
58
|
* [`proca campaign get`](#proca-campaign-get)
|
|
71
59
|
* [`proca campaign list [TITLE]`](#proca-campaign-list-title)
|
|
60
|
+
* [`proca campaign mtt`](#proca-campaign-mtt)
|
|
72
61
|
* [`proca campaign status`](#proca-campaign-status)
|
|
73
62
|
* [`proca config add [ENV] [HUMAN] [JSON] [CSV] [SIMPLIFY]`](#proca-config-add-env-human-json-csv-simplify)
|
|
74
63
|
* [`proca config folder`](#proca-config-folder)
|
|
@@ -83,8 +72,8 @@ you should also use the local proca-api in your [widget generator](https://githu
|
|
|
83
72
|
* [`proca org add`](#proca-org-add)
|
|
84
73
|
* [`proca org crm`](#proca-org-crm)
|
|
85
74
|
* [`proca org delete`](#proca-org-delete)
|
|
75
|
+
* [`proca org email`](#proca-org-email)
|
|
86
76
|
* [`proca org get`](#proca-org-get)
|
|
87
|
-
* [`proca org join`](#proca-org-join)
|
|
88
77
|
* [`proca plugins`](#proca-plugins)
|
|
89
78
|
* [`proca plugins add PLUGIN`](#proca-plugins-add-plugin)
|
|
90
79
|
* [`proca plugins:inspect PLUGIN...`](#proca-pluginsinspect-plugin)
|
|
@@ -95,9 +84,16 @@ you should also use the local proca-api in your [widget generator](https://githu
|
|
|
95
84
|
* [`proca plugins uninstall [PLUGIN]`](#proca-plugins-uninstall-plugin)
|
|
96
85
|
* [`proca plugins unlink [PLUGIN]`](#proca-plugins-unlink-plugin)
|
|
97
86
|
* [`proca plugins update`](#proca-plugins-update)
|
|
87
|
+
* [`proca service add`](#proca-service-add)
|
|
88
|
+
* [`proca service list`](#proca-service-list)
|
|
89
|
+
* [`proca target add`](#proca-target-add)
|
|
90
|
+
* [`proca template add`](#proca-template-add)
|
|
91
|
+
* [`proca template list`](#proca-template-list)
|
|
98
92
|
* [`proca user get`](#proca-user-get)
|
|
93
|
+
* [`proca user join`](#proca-user-join)
|
|
99
94
|
* [`proca user leave`](#proca-user-leave)
|
|
100
95
|
* [`proca user list`](#proca-user-list)
|
|
96
|
+
* [`proca user me`](#proca-user-me)
|
|
101
97
|
* [`proca user reset [USER]`](#proca-user-reset-user)
|
|
102
98
|
* [`proca user whoami`](#proca-user-whoami)
|
|
103
99
|
* [`proca widget add`](#proca-widget-add)
|
|
@@ -111,23 +107,27 @@ USAGE
|
|
|
111
107
|
$ proca action add [ID_NAME_DXID...] -i <value> --firstname <value> --email <value>
|
|
112
108
|
[--json | --human | --csv] [--env <value>] [--simplify] [-x <value>] [-n <the_short_name>] [--testing] [--optin]
|
|
113
109
|
[--action_type <value>] [--lastname <value>] [--street <value>] [--locality <value>] [--region <value>] [--country
|
|
114
|
-
<value>] [--utm <value>]
|
|
110
|
+
<value>] [--utm <value>] [--target <value>] [--subject <value>] [--body <value>]
|
|
115
111
|
|
|
116
112
|
FLAGS
|
|
117
113
|
-i, --id=<value> (required) widget's id
|
|
118
114
|
-n, --name=<the_short_name> name
|
|
119
115
|
-x, --dxid=<value> dxid
|
|
120
116
|
--action_type=<value> [default: register]
|
|
117
|
+
--body=<value> [mtt] body of the email
|
|
121
118
|
--country=<value> 2-letter country iso code
|
|
122
119
|
--email=<value> (required) email
|
|
123
120
|
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
124
121
|
--firstname=<value> (required) supporter's firstname
|
|
125
122
|
--lastname=<value>
|
|
126
123
|
--locality=<value>
|
|
127
|
-
|
|
124
|
+
--[no-]optin Whether the user opts in (default: false). Use --optin to enable or --no-optin to
|
|
125
|
+
explicitly disable.
|
|
128
126
|
--region=<value>
|
|
129
127
|
--street=<value>
|
|
130
|
-
|
|
128
|
+
--subject=<value> [mtt] subject of the email
|
|
129
|
+
--target=<value> [mtt] uid of the target
|
|
130
|
+
--[no-]testing Run action in testing mode (default: true). Use --no-testing to disable.
|
|
131
131
|
--utm=<value> utm=campaign.source.medium
|
|
132
132
|
|
|
133
133
|
OUTPUT FLAGS
|
|
@@ -140,6 +140,35 @@ EXAMPLES
|
|
|
140
140
|
$ proca action add -i <widget_id> --firstname=John --email=john@example.org
|
|
141
141
|
|
|
142
142
|
$ proca action add -i <widget_id> --firstname=John --email=john@example.org --country=FR custom1=A custom2=B
|
|
143
|
+
|
|
144
|
+
$ proca action add -i <widget_id> --firstname=John --email=john@example.org target=715a9580-cfe6-4005-9e23-61a62ddecfea --subject='MTT subject' --body='message MTT'
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## `proca action confirm`
|
|
148
|
+
|
|
149
|
+
Should the supporter confirm the action? it can be set either for all the widgets or an organisation or all the widgets of a campaign
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
USAGE
|
|
153
|
+
$ proca action confirm [--json | --human | --csv] [--env <value>] [--simplify] [--org
|
|
154
|
+
<value>] [--campaign <value>] [--confirm] [--template <value>]
|
|
155
|
+
|
|
156
|
+
FLAGS
|
|
157
|
+
--campaign=<value> campaign collecting the action
|
|
158
|
+
--[no-]confirm should the supporters confirm each action
|
|
159
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
160
|
+
--org=<value> organisation collecting the action
|
|
161
|
+
--template=<value> template for sending the message
|
|
162
|
+
|
|
163
|
+
OUTPUT FLAGS
|
|
164
|
+
--csv Format output as csv
|
|
165
|
+
--human Format output to be read on screen by a human [default]
|
|
166
|
+
--json Format output as json
|
|
167
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
168
|
+
|
|
169
|
+
DESCRIPTION
|
|
170
|
+
Should the supporter confirm the action? it can be set either for all the widgets or an organisation or all the
|
|
171
|
+
widgets of a campaign
|
|
143
172
|
```
|
|
144
173
|
|
|
145
174
|
## `proca action count`
|
|
@@ -369,6 +398,40 @@ EXAMPLES
|
|
|
369
398
|
$ proca campaign list %pizza%
|
|
370
399
|
```
|
|
371
400
|
|
|
401
|
+
## `proca campaign mtt`
|
|
402
|
+
|
|
403
|
+
set the mail to target (mtt) params
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
USAGE
|
|
407
|
+
$ proca campaign mtt [ID_NAME_DXID] --from <value> --to <value> [--json | --human |
|
|
408
|
+
--csv] [--env <value>] [--simplify] [-i <value> | -n <the_short_name> | -x <value>] [--template <value>] [--period
|
|
409
|
+
<value>] [--email <value>]
|
|
410
|
+
|
|
411
|
+
FLAGS
|
|
412
|
+
-i, --id=<value>
|
|
413
|
+
-n, --name=<the_short_name> name
|
|
414
|
+
-x, --dxid=<value> dxid
|
|
415
|
+
--email=<value> test email address
|
|
416
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
417
|
+
--from=<value> (required) start date (yyyy-mm-dd)
|
|
418
|
+
--period=<value> [default: 09:09-18:18] period of the day (HH:HH-HH:HH)
|
|
419
|
+
--template=<value> mtt template to use
|
|
420
|
+
--to=<value> (required) end date (yyyy-mm-dd)
|
|
421
|
+
|
|
422
|
+
OUTPUT FLAGS
|
|
423
|
+
--csv Format output as csv
|
|
424
|
+
--human Format output to be read on screen by a human [default]
|
|
425
|
+
--json Format output as json
|
|
426
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
427
|
+
|
|
428
|
+
DESCRIPTION
|
|
429
|
+
set the mail to target (mtt) params
|
|
430
|
+
|
|
431
|
+
EXAMPLES
|
|
432
|
+
$ proca campaign mtt -n <test-mtt-campaign>
|
|
433
|
+
```
|
|
434
|
+
|
|
372
435
|
## `proca campaign status`
|
|
373
436
|
|
|
374
437
|
```
|
|
@@ -403,7 +466,8 @@ create setting to access to a server
|
|
|
403
466
|
```
|
|
404
467
|
USAGE
|
|
405
468
|
$ proca config add [ENV] [HUMAN] [JSON] [CSV] [SIMPLIFY] [--json | --human | --csv]
|
|
406
|
-
[--env <value>] [--simplify] [--url
|
|
469
|
+
[--env <value>] [--simplify] [--url http://localhost:4000] [--token API-token>] [--email you@example.org] [--folder
|
|
470
|
+
/var/www/proca/config.example]
|
|
407
471
|
|
|
408
472
|
ARGUMENTS
|
|
409
473
|
ENV [default: default] allow to switch between configurations (server or users)
|
|
@@ -413,10 +477,11 @@ ARGUMENTS
|
|
|
413
477
|
SIMPLIFY flatten and filter to output only the most important attributes, mostly relevant for json
|
|
414
478
|
|
|
415
479
|
FLAGS
|
|
416
|
-
--
|
|
417
|
-
--
|
|
418
|
-
--
|
|
419
|
-
--
|
|
480
|
+
--email=you@example.org user email on proca server
|
|
481
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
482
|
+
--folder=/var/www/proca/config.example config folder (in the proca widget generator)
|
|
483
|
+
--token=API-token> user token on proca server
|
|
484
|
+
--url=http://localhost:4000 [default: https://api.proca.app/api] url of the proca server api
|
|
420
485
|
|
|
421
486
|
OUTPUT FLAGS
|
|
422
487
|
--csv Format output as csv
|
|
@@ -465,7 +530,8 @@ create setting to access to a server
|
|
|
465
530
|
```
|
|
466
531
|
USAGE
|
|
467
532
|
$ proca config init [ENV] [HUMAN] [JSON] [CSV] [SIMPLIFY] [--json | --human | --csv]
|
|
468
|
-
[--env <value>] [--simplify] [--url
|
|
533
|
+
[--env <value>] [--simplify] [--url http://localhost:4000] [--token API-token>] [--email you@example.org] [--folder
|
|
534
|
+
/var/www/proca/config.example]
|
|
469
535
|
|
|
470
536
|
ARGUMENTS
|
|
471
537
|
ENV [default: default] allow to switch between configurations (server or users)
|
|
@@ -475,10 +541,11 @@ ARGUMENTS
|
|
|
475
541
|
SIMPLIFY flatten and filter to output only the most important attributes, mostly relevant for json
|
|
476
542
|
|
|
477
543
|
FLAGS
|
|
478
|
-
--
|
|
479
|
-
--
|
|
480
|
-
--
|
|
481
|
-
--
|
|
544
|
+
--email=you@example.org user email on proca server
|
|
545
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
546
|
+
--folder=/var/www/proca/config.example config folder (in the proca widget generator)
|
|
547
|
+
--token=API-token> user token on proca server
|
|
548
|
+
--url=http://localhost:4000 [default: https://api.proca.app/api] url of the proca server api
|
|
482
549
|
|
|
483
550
|
OUTPUT FLAGS
|
|
484
551
|
--csv Format output as csv
|
|
@@ -562,7 +629,8 @@ create setting to access to a server
|
|
|
562
629
|
```
|
|
563
630
|
USAGE
|
|
564
631
|
$ proca config setup [ENV] [HUMAN] [JSON] [CSV] [SIMPLIFY] [--json | --human | --csv]
|
|
565
|
-
[--env <value>] [--simplify] [--url
|
|
632
|
+
[--env <value>] [--simplify] [--url http://localhost:4000] [--token API-token>] [--email you@example.org] [--folder
|
|
633
|
+
/var/www/proca/config.example]
|
|
566
634
|
|
|
567
635
|
ARGUMENTS
|
|
568
636
|
ENV [default: default] allow to switch between configurations (server or users)
|
|
@@ -572,10 +640,11 @@ ARGUMENTS
|
|
|
572
640
|
SIMPLIFY flatten and filter to output only the most important attributes, mostly relevant for json
|
|
573
641
|
|
|
574
642
|
FLAGS
|
|
575
|
-
--
|
|
576
|
-
--
|
|
577
|
-
--
|
|
578
|
-
--
|
|
643
|
+
--email=you@example.org user email on proca server
|
|
644
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
645
|
+
--folder=/var/www/proca/config.example config folder (in the proca widget generator)
|
|
646
|
+
--token=API-token> user token on proca server
|
|
647
|
+
--url=http://localhost:4000 [default: https://api.proca.app/api] url of the proca server api
|
|
579
648
|
|
|
580
649
|
OUTPUT FLAGS
|
|
581
650
|
--csv Format output as csv
|
|
@@ -616,6 +685,7 @@ DESCRIPTION
|
|
|
616
685
|
|
|
617
686
|
ALIASES
|
|
618
687
|
$ proca user whoami
|
|
688
|
+
$ proca user me
|
|
619
689
|
|
|
620
690
|
EXAMPLES
|
|
621
691
|
$ proca config user
|
|
@@ -777,22 +847,25 @@ EXAMPLES
|
|
|
777
847
|
$ proca org delete <organisation_name>
|
|
778
848
|
```
|
|
779
849
|
|
|
780
|
-
## `proca org
|
|
850
|
+
## `proca org email`
|
|
781
851
|
|
|
782
|
-
|
|
852
|
+
Set service, usually email backend for an org
|
|
783
853
|
|
|
784
854
|
```
|
|
785
855
|
USAGE
|
|
786
|
-
$ proca org
|
|
787
|
-
[--
|
|
856
|
+
$ proca org email [ID_NAME_DXID] --org <value> --mailer mailjet ses stripe
|
|
857
|
+
test_stripe system preview webhook supabase smtp [--json | --human | --csv] [--env <value>] [--simplify] [--from
|
|
858
|
+
<value>]
|
|
788
859
|
|
|
789
860
|
FLAGS
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
--[
|
|
795
|
-
|
|
861
|
+
--env=<value> [default: default] allow to switch
|
|
862
|
+
between configurations (server or users)
|
|
863
|
+
--from=<value> Email address to send from (default:
|
|
864
|
+
<org>@proca.app)
|
|
865
|
+
--mailer=mailjet ses stripe test_stripe system preview webhook supabase smtp (required) [default: MAILJET] service to
|
|
866
|
+
send emails
|
|
867
|
+
--org=<value> (required) organisation running the
|
|
868
|
+
service
|
|
796
869
|
|
|
797
870
|
OUTPUT FLAGS
|
|
798
871
|
--csv Format output as csv
|
|
@@ -801,27 +874,25 @@ OUTPUT FLAGS
|
|
|
801
874
|
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
802
875
|
|
|
803
876
|
DESCRIPTION
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
EXAMPLES
|
|
807
|
-
$ proca org get <name of the ngo>
|
|
877
|
+
Set service, usually email backend for an org
|
|
808
878
|
```
|
|
809
879
|
|
|
810
|
-
## `proca org
|
|
880
|
+
## `proca org get`
|
|
811
881
|
|
|
812
|
-
|
|
882
|
+
view a org
|
|
813
883
|
|
|
814
884
|
```
|
|
815
885
|
USAGE
|
|
816
|
-
$ proca org
|
|
817
|
-
[--simplify] [
|
|
886
|
+
$ proca org get [ID_NAME_DXID] [--json | --human | --csv] [--env <value>]
|
|
887
|
+
[--simplify] [-n <org name>] [--config] [--keys] [--campaigns] [--users]
|
|
818
888
|
|
|
819
889
|
FLAGS
|
|
820
|
-
-
|
|
821
|
-
|
|
822
|
-
--
|
|
823
|
-
|
|
824
|
-
|
|
890
|
+
-n, --name=<org name> name of the org
|
|
891
|
+
--[no-]campaigns
|
|
892
|
+
--[no-]config display the config
|
|
893
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
894
|
+
--[no-]keys
|
|
895
|
+
--[no-]users
|
|
825
896
|
|
|
826
897
|
OUTPUT FLAGS
|
|
827
898
|
--csv Format output as csv
|
|
@@ -830,10 +901,10 @@ OUTPUT FLAGS
|
|
|
830
901
|
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
831
902
|
|
|
832
903
|
DESCRIPTION
|
|
833
|
-
|
|
904
|
+
view a org
|
|
834
905
|
|
|
835
906
|
EXAMPLES
|
|
836
|
-
$ proca org
|
|
907
|
+
$ proca org get <name of the ngo>
|
|
837
908
|
```
|
|
838
909
|
|
|
839
910
|
## `proca plugins`
|
|
@@ -1126,6 +1197,127 @@ DESCRIPTION
|
|
|
1126
1197
|
|
|
1127
1198
|
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.25/src/commands/plugins/update.ts)_
|
|
1128
1199
|
|
|
1200
|
+
## `proca service add`
|
|
1201
|
+
|
|
1202
|
+
Set service, usually email backend for an org, the specific meaning of each param is dependant on the service
|
|
1203
|
+
|
|
1204
|
+
```
|
|
1205
|
+
USAGE
|
|
1206
|
+
$ proca service add -o <value> --type
|
|
1207
|
+
mailjet|ses|stripe|test_stripe|preview|webhook|supabase|smtp [--json | --human | --csv] [--env <value>] [--simplify]
|
|
1208
|
+
[--user <value>] [--password <value>] [--host <value>] [--path <value>]
|
|
1209
|
+
|
|
1210
|
+
FLAGS
|
|
1211
|
+
-o, --org=<value> (required) organisation running the service
|
|
1212
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1213
|
+
--host=<value> server of the service
|
|
1214
|
+
--password=<value> credential of the account on the service
|
|
1215
|
+
--path=<value> path on the service
|
|
1216
|
+
--type=<option> (required) [default: system] type of the service
|
|
1217
|
+
<options: mailjet|ses|stripe|test_stripe|preview|webhook|supabase|smtp>
|
|
1218
|
+
--user=<value> credential of the account on the service
|
|
1219
|
+
|
|
1220
|
+
OUTPUT FLAGS
|
|
1221
|
+
--csv Format output as csv
|
|
1222
|
+
--human Format output to be read on screen by a human [default]
|
|
1223
|
+
--json Format output as json
|
|
1224
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1225
|
+
|
|
1226
|
+
DESCRIPTION
|
|
1227
|
+
Set service, usually email backend for an org, the specific meaning of each param is dependant on the service
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
## `proca service list`
|
|
1231
|
+
|
|
1232
|
+
list services set for an organisation
|
|
1233
|
+
|
|
1234
|
+
```
|
|
1235
|
+
USAGE
|
|
1236
|
+
$ proca service list -o <value> [--json | --human | --csv] [--env <value>]
|
|
1237
|
+
[--simplify]
|
|
1238
|
+
|
|
1239
|
+
FLAGS
|
|
1240
|
+
-o, --org=<value> (required) organisation running the service
|
|
1241
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1242
|
+
|
|
1243
|
+
OUTPUT FLAGS
|
|
1244
|
+
--csv Format output as csv
|
|
1245
|
+
--human Format output to be read on screen by a human [default]
|
|
1246
|
+
--json Format output as json
|
|
1247
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1248
|
+
|
|
1249
|
+
DESCRIPTION
|
|
1250
|
+
list services set for an organisation
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
## `proca target add`
|
|
1254
|
+
|
|
1255
|
+
```
|
|
1256
|
+
USAGE
|
|
1257
|
+
$ proca target add -c <value> --name <value> --email <value> [--json | --human |
|
|
1258
|
+
--csv] [--env <value>] [--simplify] [--external_id <value>]
|
|
1259
|
+
|
|
1260
|
+
FLAGS
|
|
1261
|
+
-c, --campaign=<value> (required) mtt campaign to add the target
|
|
1262
|
+
--email=<value> (required) email of the target
|
|
1263
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1264
|
+
--external_id=<value> external id of the target
|
|
1265
|
+
--name=<value> (required) name of the target
|
|
1266
|
+
|
|
1267
|
+
OUTPUT FLAGS
|
|
1268
|
+
--csv Format output as csv
|
|
1269
|
+
--human Format output to be read on screen by a human [default]
|
|
1270
|
+
--json Format output as json
|
|
1271
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
## `proca template add`
|
|
1275
|
+
|
|
1276
|
+
```
|
|
1277
|
+
USAGE
|
|
1278
|
+
$ proca template add -o <value> [--json | --human | --csv] [--env <value>] [--simplify]
|
|
1279
|
+
[--type thankyou|doi|confirm|doi_thankyou|doi_confirm] [-l <locale>] [-n by default type@language] [-s 'template:'
|
|
1280
|
+
+ type]
|
|
1281
|
+
|
|
1282
|
+
FLAGS
|
|
1283
|
+
-l, --lang=<locale> [default: en] language
|
|
1284
|
+
-n, --name=by default type@language name
|
|
1285
|
+
-o, --org=<value> (required) organisation
|
|
1286
|
+
-s, --subject='template:' + type subject
|
|
1287
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1288
|
+
--type=<option> [default: thankyou]
|
|
1289
|
+
<options: thankyou|doi|confirm|doi_thankyou|doi_confirm>
|
|
1290
|
+
|
|
1291
|
+
OUTPUT FLAGS
|
|
1292
|
+
--csv Format output as csv
|
|
1293
|
+
--human Format output to be read on screen by a human [default]
|
|
1294
|
+
--json Format output as json
|
|
1295
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1296
|
+
```
|
|
1297
|
+
|
|
1298
|
+
## `proca template list`
|
|
1299
|
+
|
|
1300
|
+
list services set for an organisation
|
|
1301
|
+
|
|
1302
|
+
```
|
|
1303
|
+
USAGE
|
|
1304
|
+
$ proca template list -o <value> [--json | --human | --csv] [--env <value>]
|
|
1305
|
+
[--simplify]
|
|
1306
|
+
|
|
1307
|
+
FLAGS
|
|
1308
|
+
-o, --org=<value> (required) organisation having the templates
|
|
1309
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1310
|
+
|
|
1311
|
+
OUTPUT FLAGS
|
|
1312
|
+
--csv Format output as csv
|
|
1313
|
+
--human Format output to be read on screen by a human [default]
|
|
1314
|
+
--json Format output as json
|
|
1315
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1316
|
+
|
|
1317
|
+
DESCRIPTION
|
|
1318
|
+
list services set for an organisation
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1129
1321
|
## `proca user get`
|
|
1130
1322
|
|
|
1131
1323
|
fetch the information about a user
|
|
@@ -1154,19 +1346,48 @@ EXAMPLES
|
|
|
1154
1346
|
$ proca user get
|
|
1155
1347
|
```
|
|
1156
1348
|
|
|
1349
|
+
## `proca user join`
|
|
1350
|
+
|
|
1351
|
+
let a user join an organisation with a role
|
|
1352
|
+
|
|
1353
|
+
```
|
|
1354
|
+
USAGE
|
|
1355
|
+
$ proca user join -o <org name> [--json | --human | --csv] [--env <value>]
|
|
1356
|
+
[--simplify] [--role owner|campaigner|coordinator|translator] [-u <user email>]
|
|
1357
|
+
|
|
1358
|
+
FLAGS
|
|
1359
|
+
-o, --org=<org name> (required) name of the org
|
|
1360
|
+
-u, --user=<user email> email
|
|
1361
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1362
|
+
--role=<option> [default: campaigner] permission level in that org
|
|
1363
|
+
<options: owner|campaigner|coordinator|translator>
|
|
1364
|
+
|
|
1365
|
+
OUTPUT FLAGS
|
|
1366
|
+
--csv Format output as csv
|
|
1367
|
+
--human Format output to be read on screen by a human [default]
|
|
1368
|
+
--json Format output as json
|
|
1369
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1370
|
+
|
|
1371
|
+
DESCRIPTION
|
|
1372
|
+
let a user join an organisation with a role
|
|
1373
|
+
|
|
1374
|
+
EXAMPLES
|
|
1375
|
+
$ proca user join
|
|
1376
|
+
```
|
|
1377
|
+
|
|
1157
1378
|
## `proca user leave`
|
|
1158
1379
|
|
|
1159
1380
|
leave a org
|
|
1160
1381
|
|
|
1161
1382
|
```
|
|
1162
1383
|
USAGE
|
|
1163
|
-
$ proca user leave
|
|
1164
|
-
[--
|
|
1384
|
+
$ proca user leave -o <org name> [--json | --human | --csv] [--env <value>]
|
|
1385
|
+
[--simplify] [-u <user email>]
|
|
1165
1386
|
|
|
1166
1387
|
FLAGS
|
|
1167
|
-
-o, --org=<org name>
|
|
1168
|
-
|
|
1169
|
-
--env=<value>
|
|
1388
|
+
-o, --org=<org name> (required) name of the org
|
|
1389
|
+
-u, --user=<user email> email
|
|
1390
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1170
1391
|
|
|
1171
1392
|
OUTPUT FLAGS
|
|
1172
1393
|
--csv Format output as csv
|
|
@@ -1207,6 +1428,34 @@ EXAMPLES
|
|
|
1207
1428
|
$ proca user list %pizza%
|
|
1208
1429
|
```
|
|
1209
1430
|
|
|
1431
|
+
## `proca user me`
|
|
1432
|
+
|
|
1433
|
+
fetch the information about the current user (based on the token)
|
|
1434
|
+
|
|
1435
|
+
```
|
|
1436
|
+
USAGE
|
|
1437
|
+
$ proca user me [--json | --human | --csv] [--env <value>] [--simplify]
|
|
1438
|
+
|
|
1439
|
+
FLAGS
|
|
1440
|
+
--env=<value> [default: default] allow to switch between configurations (server or users)
|
|
1441
|
+
|
|
1442
|
+
OUTPUT FLAGS
|
|
1443
|
+
--csv Format output as csv
|
|
1444
|
+
--human Format output to be read on screen by a human [default]
|
|
1445
|
+
--json Format output as json
|
|
1446
|
+
--[no-]simplify flatten and filter to output only the most important attributes, mostly relevant for json
|
|
1447
|
+
|
|
1448
|
+
DESCRIPTION
|
|
1449
|
+
fetch the information about the current user (based on the token)
|
|
1450
|
+
|
|
1451
|
+
ALIASES
|
|
1452
|
+
$ proca user whoami
|
|
1453
|
+
$ proca user me
|
|
1454
|
+
|
|
1455
|
+
EXAMPLES
|
|
1456
|
+
$ proca user me
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1210
1459
|
## `proca user reset [USER]`
|
|
1211
1460
|
|
|
1212
1461
|
Reset user API token
|
|
@@ -1256,6 +1505,7 @@ DESCRIPTION
|
|
|
1256
1505
|
|
|
1257
1506
|
ALIASES
|
|
1258
1507
|
$ proca user whoami
|
|
1508
|
+
$ proca user me
|
|
1259
1509
|
|
|
1260
1510
|
EXAMPLES
|
|
1261
1511
|
$ proca user whoami
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Args, Flags } from "@oclif/core";
|
|
2
2
|
import { error, stdout, ux } from "@oclif/core/ux";
|
|
3
|
-
import OrgGet from "#src/commands/org/get.mjs";
|
|
4
3
|
import Command from "#src/procaCommand.mjs";
|
|
5
4
|
import { gql, mutation } from "#src/urql.mjs";
|
|
6
5
|
import { getTwitter } from "#src/util/twitter.mjs";
|
|
@@ -9,6 +8,7 @@ export default class ActionAdd extends Command {
|
|
|
9
8
|
static examples = [
|
|
10
9
|
"<%= config.bin %> <%= command.id %> -i <widget_id> --firstname=John --email=john@example.org",
|
|
11
10
|
"<%= config.bin %> <%= command.id %> -i <widget_id> --firstname=John --email=john@example.org --country=FR custom1=A custom2=B",
|
|
11
|
+
"<%= config.bin %> <%= command.id %> -i <widget_id> --firstname=John --email=john@example.org target=715a9580-cfe6-4005-9e23-61a62ddecfea --subject='MTT subject' --body='message MTT'",
|
|
12
12
|
];
|
|
13
13
|
|
|
14
14
|
static args = this.multiid();
|
|
@@ -21,8 +21,18 @@ export default class ActionAdd extends Command {
|
|
|
21
21
|
description: "widget's id",
|
|
22
22
|
required: true,
|
|
23
23
|
}),
|
|
24
|
-
testing: Flags.boolean({
|
|
25
|
-
|
|
24
|
+
testing: Flags.boolean({
|
|
25
|
+
default: true,
|
|
26
|
+
allowNo: true, // ✅ enables --no-testing
|
|
27
|
+
description:
|
|
28
|
+
"Run action in testing mode (default: true). Use --no-testing to disable.",
|
|
29
|
+
}),
|
|
30
|
+
optin: Flags.boolean({
|
|
31
|
+
default: false,
|
|
32
|
+
allowNo: true, // ✅ enables --no-optin
|
|
33
|
+
description:
|
|
34
|
+
"Whether the user opts in (default: false). Use --optin to enable or --no-optin to explicitly disable.",
|
|
35
|
+
}),
|
|
26
36
|
action_type: Flags.string({
|
|
27
37
|
default: "register",
|
|
28
38
|
}),
|
|
@@ -50,6 +60,9 @@ export default class ActionAdd extends Command {
|
|
|
50
60
|
description: "email",
|
|
51
61
|
required: true,
|
|
52
62
|
}),
|
|
63
|
+
target: Flags.string({ description: "[mtt] uid of the target" }),
|
|
64
|
+
subject: Flags.string({ description: "[mtt] subject of the email" }),
|
|
65
|
+
body: Flags.string({ description: "[mtt] body of the email" }),
|
|
53
66
|
};
|
|
54
67
|
|
|
55
68
|
create = async (flags) => {
|
|
@@ -95,6 +108,16 @@ export default class ActionAdd extends Command {
|
|
|
95
108
|
},
|
|
96
109
|
};
|
|
97
110
|
|
|
111
|
+
if (flags.target) {
|
|
112
|
+
values.action.mtt = {
|
|
113
|
+
targets: [flags.target],
|
|
114
|
+
subject: flags.subject || "Test MTT",
|
|
115
|
+
body: flags.body || "Please ignore, this is a test",
|
|
116
|
+
};
|
|
117
|
+
values.action.actionType = "mail2target";
|
|
118
|
+
}
|
|
119
|
+
console.log(values.action.mtt);
|
|
120
|
+
|
|
98
121
|
const query = gql`
|
|
99
122
|
mutation (
|
|
100
123
|
$action: ActionInput!
|