proca 0.6.5 → 1.1.4

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/0.6.5 linux-x64 node-v20.12.2
21
+ proca/1.1.4 linux-x64 node-v22.14.0
22
22
  $ proca --help [COMMAND]
23
23
  USAGE
24
24
  $ proca COMMAND
@@ -61,7 +61,6 @@ USAGE
61
61
  * [`proca config get`](#proca-config-get)
62
62
  * [`proca config set [KEY] [VALUE]`](#proca-config-set-key-value)
63
63
  * [`proca config setup [ENVIRONMENT]`](#proca-config-setup-environment)
64
- * [`proca config token`](#proca-config-token)
65
64
  * [`proca config user`](#proca-config-user)
66
65
  * [`proca help [COMMAND]`](#proca-help-command)
67
66
  * [`proca org add`](#proca-org-add)
@@ -84,7 +83,6 @@ USAGE
84
83
  * [`proca user leave`](#proca-user-leave)
85
84
  * [`proca user list`](#proca-user-list)
86
85
  * [`proca widget add`](#proca-widget-add)
87
- * [`proca widget cache`](#proca-widget-cache)
88
86
  * [`proca widget get`](#proca-widget-get)
89
87
  * [`proca widget list`](#proca-widget-list)
90
88
 
@@ -407,27 +405,6 @@ EXAMPLES
407
405
  $ proca config setup --user=xavier@example.org --token=API-12345789
408
406
  ```
409
407
 
410
- ## `proca config token`
411
-
412
- convert between token and sql value
413
-
414
- ```
415
- USAGE
416
- $ proca config token [--simplify [--json | --human | --csv]] [--token API-xxx]
417
-
418
- FLAGS
419
- --token=API-xxx the token in your config
420
-
421
- OUTPUT FLAGS
422
- --csv Format output as csv
423
- --human Format output to be read on screen by a human [default]
424
- --json Format output as json
425
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
426
-
427
- DESCRIPTION
428
- convert between token and sql value
429
- ```
430
-
431
408
  ## `proca config user`
432
409
 
433
410
  fetch the information about the current user (based on the token)
@@ -1013,36 +990,6 @@ OUTPUT FLAGS
1013
990
  --simplify flatten and filter to output only the most important attributes, mostly relevant for json
1014
991
  ```
1015
992
 
1016
- ## `proca widget cache`
1017
-
1018
- clear the cdn cache of a widget
1019
-
1020
- ```
1021
- USAGE
1022
- $ proca widget cache [ID_NAME_DXID] [--simplify [--json | --human | --csv]] [-i <value>
1023
- | -n <the_short_name> | -x <value>] [--url <value>]
1024
-
1025
- FLAGS
1026
- -i, --id=<value>
1027
- -n, --name=<the_short_name> name
1028
- -x, --dxid=<value> dxid
1029
- --url=<value> url of the widget on the CDN
1030
-
1031
- OUTPUT FLAGS
1032
- --csv Format output as csv
1033
- --human Format output to be read on screen by a human [default]
1034
- --json Format output as json
1035
- --simplify flatten and filter to output only the most important attributes, mostly relevant for json
1036
-
1037
- DESCRIPTION
1038
- clear the cdn cache of a widget
1039
-
1040
- EXAMPLES
1041
- $ proca widget cache --url https://cdn.proca.app/d/[campaign]/[org]/[locale]
1042
-
1043
- $ proca widget cache --name [campaign]/[org]/[locale]
1044
- ```
1045
-
1046
993
  ## `proca widget get`
1047
994
 
1048
995
  view a widget
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "proca",
3
3
  "description": "Access the proca api",
4
- "version": "0.6.5",
4
+ "version": "1.1.4",
5
5
  "author": "Xavier",
6
6
  "bin": {
7
7
  "proca": "proca-cli"
@@ -38,7 +38,7 @@ export default class CampaignList extends Command {
38
38
  }),
39
39
  optin: Flags.boolean({
40
40
  description: "only export the optin actions",
41
- default: true,
41
+ default: false,
42
42
  }),
43
43
  testing: Flags.boolean({
44
44
  description: "also export the test actions",
@@ -114,7 +114,8 @@ export default class CampaignList extends Command {
114
114
  }
115
115
  }
116
116
  `;
117
- const result = await query(Document, {
117
+
118
+ const variables = {
118
119
  after: flags.after,
119
120
  // "campaignId": 42,
120
121
  campaignName: flags.campaign,
@@ -124,8 +125,10 @@ export default class CampaignList extends Command {
124
125
  onlyOptIn: flags.optin,
125
126
  orgName: flags.org,
126
127
  start: flags.start,
127
- });
128
- console.log(result);
128
+ };
129
+ console.log("fetching actions", variables);
130
+ const result = await query(Document, variables);
131
+ console.log("result", result);
129
132
  return result.exportActions.map((d) => {
130
133
  d.customFields = JSON.parse(d.customFields);
131
134
  if (!d.contact.publicKey) {
@@ -181,6 +184,6 @@ export default class CampaignList extends Command {
181
184
  let data = [];
182
185
 
183
186
  data = await this.fetch(flags);
184
- return this.output(data);
187
+ //return this.output(data);
185
188
  }
186
189
  }
@@ -1,34 +0,0 @@
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
- }
@@ -1,29 +0,0 @@
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
-