@engine9-io/input-tools 1.3.6

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.
@@ -0,0 +1,6 @@
1
+ given_name,family_name,email,phone,mobile_phone,birthdate,street_1,street_2,city,region,postal_code,country,avatar
2
+ Cassandre,Skiles-Schultz,Estefania.Feeney97@hotmail.com,653-835-5999 x129,(749) 629-6330,-58155336616,8396 Marguerite Rapids Suite 864,,South Mandy,NE,68063,GT,https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/729.jpg
3
+ Gilda,Schaefer,Jayce_Wuckert@hotmail.com,908.628.1386 x38583,(291) 240-3296 x70290,680338157655,72016 Brekke Path Suite 507,,Abshireton,LA,70035,MT,https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/1145.jpg
4
+ Stanton,Hauck-Pagac,Loyal.Johns98@hotmail.com,602-202-1206 x4874,500.642.4173 x609,796778263071,3383 Haley Way Suite 879,,North Salvadorboro,WY,82790,MR,https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/615.jpg
5
+ Victor,Nicolas,Deborah56@hotmail.com,1-616-972-4307 x2957,936.247.5623 x57843,-765498042689,70433 Raynor Ways Suite 545,,Emmittboro,MO,65448,IM,https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/295.jpg
6
+ Vada,Douglas-Miller,Beatrice_Bernier86@gmail.com,620.824.7501 x450,736-826-0686 x9957,48215369719,94190 Stephon Route Suite 884,,Fort Daytonstad,MT,59490,LB,https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/292.jpg
@@ -0,0 +1,41 @@
1
+ {
2
+ _id: 3611485,
3
+ remote_message_id: '49887',
4
+ account_id: 'packet-sample',
5
+ date_created: '2023-08-23T21:46:34.504Z',
6
+ last_modified: '2023-08-30T20:36:16.630Z',
7
+ publish_date: '2023-07-11T20:49:40.713Z',
8
+ original_publish_date: null,
9
+ plugin: { plugin_id: 'switchboard_i67', submodule: 'Messages' },
10
+ label: 'Sample Message Label',
11
+ status: 'sent',
12
+ channel: 'sms',
13
+ edit_url: 'https://foo.com/edit?id=49887',
14
+ content: {
15
+ /* Standardized field names for commonly used messaging data */
16
+ subject: 'This team stepped up big time',
17
+ from_name: 'Testing Name',
18
+ from_email: 'test@test.com',
19
+ text: 'Hello {{given_name}} {{family_name}} https://foo.com/?person_id={{person_id}}',
20
+ html:'Hello {{given_name}} {{family_name}} <a href="https://foo.com/?person_id={{person_id}}">Click Me</a>',
21
+ },
22
+ remote_data: {
23
+ /* open fields for other arbitrary remote content */
24
+ slug: 'sample-slug',
25
+ list: {
26
+
27
+ },
28
+ remote_sample_statistics: {
29
+ total_messages: 0,
30
+ total_processed: 0,
31
+ total_delivered: 0,
32
+ total_form_responses: 0,
33
+ clicks: 0,
34
+ replies: 0,
35
+ opt_outs: 0,
36
+ total_donations: 0,
37
+ total_amount: '0.0000',
38
+ cost_estimate: '0.0000'
39
+ }
40
+ }
41
+ }
package/test/uuid.js ADDED
@@ -0,0 +1,25 @@
1
+ const {
2
+ it,
3
+ } = require('node:test');
4
+ const assert = require('node:assert');
5
+ const debug = require('debug')('message');
6
+
7
+ const { getUUIDv7, getUUIDTimestamp } = require('../index');
8
+
9
+ it('Should correctly calculate UUIDS given various inputs', async () => {
10
+ const now = new Date();
11
+
12
+ const uuid = getUUIDv7();
13
+ const ts = getUUIDTimestamp(uuid);
14
+ debug(uuid, ts, now);
15
+ const diff = now.getTime() - ts.getTime();
16
+ assert(diff < 1000 && diff >= 0, 'More than a second between newly created');
17
+
18
+ const uuid2 = getUUIDv7(now);
19
+ const ts2 = getUUIDTimestamp(uuid2);
20
+ const diff2 = now.getTime() - ts2.getTime();
21
+ assert(diff2 === 0, 'Timestamps should match');
22
+
23
+ const uuid3 = getUUIDv7(now);
24
+ assert(uuid2 !== uuid3, 'UUIDs should be unique match');
25
+ });
@@ -0,0 +1,142 @@
1
+ const SOURCE_CODE_OVERRIDE = 0;
2
+ const CRM_ORIGIN = 1;
3
+ const ACQUISITION = 2;
4
+
5
+ // Generic signup
6
+ const SIGNUP = 3;
7
+ // Known first time signup
8
+ const SIGNUP_INITIAL = 4;
9
+ // Known subsequent signup
10
+ const SIGNUP_SUBSEQUENT = 5;
11
+ const UNSUBSCRIBE = 6;
12
+
13
+ // Generic monetary transaction
14
+ const TRANSACTION = 10;
15
+ // known one-time transaction
16
+ const TRANSACTION_ONE_TIME = 11;
17
+ // known initial recurring transaction
18
+ const TRANSACTION_INITIAL = 12;
19
+ // known initial transaction
20
+ const TRANSACTION_SUBSEQUENT = 13;
21
+ // known recurring, not sure if first
22
+ const TRANSACTION_RECURRING = 14;
23
+ // refunded transaction, first instance
24
+ const TRANSACTION_REFUND = 15;
25
+
26
+ const SEGMENT_PERSON_ADD = 16;
27
+ const SEGMENT_PERSON_REMOVE = 17;
28
+
29
+ const SMS_SEND = 30;
30
+ const SMS_DELIVERED = 31;
31
+ const SMS_CLICK = 33;
32
+ const SMS_UNSUBSCRIBE = 34;
33
+ const SMS_BOUNCE = 37;
34
+ const SMS_REPLY = 39;
35
+
36
+ const EMAIL_SEND = 40;
37
+ const EMAIL_DELIVERED = 41;
38
+ const EMAIL_OPEN = 42;
39
+ const EMAIL_CLICK = 43;
40
+ const EMAIL_UNSUBSCRIBE = 44;
41
+ const EMAIL_SOFT_BOUNCE = 45;
42
+ const EMAIL_HARD_BOUNCE = 46;
43
+ const EMAIL_BOUNCE = 47;
44
+ const EMAIL_SPAM = 48;
45
+ const EMAIL_REPLY = 49;
46
+
47
+ const PHONE_CALL_ATTEMPT = 50;
48
+ const PHONE_CALL_SUCCESS = 51;
49
+ const PHONE_CALL_FAIL = 52;
50
+
51
+ // Generic action
52
+ const FORM_SUBMIT = 60;
53
+ const FORM_PETITION = 61;
54
+ const FORM_PETITION_CONTACT_TARGET = 62;
55
+
56
+ // unknown generic conversion on a message
57
+ const MESSAGE_CONVERSION = 63;
58
+ // advocacy conversion on a message
59
+ const MESSAGE_CONVERSION_ADVOCACY = 64;
60
+ // unknown transaction conversion on a message
61
+ const MESSAGE_CONVERSION_TRANSACTION = 65;
62
+
63
+ const FORM_ADVOCACY = 66;
64
+
65
+ const FILE_IMPORT = 70;
66
+
67
+ // For tracking exports or data pushes
68
+ // Generic export of data
69
+ const EXPORT = 80;
70
+
71
+ // Export specifically for pushing data to remote systems
72
+ const EXPORT_FOR_REMOTE = 81;
73
+
74
+ // Export specifically for sending out messages
75
+ const EXPORT_FOR_MESSAGING = 81;
76
+
77
+ // DO. NOT. CHANGE. (once finalized)
78
+ // should probably have offsets between types
79
+ // ie email, transaction, etc.
80
+ // or maybe top level TIMELINE_ROW_TYPES and subtypes. /shrug emoji
81
+ const TIMELINE_ENTRY_TYPES = {
82
+ SOURCE_CODE_OVERRIDE,
83
+ CRM_ORIGIN,
84
+ ACQUISITION,
85
+ // signups
86
+ SIGNUP,
87
+ SIGNUP_INITIAL,
88
+ SIGNUP_SUBSEQUENT,
89
+ UNSUBSCRIBE,
90
+ TRANSACTION,
91
+ TRANSACTION_INITIAL,
92
+ TRANSACTION_SUBSEQUENT,
93
+ TRANSACTION_ONE_TIME,
94
+ TRANSACTION_RECURRING,
95
+ TRANSACTION_REFUND,
96
+
97
+ SEGMENT_PERSON_ADD,
98
+ SEGMENT_PERSON_REMOVE,
99
+
100
+ SMS_SEND,
101
+ SMS_DELIVERED,
102
+ SMS_CLICK,
103
+ SMS_UNSUBSCRIBE,
104
+ SMS_BOUNCE,
105
+ SMS_REPLY,
106
+
107
+ // email interactions
108
+ EMAIL_SEND,
109
+ EMAIL_DELIVERED,
110
+ EMAIL_OPEN,
111
+ EMAIL_CLICK,
112
+ EMAIL_UNSUBSCRIBE,
113
+ EMAIL_SOFT_BOUNCE,
114
+ EMAIL_HARD_BOUNCE,
115
+ EMAIL_BOUNCE,
116
+ EMAIL_REPLY,
117
+ EMAIL_SPAM,
118
+
119
+ PHONE_CALL_ATTEMPT,
120
+ PHONE_CALL_SUCCESS,
121
+ PHONE_CALL_FAIL,
122
+
123
+ // forms
124
+ FORM_SUBMIT,
125
+ FORM_PETITION,
126
+ FORM_PETITION_CONTACT_TARGET,
127
+ FORM_ADVOCACY,
128
+
129
+ MESSAGE_CONVERSION,
130
+ MESSAGE_CONVERSION_ADVOCACY,
131
+ MESSAGE_CONVERSION_TRANSACTION,
132
+
133
+ FILE_IMPORT,
134
+ EXPORT,
135
+ EXPORT_FOR_REMOTE,
136
+ EXPORT_FOR_MESSAGING,
137
+
138
+ };
139
+ Object.entries(TIMELINE_ENTRY_TYPES).forEach(([k, v]) => { TIMELINE_ENTRY_TYPES[v] = k; });
140
+ module.exports = {
141
+ TIMELINE_ENTRY_TYPES,
142
+ };