proca 1.2.1 → 1.2.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 +1 -1
- package/package.json +2 -1
- package/src/commands/contact/list.mjs +6 -4
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proca",
|
|
3
3
|
"description": "Access the proca api",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"author": "Xavier",
|
|
6
6
|
"bin": {
|
|
7
7
|
"proca": "proca-cli"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@oclif/plugin-help": "^6",
|
|
13
13
|
"@oclif/plugin-plugins": "^5",
|
|
14
14
|
"@urql/exchange-auth": "^2.2.0",
|
|
15
|
+
"date-fns": "^4.1.0",
|
|
15
16
|
"dotenv": "^16.4.5",
|
|
16
17
|
"dxid": "^2.2.1",
|
|
17
18
|
"easy-table": "^1.2.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from "@oclif/core";
|
|
2
2
|
import { error, stdout, ux } from "@oclif/core/ux";
|
|
3
|
+
import { formatDistanceToNowStrict } from "date-fns";
|
|
3
4
|
import Command from "#src/procaCommand.mjs";
|
|
4
5
|
import {
|
|
5
6
|
FragmentOrg,
|
|
@@ -99,6 +100,7 @@ export default class List extends Command {
|
|
|
99
100
|
) {
|
|
100
101
|
actionId
|
|
101
102
|
actionPage {
|
|
103
|
+
id
|
|
102
104
|
locale
|
|
103
105
|
name
|
|
104
106
|
}
|
|
@@ -166,16 +168,14 @@ export default class List extends Command {
|
|
|
166
168
|
country: d.contact.country,
|
|
167
169
|
email: d.contact.email,
|
|
168
170
|
type: d.actionType,
|
|
169
|
-
date: d.createdAt,
|
|
170
|
-
campaign: d.campaign.name,
|
|
171
|
+
date: formatDistanceToNowStrict(d.createdAt),
|
|
172
|
+
campaign: !this.flags.campaign && d.campaign.name,
|
|
171
173
|
widget_id: d.actionPage.id,
|
|
172
174
|
widget: d.actionPage.name,
|
|
173
175
|
// customFields
|
|
174
176
|
};
|
|
175
177
|
if (this.flags.comment && d.customFields?.comment)
|
|
176
178
|
result.comment = d.customFields.comment;
|
|
177
|
-
if (d.customFields?.emailProvider)
|
|
178
|
-
result.provider = d.customFields.emailProvider;
|
|
179
179
|
if (this.flags.utm && d.tracking) {
|
|
180
180
|
result.utm_medium =
|
|
181
181
|
d.tracking.medium === "unknown" ? undefined : d.tracking.medium;
|
|
@@ -187,6 +187,8 @@ export default class List extends Command {
|
|
|
187
187
|
result.utm_content =
|
|
188
188
|
d.tracking.content === "unknown" ? undefined : d.tracking.content;
|
|
189
189
|
}
|
|
190
|
+
if (d.customFields?.emailProvider)
|
|
191
|
+
result.provider = d.customFields.emailProvider;
|
|
190
192
|
return result;
|
|
191
193
|
};
|
|
192
194
|
|