openemail 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/openemail/api_paths.rb +49 -0
- data/lib/openemail/client.rb +5 -0
- data/lib/openemail/constants.rb +250 -4
- data/lib/openemail/protocol.rb +7 -1
- data/lib/openemail/resource.rb +13 -0
- data/lib/openemail/resources/automations.rb +104 -0
- data/lib/openemail/resources/billing.rb +12 -0
- data/lib/openemail/resources/calendar.rb +25 -0
- data/lib/openemail/resources/contacts.rb +37 -0
- data/lib/openemail/resources/events.rb +22 -0
- data/lib/openemail/resources/follow_ups.rb +21 -0
- data/lib/openemail/resources/imports.rb +16 -0
- data/lib/openemail/resources/keys.rb +29 -30
- data/lib/openemail/resources/labels.rb +4 -0
- data/lib/openemail/resources/me.rb +38 -0
- data/lib/openemail/resources/out_of_office.rb +28 -0
- data/lib/openemail/resources/sending.rb +23 -0
- data/lib/openemail/resources/threads.rb +30 -8
- data/lib/openemail/resources/tools.rb +8 -0
- data/lib/openemail/version.rb +1 -1
- data/lib/openemail/wire.rb +1 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f3fd5ca0bfd10e7e9c0af1b6b5f7de4d87982b448aa8db5ea0580837b0cd43f
|
|
4
|
+
data.tar.gz: a992fa85df64c861af5a83b13b1dbd1a18bb131709a71269e2d9b6d2246e36a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c251b82d16cea23d5f9bb77eeb94c8fb003d8b35b906a6464aa9c06cc0150891ebcd09959211f72f632eecb9a91ed8e75a215140b835caaab5595b4eeac0a1b1
|
|
7
|
+
data.tar.gz: 1d7d010e40a52299fc9176a80fddb36c7d0ab2b42778e50dcc314adfc4b7eeb31c4635a137d0a13c2d4798df29bc5446b46903f928e232b0f4ebed011895eb4c
|
data/lib/openemail/api_paths.rb
CHANGED
|
@@ -27,7 +27,25 @@ module OpenEmail
|
|
|
27
27
|
AUDIENCE_CONTACTS_BATCH_REMOVE = "/audiences/:id/contacts/batch-remove"
|
|
28
28
|
AUDIENCE_EMPTY = "/audiences/:id/empty"
|
|
29
29
|
AUDIENCE_IMPORT = "/audiences/:id/import"
|
|
30
|
+
AUTOMATION = "/automations/:id"
|
|
31
|
+
AUTOMATIONS = "/automations"
|
|
32
|
+
AUTOMATION_ARCHIVE = "/automations/:id/archive"
|
|
33
|
+
AUTOMATION_DUPLICATE = "/automations/:id/duplicate"
|
|
34
|
+
AUTOMATION_ENROLLMENT = "/automations/:id/enrollments/:enrollmentId"
|
|
35
|
+
AUTOMATION_ENROLLMENTS = "/automations/:id/enrollments"
|
|
36
|
+
AUTOMATION_ENROLLMENT_EXIT = "/automations/:id/enrollments/:enrollmentId/exit"
|
|
37
|
+
AUTOMATION_PAUSE = "/automations/:id/pause"
|
|
38
|
+
AUTOMATION_PUBLISH = "/automations/:id/publish"
|
|
39
|
+
AUTOMATION_RESUME = "/automations/:id/resume"
|
|
40
|
+
AUTOMATION_STARTERS = "/automations/starters"
|
|
41
|
+
AUTOMATION_STATS = "/automations/:id/stats"
|
|
42
|
+
AUTOMATION_TEST = "/automations/:id/test"
|
|
43
|
+
AUTOMATION_VERSIONS = "/automations/:id/versions"
|
|
44
|
+
AUTOMATION_VERSION_RESTORE = "/automations/:id/versions/:version/restore"
|
|
30
45
|
BILLING = "/billing"
|
|
46
|
+
BILLING_ADD_ON = "/billing/add-ons/:addOn"
|
|
47
|
+
BILLING_ADD_ONS = "/billing/add-ons"
|
|
48
|
+
BILLING_ADD_ON_CHECKOUT = "/billing/add-ons/checkout"
|
|
31
49
|
BILLING_ALERTS = "/billing/alerts"
|
|
32
50
|
BILLING_CHECKOUT = "/billing/checkout"
|
|
33
51
|
BILLING_COUNTRIES = "/billing/countries"
|
|
@@ -59,6 +77,9 @@ module OpenEmail
|
|
|
59
77
|
CALENDAR_FEED = "/calendar/feeds/:id"
|
|
60
78
|
CALENDAR_FEEDS = "/calendar/feeds"
|
|
61
79
|
CALENDAR_FEED_RESET = "/calendar/feeds/:id/reset"
|
|
80
|
+
CALENDAR_IMPORT = "/calendar/imports/:id"
|
|
81
|
+
CALENDAR_IMPORTS = "/calendar/imports"
|
|
82
|
+
CALENDAR_IMPORT_UNDO = "/calendar/imports/:id/undo"
|
|
62
83
|
CALENDAR_SUBSCRIPTION = "/calendar/subscriptions/:id"
|
|
63
84
|
CALENDAR_SUBSCRIPTIONS = "/calendar/subscriptions"
|
|
64
85
|
CALENDAR_SUBSCRIPTION_REFRESH = "/calendar/subscriptions/:id/refresh"
|
|
@@ -73,6 +94,10 @@ module OpenEmail
|
|
|
73
94
|
CONTACT_BLOCK = "/contacts/:email/block"
|
|
74
95
|
CONTACT_CARD = "/contacts/cards/:id"
|
|
75
96
|
CONTACT_CARDS = "/contacts/cards"
|
|
97
|
+
CONTACT_EVENTS = "/contacts/:email/events"
|
|
98
|
+
CONTACT_IMPORT = "/contacts/imports/:id"
|
|
99
|
+
CONTACT_IMPORTS = "/contacts/imports"
|
|
100
|
+
CONTACT_IMPORT_UNDO = "/contacts/imports/:id/undo"
|
|
76
101
|
CONTACT_PHOTO = "/contacts/:email/photo"
|
|
77
102
|
CONTACT_THREADS = "/contacts/:email/threads"
|
|
78
103
|
DNS_CONNECTION = "/dns-connections/:id"
|
|
@@ -111,6 +136,9 @@ module OpenEmail
|
|
|
111
136
|
EMAIL_TRACKING = "/emails/:id/tracking"
|
|
112
137
|
ENCRYPTION_KEYS = "/encryption/keys"
|
|
113
138
|
ENCRYPTION_KEYS_LOOKUP = "/encryption/keys/lookup"
|
|
139
|
+
EVENTS = "/events"
|
|
140
|
+
EVENTS_BATCH = "/events/batch"
|
|
141
|
+
EVENT_NAMES = "/events/names"
|
|
114
142
|
FILE = "/files/:id"
|
|
115
143
|
FILES = "/files"
|
|
116
144
|
FILES_BATCH_DELETE = "/files/batch-delete"
|
|
@@ -118,6 +146,8 @@ module OpenEmail
|
|
|
118
146
|
FILE_CONTENT = "/files/:id/content"
|
|
119
147
|
FILE_LINK = "/files/:id/links/:linkId"
|
|
120
148
|
FILE_LINKS = "/files/:id/links"
|
|
149
|
+
FOLLOW_UP = "/follow-ups/:id"
|
|
150
|
+
FOLLOW_UPS = "/follow-ups"
|
|
121
151
|
FORM = "/forms/:id"
|
|
122
152
|
FORMS = "/forms"
|
|
123
153
|
FORMS_DESIGN = "/forms/design"
|
|
@@ -139,6 +169,10 @@ module OpenEmail
|
|
|
139
169
|
IMPORT_CANCEL = "/imports/:id/cancel"
|
|
140
170
|
IMPORT_FAILURES = "/imports/:id/failures"
|
|
141
171
|
IMPORT_FILE_CHUNK = "/imports/:id/files/:file/chunks/:chunk"
|
|
172
|
+
IMPORT_MAILBOX = "/imports/mailbox"
|
|
173
|
+
IMPORT_MAILBOX_CHECK = "/imports/mailbox/check"
|
|
174
|
+
IMPORT_MAILBOX_SETTINGS = "/imports/mailbox-settings"
|
|
175
|
+
IMPORT_RESUME = "/imports/:id/resume"
|
|
142
176
|
IMPORT_START = "/imports/:id/start"
|
|
143
177
|
IMPORT_UPLOAD = "/imports/:id/upload"
|
|
144
178
|
KEY = "/keys/:id"
|
|
@@ -151,7 +185,10 @@ module OpenEmail
|
|
|
151
185
|
KEY_REVOKE = "/keys/:id/revoke"
|
|
152
186
|
KEY_ROTATE = "/keys/:id/rotate"
|
|
153
187
|
KEY_SELF = "/keys/self"
|
|
188
|
+
KEY_SELF_ACTIVITY = "/keys/self/activity"
|
|
189
|
+
KEY_SELF_REQUESTS = "/keys/self/requests"
|
|
154
190
|
KEY_SELF_ROTATE = "/keys/self/rotate"
|
|
191
|
+
KEY_SELF_STATS = "/keys/self/stats"
|
|
155
192
|
KNOWLEDGE = "/knowledge"
|
|
156
193
|
KNOWLEDGE_CONNECTOR = "/knowledge/connectors/:id"
|
|
157
194
|
KNOWLEDGE_CONNECTORS = "/knowledge/connectors"
|
|
@@ -174,6 +211,7 @@ module OpenEmail
|
|
|
174
211
|
LABEL = "/labels/:id"
|
|
175
212
|
LABELS = "/labels"
|
|
176
213
|
LABEL_COLORS = "/labels/colors"
|
|
214
|
+
LABEL_TEST = "/labels/:id/test"
|
|
177
215
|
LANGUAGES = "/languages"
|
|
178
216
|
MAILBOX_EXPORT = "/exports/:id"
|
|
179
217
|
MAILBOX_EXPORTS = "/exports"
|
|
@@ -188,6 +226,7 @@ module OpenEmail
|
|
|
188
226
|
MEMBER_INVITATION = "/members/invitations/:invitationId"
|
|
189
227
|
MEMBER_INVITATIONS = "/members/invitations"
|
|
190
228
|
MEMBER_INVITATION_RESEND = "/members/invitations/:invitationId/resend"
|
|
229
|
+
OUT_OF_OFFICE = "/out-of-office"
|
|
191
230
|
PING = "/ping"
|
|
192
231
|
PROVIDER_IMPORT = "/provider-imports/:id"
|
|
193
232
|
PROVIDER_IMPORTS = "/provider-imports"
|
|
@@ -204,7 +243,13 @@ module OpenEmail
|
|
|
204
243
|
SECURITY_STEP_UP = "/security/step-up"
|
|
205
244
|
SECURITY_STEP_UP_VERIFY = "/security/step-up/verify"
|
|
206
245
|
SENDER = "/senders/:email"
|
|
246
|
+
SENDER_CATEGORIES = "/sender-categories"
|
|
247
|
+
SENDER_CATEGORY = "/sender-categories/:email"
|
|
207
248
|
SENDER_RESEARCH = "/senders/:email/research"
|
|
249
|
+
SENDING_DEDICATED_IP = "/sending/dedicated-ips/:ip"
|
|
250
|
+
SENDING_DEDICATED_IPS = "/sending/dedicated-ips"
|
|
251
|
+
SENDING_STREAMS = "/sending/streams"
|
|
252
|
+
SENDING_STREAM_RESUME = "/sending/streams/:stream/resume"
|
|
208
253
|
SETTINGS = "/settings"
|
|
209
254
|
SUBSCRIBE_FORM = "/subscribe/:formId"
|
|
210
255
|
SUBSCRIPTIONS = "/subscriptions"
|
|
@@ -245,6 +290,7 @@ module OpenEmail
|
|
|
245
290
|
THREADS_COUNTS = "/threads/counts"
|
|
246
291
|
THREAD_EVENT = "/threads/:id/event"
|
|
247
292
|
THREAD_MESSAGE_ATTACHMENTS = "/threads/:id/messages/:messageId/attachments"
|
|
293
|
+
THREAD_MUTE = "/threads/:id/mute"
|
|
248
294
|
THREAD_NOTE = "/threads/:id/notes/:noteId"
|
|
249
295
|
THREAD_NOTES = "/threads/:id/notes"
|
|
250
296
|
THREAD_NOTES_REORDER = "/threads/:id/notes/reorder"
|
|
@@ -253,8 +299,11 @@ module OpenEmail
|
|
|
253
299
|
THREAD_SNOOZE = "/threads/:id/snooze"
|
|
254
300
|
THREAD_SUMMARY = "/threads/:id/summary"
|
|
255
301
|
THREAD_TRASH = "/threads/:id/trash"
|
|
302
|
+
THREAD_UNMUTE = "/threads/:id/unmute"
|
|
256
303
|
THREAD_UNSNOOZE = "/threads/:id/unsnooze"
|
|
257
304
|
THREAD_UNSUBSCRIBE = "/threads/:id/unsubscribe"
|
|
305
|
+
TOOLS_ADDRESS = "/tools/address"
|
|
306
|
+
TOOLS_ADDRESSES = "/tools/addresses"
|
|
258
307
|
TOOLS_BIMI = "/tools/bimi"
|
|
259
308
|
TOOLS_COST = "/tools/cost"
|
|
260
309
|
TOOLS_DELIVERABILITY = "/tools/deliverability"
|
data/lib/openemail/client.rb
CHANGED
|
@@ -12,12 +12,15 @@ module OpenEmail
|
|
|
12
12
|
templates: Resources::Templates,
|
|
13
13
|
tracking: Resources::Tracking,
|
|
14
14
|
threads: Resources::Threads,
|
|
15
|
+
follow_ups: Resources::FollowUps,
|
|
15
16
|
drafts: Resources::Drafts,
|
|
16
17
|
labels: Resources::Labels,
|
|
17
18
|
contacts: Resources::Contacts,
|
|
18
19
|
audiences: Resources::Audiences,
|
|
19
20
|
billing: Resources::Billing,
|
|
20
21
|
forms: Resources::Forms,
|
|
22
|
+
automations: Resources::Automations,
|
|
23
|
+
events: Resources::Events,
|
|
21
24
|
broadcasts: Resources::Broadcasts,
|
|
22
25
|
domains: Resources::Domains,
|
|
23
26
|
app_host: Resources::AppHost,
|
|
@@ -28,9 +31,11 @@ module OpenEmail
|
|
|
28
31
|
provider_imports: Resources::ProviderImports,
|
|
29
32
|
calendar: Resources::Calendar,
|
|
30
33
|
settings: Resources::Settings,
|
|
34
|
+
out_of_office: Resources::OutOfOffice,
|
|
31
35
|
roles: Resources::Roles,
|
|
32
36
|
members: Resources::Members,
|
|
33
37
|
suppressions: Resources::Suppressions,
|
|
38
|
+
sending: Resources::Sending,
|
|
34
39
|
files: Resources::Files,
|
|
35
40
|
knowledge: Resources::Knowledge,
|
|
36
41
|
temp_mail: Resources::TempMail,
|
data/lib/openemail/constants.rb
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module OpenEmail
|
|
4
|
+
ADDRESS_CHECK_REASONS = {
|
|
5
|
+
INVALID_SYNTAX: "invalid_syntax",
|
|
6
|
+
DOMAIN_NOT_FOUND: "domain_not_found",
|
|
7
|
+
NO_MAIL_SERVER: "no_mail_server",
|
|
8
|
+
NULL_MX: "null_mx",
|
|
9
|
+
NO_MX_RECORD: "no_mx_record",
|
|
10
|
+
DNS_UNREACHABLE: "dns_unreachable",
|
|
11
|
+
DISPOSABLE: "disposable",
|
|
12
|
+
ROLE_ADDRESS: "role_address",
|
|
13
|
+
TYPO_SUSPECTED: "typo_suspected",
|
|
14
|
+
SUPPRESSED: "suppressed",
|
|
15
|
+
BOUNCED_BEFORE: "bounced_before",
|
|
16
|
+
MAILBOX_NOT_FOUND: "mailbox_not_found",
|
|
17
|
+
MAILBOX_UNCERTAIN: "mailbox_uncertain",
|
|
18
|
+
RANDOM_INPUT: "random_input"
|
|
19
|
+
}.freeze
|
|
20
|
+
|
|
21
|
+
ADDRESS_CHECK_RESULTS = {VALID: "valid", RISKY: "risky", INVALID: "invalid", UNKNOWN: "unknown"}.freeze
|
|
22
|
+
|
|
23
|
+
ADDRESS_CONFIDENCES = {HIGH: "high", MEDIUM: "medium", LOW: "low"}.freeze
|
|
24
|
+
|
|
4
25
|
ADDRESS_FORWARD_CONSENT_STATUSES = {
|
|
5
26
|
SENT: "sent",
|
|
6
27
|
ALREADY_CONFIRMED: "already-confirmed",
|
|
@@ -18,6 +39,17 @@ module OpenEmail
|
|
|
18
39
|
DIRECT: "direct"
|
|
19
40
|
}.freeze
|
|
20
41
|
|
|
42
|
+
ADDRESS_MX_STATUSES = {
|
|
43
|
+
FOUND: "found",
|
|
44
|
+
IMPLICIT: "implicit",
|
|
45
|
+
MISSING: "missing",
|
|
46
|
+
NULL_MX: "null_mx",
|
|
47
|
+
DOMAIN_NOT_FOUND: "domain_not_found",
|
|
48
|
+
UNKNOWN: "unknown"
|
|
49
|
+
}.freeze
|
|
50
|
+
|
|
51
|
+
ADD_ONS = {DEDICATED_IP: "dedicated-ip"}.freeze
|
|
52
|
+
|
|
21
53
|
API_SCOPES = {
|
|
22
54
|
EMAILS_SEND: "emails:send",
|
|
23
55
|
EMAILS_READ: "emails:read",
|
|
@@ -69,6 +101,96 @@ module OpenEmail
|
|
|
69
101
|
|
|
70
102
|
AUDIENCE_MEMBER_STATUSES = {SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed"}.freeze
|
|
71
103
|
|
|
104
|
+
AUTOMATION_CONDITION_KINDS = {
|
|
105
|
+
EMAIL_OPENED: "email_opened",
|
|
106
|
+
EMAIL_CLICKED: "email_clicked",
|
|
107
|
+
IN_AUDIENCE: "in_audience",
|
|
108
|
+
FIELD: "field",
|
|
109
|
+
EVENT: "event"
|
|
110
|
+
}.freeze
|
|
111
|
+
|
|
112
|
+
AUTOMATION_DATE_FIELDS = {BIRTHDAY: "birthday", JOINED: "joined"}.freeze
|
|
113
|
+
|
|
114
|
+
AUTOMATION_DURATION_UNITS = {MINUTES: "minutes", HOURS: "hours", DAYS: "days", WEEKS: "weeks"}.freeze
|
|
115
|
+
|
|
116
|
+
AUTOMATION_ENROLLMENT_SOURCES = {TRIGGER: "trigger", MANUAL: "manual", API: "api"}.freeze
|
|
117
|
+
|
|
118
|
+
AUTOMATION_ENROLLMENT_STATUSES = {ACTIVE: "active", COMPLETED: "completed", EXITED: "exited"}.freeze
|
|
119
|
+
|
|
120
|
+
AUTOMATION_EXIT_REASONS = {
|
|
121
|
+
COMPLETED: "completed",
|
|
122
|
+
EXIT_STEP: "exit_step",
|
|
123
|
+
UNSUBSCRIBED: "unsubscribed",
|
|
124
|
+
SUPPRESSED: "suppressed",
|
|
125
|
+
LEFT_AUDIENCE: "left_audience",
|
|
126
|
+
REMOVED: "removed",
|
|
127
|
+
ARCHIVED: "archived",
|
|
128
|
+
FAILED: "failed"
|
|
129
|
+
}.freeze
|
|
130
|
+
|
|
131
|
+
AUTOMATION_FIELD_OPERATORS = {
|
|
132
|
+
EQUALS: "equals",
|
|
133
|
+
NOT_EQUALS: "not_equals",
|
|
134
|
+
CONTAINS: "contains",
|
|
135
|
+
NOT_CONTAINS: "not_contains",
|
|
136
|
+
STARTS_WITH: "starts_with",
|
|
137
|
+
ENDS_WITH: "ends_with",
|
|
138
|
+
IS_SET: "is_set",
|
|
139
|
+
IS_NOT_SET: "is_not_set",
|
|
140
|
+
GREATER_THAN: "greater_than",
|
|
141
|
+
LESS_THAN: "less_than"
|
|
142
|
+
}.freeze
|
|
143
|
+
|
|
144
|
+
AUTOMATION_HOLD_REASONS = {WINDOW: "window", QUOTA: "quota", LANE: "lane", RETRY: "retry"}.freeze
|
|
145
|
+
|
|
146
|
+
AUTOMATION_PAUSE_REASONS = {
|
|
147
|
+
MANUAL: "manual",
|
|
148
|
+
SENDER_REFUSED: "sender_refused",
|
|
149
|
+
KEY_REVOKED: "key_revoked",
|
|
150
|
+
TEMPLATE_UNAVAILABLE: "template_unavailable",
|
|
151
|
+
AUDIENCE_MISSING: "audience_missing",
|
|
152
|
+
PLAN_LIMIT: "plan_limit"
|
|
153
|
+
}.freeze
|
|
154
|
+
|
|
155
|
+
AUTOMATION_RUN_OUTCOMES = {
|
|
156
|
+
SENT: "sent",
|
|
157
|
+
SKIPPED: "skipped",
|
|
158
|
+
WAITED: "waited",
|
|
159
|
+
YES: "yes",
|
|
160
|
+
NO: "no",
|
|
161
|
+
ADDED: "added",
|
|
162
|
+
REMOVED: "removed",
|
|
163
|
+
UPDATED: "updated",
|
|
164
|
+
CALLED: "called",
|
|
165
|
+
EXITED: "exited",
|
|
166
|
+
FAILED: "failed"
|
|
167
|
+
}.freeze
|
|
168
|
+
|
|
169
|
+
AUTOMATION_STATUSES = {DRAFT: "draft", LIVE: "live", PAUSED: "paused", ARCHIVED: "archived"}.freeze
|
|
170
|
+
|
|
171
|
+
AUTOMATION_STEP_KINDS = {
|
|
172
|
+
SEND_EMAIL: "send_email",
|
|
173
|
+
WAIT: "wait",
|
|
174
|
+
BRANCH: "branch",
|
|
175
|
+
ADD_TO_AUDIENCE: "add_to_audience",
|
|
176
|
+
REMOVE_FROM_AUDIENCE: "remove_from_audience",
|
|
177
|
+
UPDATE_FIELD: "update_field",
|
|
178
|
+
WEBHOOK: "webhook",
|
|
179
|
+
EXIT: "exit"
|
|
180
|
+
}.freeze
|
|
181
|
+
|
|
182
|
+
AUTOMATION_TRIGGER_KINDS = {
|
|
183
|
+
AUDIENCE_JOINED: "audience_joined",
|
|
184
|
+
FORM_SUBMITTED: "form_submitted",
|
|
185
|
+
EVENT: "event",
|
|
186
|
+
DATE: "date",
|
|
187
|
+
MANUAL: "manual"
|
|
188
|
+
}.freeze
|
|
189
|
+
|
|
190
|
+
AUTOMATION_VALUE_SOURCES = {STATIC: "static", CONTACT: "contact", EVENT: "event"}.freeze
|
|
191
|
+
|
|
192
|
+
AUTOMATION_WAIT_MODES = {DURATION: "duration", UNTIL: "until", EVENT: "event"}.freeze
|
|
193
|
+
|
|
72
194
|
BILLING_ALERT_KINDS = {
|
|
73
195
|
PAYMENT_FAILED: "payment_failed",
|
|
74
196
|
PAY_AS_YOU_GO_PAUSED: "pay_as_you_go_paused",
|
|
@@ -245,6 +367,10 @@ module OpenEmail
|
|
|
245
367
|
|
|
246
368
|
CREDENTIAL_KINDS = {API_KEY: "apiKey", OAUTH: "oauth"}.freeze
|
|
247
369
|
|
|
370
|
+
DEDICATED_IP_INELIGIBLE_REASONS = {PLAN: "plan", VOLUME: "volume"}.freeze
|
|
371
|
+
|
|
372
|
+
DEDICATED_IP_STATUSES = {AVAILABLE: "available", WARMING: "warming", READY: "ready", RELEASED: "released"}.freeze
|
|
373
|
+
|
|
248
374
|
DELIVERABILITY_CHECK_IDS = {MX: "mx", SPF: "spf", DKIM: "dkim", DMARC: "dmarc", BIMI: "bimi"}.freeze
|
|
249
375
|
|
|
250
376
|
DELIVERABILITY_CHECK_STATUSES = {PASS: "pass", WARN: "warn", FAIL: "fail", ABSENT: "absent"}.freeze
|
|
@@ -337,11 +463,23 @@ module OpenEmail
|
|
|
337
463
|
|
|
338
464
|
FILE_VISIBILITIES = {PUBLIC: "public", PRIVATE: "private"}.freeze
|
|
339
465
|
|
|
466
|
+
FOLLOW_UP_STATUSES = {WAITING: "waiting", ANSWERED: "answered", DUE: "due", CANCELLED: "cancelled"}.freeze
|
|
467
|
+
|
|
340
468
|
FORM_ALIGNS = {LEFT: "left", CENTER: "center"}.freeze
|
|
341
469
|
|
|
342
470
|
FORM_CONFIRM_SOURCES = {LINK: "link", APPROVAL: "approval"}.freeze
|
|
343
471
|
|
|
344
|
-
FORM_CONTACT_FIELDS = {
|
|
472
|
+
FORM_CONTACT_FIELDS = {
|
|
473
|
+
EMAIL: "email",
|
|
474
|
+
FIRST_NAME: "firstName",
|
|
475
|
+
LAST_NAME: "lastName",
|
|
476
|
+
NAME: "name",
|
|
477
|
+
PHONE: "phone",
|
|
478
|
+
COMPANY: "company",
|
|
479
|
+
JOB_TITLE: "jobTitle",
|
|
480
|
+
WEBSITE: "website",
|
|
481
|
+
BIRTHDAY: "birthday"
|
|
482
|
+
}.freeze
|
|
345
483
|
|
|
346
484
|
FORM_FIELD_ERRORS = {
|
|
347
485
|
REQUIRED: "required",
|
|
@@ -412,7 +550,64 @@ module OpenEmail
|
|
|
412
550
|
THUNDERBIRD: "thunderbird",
|
|
413
551
|
PROTON: "proton",
|
|
414
552
|
MBOX: "mbox",
|
|
415
|
-
EML: "eml"
|
|
553
|
+
EML: "eml",
|
|
554
|
+
IMAP: "imap",
|
|
555
|
+
MICROSOFT: "microsoft"
|
|
556
|
+
}.freeze
|
|
557
|
+
|
|
558
|
+
IMPORT_PAUSE_REASONS = {
|
|
559
|
+
THROTTLED: "throttled",
|
|
560
|
+
DAILY_LIMIT: "daily-limit",
|
|
561
|
+
UNREACHABLE: "unreachable",
|
|
562
|
+
SIGN_IN: "sign-in"
|
|
563
|
+
}.freeze
|
|
564
|
+
|
|
565
|
+
IMPORT_STATUSES = {
|
|
566
|
+
UPLOADING: "uploading",
|
|
567
|
+
QUEUED: "queued",
|
|
568
|
+
RUNNING: "running",
|
|
569
|
+
PARKED: "parked",
|
|
570
|
+
NEEDS_PASSWORD: "needs-password",
|
|
571
|
+
COMPLETED: "completed",
|
|
572
|
+
FAILED: "failed",
|
|
573
|
+
CANCELLED: "cancelled"
|
|
574
|
+
}.freeze
|
|
575
|
+
|
|
576
|
+
INBOX_CATEGORIES = {
|
|
577
|
+
PRIMARY: "primary",
|
|
578
|
+
PROMOTIONS: "promotions",
|
|
579
|
+
UPDATES: "updates",
|
|
580
|
+
SOCIAL: "social",
|
|
581
|
+
FORUMS: "forums"
|
|
582
|
+
}.freeze
|
|
583
|
+
|
|
584
|
+
ITEM_IMPORT_KINDS = {CALENDAR: "calendar", CONTACTS: "contacts"}.freeze
|
|
585
|
+
|
|
586
|
+
ITEM_IMPORT_SKIP_REASONS = {
|
|
587
|
+
UID_TAKEN: "uid-taken",
|
|
588
|
+
NO_START: "no-start",
|
|
589
|
+
DUPLICATE: "duplicate",
|
|
590
|
+
LIMIT: "limit",
|
|
591
|
+
INVALID: "invalid",
|
|
592
|
+
EMPTY: "empty"
|
|
593
|
+
}.freeze
|
|
594
|
+
|
|
595
|
+
ITEM_IMPORT_SOURCES = {
|
|
596
|
+
FILE: "file",
|
|
597
|
+
TAKEOUT: "takeout",
|
|
598
|
+
CALDAV: "caldav",
|
|
599
|
+
CARDDAV: "carddav",
|
|
600
|
+
MICROSOFT: "microsoft"
|
|
601
|
+
}.freeze
|
|
602
|
+
|
|
603
|
+
ITEM_IMPORT_STATUSES = {
|
|
604
|
+
UPLOADING: "uploading",
|
|
605
|
+
QUEUED: "queued",
|
|
606
|
+
RUNNING: "running",
|
|
607
|
+
COMPLETED: "completed",
|
|
608
|
+
FAILED: "failed",
|
|
609
|
+
CANCELLED: "cancelled",
|
|
610
|
+
UNDONE: "undone"
|
|
416
611
|
}.freeze
|
|
417
612
|
|
|
418
613
|
KNOWLEDGE_CONNECTOR_KINDS = {SITE: "site", SITEMAP: "sitemap", FEED: "feed", ZENDESK: "zendesk"}.freeze
|
|
@@ -736,9 +931,41 @@ module OpenEmail
|
|
|
736
931
|
|
|
737
932
|
LOGIN_LOGOS = {DARK: "dark", LIGHT: "light"}.freeze
|
|
738
933
|
|
|
934
|
+
MAILBOX_FOLDER_ROLES = {
|
|
935
|
+
INBOX: "inbox",
|
|
936
|
+
SENT: "sent",
|
|
937
|
+
DRAFTS: "drafts",
|
|
938
|
+
SPAM: "spam",
|
|
939
|
+
TRASH: "trash",
|
|
940
|
+
ARCHIVE: "archive",
|
|
941
|
+
ALL: "all",
|
|
942
|
+
FLAGGED: "flagged",
|
|
943
|
+
IMPORTANT: "important",
|
|
944
|
+
FOLDER: "folder"
|
|
945
|
+
}.freeze
|
|
946
|
+
|
|
947
|
+
MAILBOX_IMPORT_SOURCES = {FILE: "file", IMAP: "imap", MICROSOFT: "microsoft"}.freeze
|
|
948
|
+
|
|
949
|
+
MAILBOX_PROVIDERS = {
|
|
950
|
+
GMAIL: "gmail",
|
|
951
|
+
OUTLOOK: "outlook",
|
|
952
|
+
YAHOO: "yahoo",
|
|
953
|
+
AOL: "aol",
|
|
954
|
+
ICLOUD: "icloud",
|
|
955
|
+
FASTMAIL: "fastmail",
|
|
956
|
+
ZOHO: "zoho",
|
|
957
|
+
OTHER: "other"
|
|
958
|
+
}.freeze
|
|
959
|
+
|
|
960
|
+
MAILBOX_SECURITIES = {TLS: "tls", STARTTLS: "starttls"}.freeze
|
|
961
|
+
|
|
962
|
+
MAILBOX_SETTINGS_SOURCES = {PRESET: "preset", MX: "mx", AUTOCONFIG: "autoconfig", SRV: "srv", GIVEN: "given"}.freeze
|
|
963
|
+
|
|
964
|
+
MAILBOX_SIGN_INS = {APP_PASSWORD: "app-password", PASSWORD: "password", MICROSOFT: "microsoft"}.freeze
|
|
965
|
+
|
|
739
966
|
MAIL_APP_PROTOCOLS = {IMAP: "imap", SMTP: "smtp", POP3: "pop3", CALDAV: "caldav", CARDDAV: "carddav"}.freeze
|
|
740
967
|
|
|
741
|
-
MAIL_APP_SECURITIES = {SSL_TLS: "ssl-tls"}.freeze
|
|
968
|
+
MAIL_APP_SECURITIES = {SSL_TLS: "ssl-tls", STARTTLS: "starttls"}.freeze
|
|
742
969
|
|
|
743
970
|
MAIL_SERVICES = {
|
|
744
971
|
OPENEMAIL: "openemail",
|
|
@@ -869,6 +1096,21 @@ module OpenEmail
|
|
|
869
1096
|
LT: "lt"
|
|
870
1097
|
}.freeze
|
|
871
1098
|
|
|
1099
|
+
SENDING_POOL_STATUSES = {
|
|
1100
|
+
PENDING: "pending",
|
|
1101
|
+
WARMING: "warming",
|
|
1102
|
+
ACTIVE: "active",
|
|
1103
|
+
RELEASING: "releasing",
|
|
1104
|
+
RELEASED: "released",
|
|
1105
|
+
FAILED: "failed"
|
|
1106
|
+
}.freeze
|
|
1107
|
+
|
|
1108
|
+
SENDING_STREAM_PAUSE_REASONS = {BOUNCE_RATE: "bounce_rate", COMPLAINT_RATE: "complaint_rate"}.freeze
|
|
1109
|
+
|
|
1110
|
+
SENDING_STREAM_STATUSES = {ACTIVE: "active", PAUSED: "paused"}.freeze
|
|
1111
|
+
|
|
1112
|
+
SEND_STREAMS = {TRANSACTIONAL: "transactional", BROADCAST: "broadcast"}.freeze
|
|
1113
|
+
|
|
872
1114
|
SETTINGS_COLOR_THEMES = {LIGHT: "light", DARK: "dark", SYSTEM: "system"}.freeze
|
|
873
1115
|
|
|
874
1116
|
SETTINGS_DATE_FORMATS = {DMY: "dmy", MDY: "mdy", YMD: "ymd"}.freeze
|
|
@@ -958,7 +1200,11 @@ module OpenEmail
|
|
|
958
1200
|
FILE_UPLOADED: "file.uploaded",
|
|
959
1201
|
FILE_DELETED: "file.deleted",
|
|
960
1202
|
FORM_SUBMITTED: "form.submitted",
|
|
961
|
-
FORM_CONFIRMED: "form.confirmed"
|
|
1203
|
+
FORM_CONFIRMED: "form.confirmed",
|
|
1204
|
+
AUTOMATION_ENTERED: "automation.entered",
|
|
1205
|
+
AUTOMATION_EXITED: "automation.exited",
|
|
1206
|
+
AUTOMATION_PAUSED: "automation.paused",
|
|
1207
|
+
AUTOMATION_WEBHOOK: "automation.webhook"
|
|
962
1208
|
}.freeze
|
|
963
1209
|
|
|
964
1210
|
WEBHOOK_REPLAY_ERROR_CODES = {
|
data/lib/openemail/protocol.rb
CHANGED
|
@@ -11,6 +11,7 @@ module OpenEmail
|
|
|
11
11
|
CONTENT_TYPES = {
|
|
12
12
|
JSON: "application/json",
|
|
13
13
|
CALENDAR: "text/calendar",
|
|
14
|
+
VCARD: "text/vcard",
|
|
14
15
|
OCTET_STREAM: "application/octet-stream"
|
|
15
16
|
}.freeze
|
|
16
17
|
|
|
@@ -154,7 +155,12 @@ module OpenEmail
|
|
|
154
155
|
DOMAINS: "domains",
|
|
155
156
|
PEOPLE: "people",
|
|
156
157
|
AI_ACTIONS: "aiActions",
|
|
157
|
-
INTERVAL: "interval"
|
|
158
|
+
INTERVAL: "interval",
|
|
159
|
+
CATEGORY: "category",
|
|
160
|
+
DEEP: "deep",
|
|
161
|
+
PATH: "path",
|
|
162
|
+
STEP_KEY: "stepKey",
|
|
163
|
+
NAME: "name"
|
|
158
164
|
}.freeze
|
|
159
165
|
|
|
160
166
|
RETRY = {
|
data/lib/openemail/resource.rb
CHANGED
|
@@ -43,6 +43,15 @@ module OpenEmail
|
|
|
43
43
|
Wire.instant(value)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
def log_window_query(since, until_value)
|
|
47
|
+
query_params(since: instant(since), until: instant(until_value))
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def log_request_query(since, until_value, failed_only, statuses, path)
|
|
51
|
+
status = (statuses.nil? || statuses.empty?) ? nil : joined(statuses)
|
|
52
|
+
log_window_query(since, until_value).merge(query_params(failed_only: flag(failed_only), status:, path:))
|
|
53
|
+
end
|
|
54
|
+
|
|
46
55
|
def fetch_page(path, query = nil, style: CURSOR, limit: nil, cursor: nil, api_key: nil)
|
|
47
56
|
Pagination.fetch_page(@transport, path, query:, style:, limit:, cursor:, api_key:)
|
|
48
57
|
end
|
|
@@ -74,6 +83,10 @@ module OpenEmail
|
|
|
74
83
|
name
|
|
75
84
|
end
|
|
76
85
|
|
|
86
|
+
def optional_upload_name(data, filename)
|
|
87
|
+
filename.nil? ? RawBody.file_name(data) : filename
|
|
88
|
+
end
|
|
89
|
+
|
|
77
90
|
def upload_timeout(timeout)
|
|
78
91
|
return timeout unless timeout.nil?
|
|
79
92
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenEmail
|
|
4
|
+
module Resources
|
|
5
|
+
class Automations < Resource
|
|
6
|
+
def list(status: nil, limit: nil, cursor: nil, api_key: nil)
|
|
7
|
+
fetch_page(ApiPaths::AUTOMATIONS, query_params(status:), limit:, cursor:, api_key:)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def list_all(status: nil, limit: nil, cursor: nil, api_key: nil)
|
|
11
|
+
collect_all(ApiPaths::AUTOMATIONS, query_params(status:), limit:, cursor:, api_key:)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def iterate(status: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
15
|
+
iterate_pages(ApiPaths::AUTOMATIONS, query_params(status:), limit:, cursor:, api_key:, &)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create(body = nil, api_key: nil, **fields)
|
|
19
|
+
request(ApiPaths::AUTOMATIONS, method: :post, body: payload(body, fields), api_key:)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def list_starters(api_key: nil)
|
|
23
|
+
fetch_list(ApiPaths::AUTOMATION_STARTERS, api_key:)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get(id, api_key: nil)
|
|
27
|
+
request(fill(ApiPaths::AUTOMATION, id:), api_key:)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def update(id, patch = nil, api_key: nil, **fields)
|
|
31
|
+
request(fill(ApiPaths::AUTOMATION, id:), method: :patch, body: payload(patch, fields), repeatable: true,
|
|
32
|
+
api_key:)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def delete(id, api_key: nil)
|
|
36
|
+
request(fill(ApiPaths::AUTOMATION, id:), method: :delete, api_key:)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def publish(id, api_key: nil)
|
|
40
|
+
request(fill(ApiPaths::AUTOMATION_PUBLISH, id:), method: :post, repeatable: true, api_key:)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def pause(id, api_key: nil)
|
|
44
|
+
request(fill(ApiPaths::AUTOMATION_PAUSE, id:), method: :post, repeatable: true, api_key:)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def resume(id, api_key: nil)
|
|
48
|
+
request(fill(ApiPaths::AUTOMATION_RESUME, id:), method: :post, repeatable: true, api_key:)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def archive(id, api_key: nil)
|
|
52
|
+
request(fill(ApiPaths::AUTOMATION_ARCHIVE, id:), method: :post, repeatable: true, api_key:)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def duplicate(id, api_key: nil)
|
|
56
|
+
request(fill(ApiPaths::AUTOMATION_DUPLICATE, id:), method: :post, api_key:)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def send_test(id, body = nil, api_key: nil, **fields)
|
|
60
|
+
request(fill(ApiPaths::AUTOMATION_TEST, id:), method: :post, body: payload(body, fields), api_key:)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def list_versions(id, api_key: nil)
|
|
64
|
+
fetch_list(fill(ApiPaths::AUTOMATION_VERSIONS, id:), api_key:)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def restore_version(id, version, api_key: nil)
|
|
68
|
+
request(fill(ApiPaths::AUTOMATION_VERSION_RESTORE, id:, version:), method: :post, repeatable: true, api_key:)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def stats(id, since: nil, until: nil, api_key: nil)
|
|
72
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
73
|
+
request(fill(ApiPaths::AUTOMATION_STATS, id:), query:, api_key:)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def list_enrollments(id, status: nil, step_key: nil, q: nil, limit: nil, cursor: nil, api_key: nil)
|
|
77
|
+
fetch_page(fill(ApiPaths::AUTOMATION_ENROLLMENTS, id:), query_params(status:, step_key:, q:), limit:, cursor:,
|
|
78
|
+
api_key:)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def list_all_enrollments(id, status: nil, step_key: nil, q: nil, limit: nil, cursor: nil, api_key: nil)
|
|
82
|
+
collect_all(fill(ApiPaths::AUTOMATION_ENROLLMENTS, id:), query_params(status:, step_key:, q:), limit:, cursor:,
|
|
83
|
+
api_key:)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def iterate_enrollments(id, status: nil, step_key: nil, q: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
87
|
+
iterate_pages(fill(ApiPaths::AUTOMATION_ENROLLMENTS, id:), query_params(status:, step_key:, q:), limit:,
|
|
88
|
+
cursor:, api_key:, &)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def get_enrollment(id, enrollment_id, api_key: nil)
|
|
92
|
+
request(fill(ApiPaths::AUTOMATION_ENROLLMENT, id:, enrollmentId: enrollment_id), api_key:)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def enroll(id, body = nil, api_key: nil, **fields)
|
|
96
|
+
request(fill(ApiPaths::AUTOMATION_ENROLLMENTS, id:), method: :post, body: payload(body, fields), api_key:)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def exit_enrollment(id, enrollment_id, api_key: nil)
|
|
100
|
+
request(fill(ApiPaths::AUTOMATION_ENROLLMENT_EXIT, id:, enrollmentId: enrollment_id), method: :post, api_key:)
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -43,6 +43,18 @@ module OpenEmail
|
|
|
43
43
|
request(ApiPaths::BILLING_CHECKOUT, method: :post, body: payload(body, fields), api_key:)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
def list_add_ons(api_key: nil)
|
|
47
|
+
request(ApiPaths::BILLING_ADD_ONS, api_key:)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def start_add_on_checkout(body = nil, api_key: nil, **fields)
|
|
51
|
+
request(ApiPaths::BILLING_ADD_ON_CHECKOUT, method: :post, body: payload(body, fields), api_key:)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def cancel_add_on(add_on, api_key: nil)
|
|
55
|
+
request(fill(ApiPaths::BILLING_ADD_ON, addOn: add_on), method: :delete, api_key:)
|
|
56
|
+
end
|
|
57
|
+
|
|
46
58
|
def open_portal(body = nil, api_key: nil, **fields)
|
|
47
59
|
request(ApiPaths::BILLING_PORTAL, method: :post, body: payload(body, fields), api_key:)
|
|
48
60
|
end
|
|
@@ -83,6 +83,31 @@ module OpenEmail
|
|
|
83
83
|
request(fill(ApiPaths::CALENDAR_SUBSCRIPTION, id:), method: :delete, api_key:)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
def import_ics(data, filename: nil, api_key: nil)
|
|
87
|
+
request(ApiPaths::CALENDAR_IMPORTS, method: :post, query: query_params(filename: optional_upload_name(data, filename)),
|
|
88
|
+
raw: data, content_type: Protocol::CONTENT_TYPES[:CALENDAR], api_key:)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def list_imports(limit: nil, cursor: nil, api_key: nil)
|
|
92
|
+
fetch_page(ApiPaths::CALENDAR_IMPORTS, limit:, cursor:, api_key:)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def list_all_imports(limit: nil, cursor: nil, api_key: nil)
|
|
96
|
+
collect_all(ApiPaths::CALENDAR_IMPORTS, limit:, cursor:, api_key:)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def iterate_imports(limit: nil, cursor: nil, api_key: nil, &)
|
|
100
|
+
iterate_pages(ApiPaths::CALENDAR_IMPORTS, limit:, cursor:, api_key:, &)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def get_import(id, api_key: nil)
|
|
104
|
+
request(fill(ApiPaths::CALENDAR_IMPORT, id:), api_key:)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def undo_import(id, api_key: nil)
|
|
108
|
+
request(fill(ApiPaths::CALENDAR_IMPORT_UNDO, id:), method: :post, api_key:)
|
|
109
|
+
end
|
|
110
|
+
|
|
86
111
|
private
|
|
87
112
|
|
|
88
113
|
def range_query(from, to, timezone)
|
|
@@ -96,6 +96,18 @@ module OpenEmail
|
|
|
96
96
|
iterate_pages(fill(ApiPaths::CONTACT_THREADS, email:), query_params(q:, sort:), limit:, cursor:, api_key:, &)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
+
def list_events(email, name: nil, limit: nil, cursor: nil, api_key: nil)
|
|
100
|
+
fetch_page(fill(ApiPaths::CONTACT_EVENTS, email:), query_params(name:), limit:, cursor:, api_key:)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def list_all_events(email, name: nil, limit: nil, cursor: nil, api_key: nil)
|
|
104
|
+
collect_all(fill(ApiPaths::CONTACT_EVENTS, email:), query_params(name:), limit:, cursor:, api_key:)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def iterate_events(email, name: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
108
|
+
iterate_pages(fill(ApiPaths::CONTACT_EVENTS, email:), query_params(name:), limit:, cursor:, api_key:, &)
|
|
109
|
+
end
|
|
110
|
+
|
|
99
111
|
def activity(email, minutes: nil, grain: nil, offset_minutes: nil, api_key: nil)
|
|
100
112
|
request(fill(ApiPaths::CONTACT_ACTIVITY, email:), query: query_params(minutes:, grain:, offset_minutes:),
|
|
101
113
|
api_key:)
|
|
@@ -130,6 +142,31 @@ module OpenEmail
|
|
|
130
142
|
request(fill(ApiPaths::CONTACT_CARD, id:), method: :delete, api_key:)
|
|
131
143
|
end
|
|
132
144
|
|
|
145
|
+
def import_vcf(data, filename: nil, api_key: nil)
|
|
146
|
+
request(ApiPaths::CONTACT_IMPORTS, method: :post, query: query_params(filename: optional_upload_name(data, filename)),
|
|
147
|
+
raw: data, content_type: Protocol::CONTENT_TYPES[:VCARD], api_key:)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def list_imports(limit: nil, cursor: nil, api_key: nil)
|
|
151
|
+
fetch_page(ApiPaths::CONTACT_IMPORTS, limit:, cursor:, api_key:)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def list_all_imports(limit: nil, cursor: nil, api_key: nil)
|
|
155
|
+
collect_all(ApiPaths::CONTACT_IMPORTS, limit:, cursor:, api_key:)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def iterate_imports(limit: nil, cursor: nil, api_key: nil, &)
|
|
159
|
+
iterate_pages(ApiPaths::CONTACT_IMPORTS, limit:, cursor:, api_key:, &)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def get_import(id, api_key: nil)
|
|
163
|
+
request(fill(ApiPaths::CONTACT_IMPORT, id:), api_key:)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def undo_import(id, api_key: nil)
|
|
167
|
+
request(fill(ApiPaths::CONTACT_IMPORT_UNDO, id:), method: :post, api_key:)
|
|
168
|
+
end
|
|
169
|
+
|
|
133
170
|
private
|
|
134
171
|
|
|
135
172
|
def people_query(q, email, sort, blocked)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenEmail
|
|
4
|
+
module Resources
|
|
5
|
+
class Events < Resource
|
|
6
|
+
def send(body = nil, idempotency_key: nil, api_key: nil, **fields)
|
|
7
|
+
request(ApiPaths::EVENTS, method: :post, body: payload(body, fields), idempotent: true, idempotency_key:,
|
|
8
|
+
repeatable: true, api_key:)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def send_batch(events, idempotency_key: nil, api_key: nil)
|
|
12
|
+
wire = events.map { |event| payload(event, {}) }
|
|
13
|
+
request(ApiPaths::EVENTS_BATCH, method: :post, body: {"events" => wire}, idempotent: true, idempotency_key:,
|
|
14
|
+
repeatable: true, api_key:)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def list_names(api_key: nil)
|
|
18
|
+
fetch_list(ApiPaths::EVENT_NAMES, api_key:)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenEmail
|
|
4
|
+
module Resources
|
|
5
|
+
class FollowUps < Resource
|
|
6
|
+
def list(status: nil, thread_id: nil, limit: nil, api_key: nil)
|
|
7
|
+
fetch_list(ApiPaths::FOLLOW_UPS, query_params(status:, thread_id:, limit:), api_key:)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def set(body = nil, api_key: nil, **fields)
|
|
11
|
+
wire = payload(body, fields).slice("threadId", "remindAt")
|
|
12
|
+
wire["remindAt"] = instant(wire["remindAt"]) if wire.key?("remindAt")
|
|
13
|
+
request(ApiPaths::FOLLOW_UPS, method: :post, body: wire, repeatable: true, api_key:)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def cancel(id, api_key: nil)
|
|
17
|
+
request(fill(ApiPaths::FOLLOW_UP, id:), method: :delete, repeatable: true, api_key:)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -48,6 +48,22 @@ module OpenEmail
|
|
|
48
48
|
request(fill(ApiPaths::IMPORT_UPLOAD, id:), method: :delete, api_key:)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def discover_mailbox(email, api_key: nil)
|
|
52
|
+
request(ApiPaths::IMPORT_MAILBOX_SETTINGS, query: query_params(email:), api_key:)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def check_mailbox(body = nil, api_key: nil, **fields)
|
|
56
|
+
request(ApiPaths::IMPORT_MAILBOX_CHECK, method: :post, body: payload(body, fields), api_key:)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def connect_mailbox(body = nil, api_key: nil, **fields)
|
|
60
|
+
request(ApiPaths::IMPORT_MAILBOX, method: :post, body: payload(body, fields), api_key:)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def resume(id, body = nil, api_key: nil, **fields)
|
|
64
|
+
request(fill(ApiPaths::IMPORT_RESUME, id:), method: :post, body: payload(body, fields), api_key:)
|
|
65
|
+
end
|
|
66
|
+
|
|
51
67
|
def import_files(input = nil, api_key: nil, **fields, &on_progress)
|
|
52
68
|
spec = payload(input, fields)
|
|
53
69
|
files = Array(spec["files"]).map { |file| file.to_h.transform_keys(&:to_s) }
|
|
@@ -40,87 +40,86 @@ module OpenEmail
|
|
|
40
40
|
api_key:)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def list_requests(id, failed_only: nil,
|
|
44
|
-
|
|
43
|
+
def list_requests(id, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil,
|
|
44
|
+
cursor: nil, api_key: nil)
|
|
45
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
45
46
|
fetch_page(fill(ApiPaths::KEY_REQUESTS, id:), query, limit:, cursor:, api_key:)
|
|
46
47
|
end
|
|
47
48
|
|
|
48
|
-
def list_all_requests(id, failed_only: nil,
|
|
49
|
-
|
|
49
|
+
def list_all_requests(id, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil,
|
|
50
|
+
cursor: nil, api_key: nil)
|
|
51
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
50
52
|
collect_all(fill(ApiPaths::KEY_REQUESTS, id:), query, limit:, cursor:, api_key:)
|
|
51
53
|
end
|
|
52
54
|
|
|
53
|
-
def iterate_requests(id, failed_only: nil,
|
|
54
|
-
|
|
55
|
+
def iterate_requests(id, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil,
|
|
56
|
+
cursor: nil, api_key: nil, &)
|
|
57
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
55
58
|
iterate_pages(fill(ApiPaths::KEY_REQUESTS, id:), query, limit:, cursor:, api_key:, &)
|
|
56
59
|
end
|
|
57
60
|
|
|
58
61
|
def list_activity(id, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
59
|
-
query =
|
|
62
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
60
63
|
fetch_page(fill(ApiPaths::KEY_ACTIVITY, id:), query, limit:, cursor:, api_key:)
|
|
61
64
|
end
|
|
62
65
|
|
|
63
66
|
def list_all_activity(id, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
64
|
-
query =
|
|
67
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
65
68
|
collect_all(fill(ApiPaths::KEY_ACTIVITY, id:), query, limit:, cursor:, api_key:)
|
|
66
69
|
end
|
|
67
70
|
|
|
68
71
|
def iterate_activity(id, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
69
|
-
query =
|
|
72
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
70
73
|
iterate_pages(fill(ApiPaths::KEY_ACTIVITY, id:), query, limit:, cursor:, api_key:, &)
|
|
71
74
|
end
|
|
72
75
|
|
|
73
|
-
def list_workspace_requests(key_ids: nil, failed_only: nil,
|
|
74
|
-
api_key: nil)
|
|
75
|
-
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, key_ids)
|
|
76
|
+
def list_workspace_requests(key_ids: nil, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil,
|
|
77
|
+
limit: nil, cursor: nil, api_key: nil)
|
|
78
|
+
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path, key_ids)
|
|
76
79
|
fetch_page(ApiPaths::KEYS_REQUESTS, query, limit:, cursor:, api_key:)
|
|
77
80
|
end
|
|
78
81
|
|
|
79
|
-
def list_all_workspace_requests(key_ids: nil, failed_only: nil,
|
|
80
|
-
api_key: nil)
|
|
81
|
-
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, key_ids)
|
|
82
|
+
def list_all_workspace_requests(key_ids: nil, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil,
|
|
83
|
+
limit: nil, cursor: nil, api_key: nil)
|
|
84
|
+
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path, key_ids)
|
|
82
85
|
collect_all(ApiPaths::KEYS_REQUESTS, query, limit:, cursor:, api_key:)
|
|
83
86
|
end
|
|
84
87
|
|
|
85
|
-
def iterate_workspace_requests(key_ids: nil, failed_only: nil,
|
|
86
|
-
api_key: nil, &)
|
|
87
|
-
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, key_ids)
|
|
88
|
+
def iterate_workspace_requests(key_ids: nil, failed_only: nil, statuses: nil, path: nil, since: nil, until: nil,
|
|
89
|
+
limit: nil, cursor: nil, api_key: nil, &)
|
|
90
|
+
query = workspace_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path, key_ids)
|
|
88
91
|
iterate_pages(ApiPaths::KEYS_REQUESTS, query, limit:, cursor:, api_key:, &)
|
|
89
92
|
end
|
|
90
93
|
|
|
91
94
|
def list_workspace_activity(key_ids: nil, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
92
|
-
query =
|
|
95
|
+
query = workspace_activity_query(since, binding.local_variable_get(:until), key_ids)
|
|
93
96
|
fetch_page(ApiPaths::KEYS_ACTIVITY, query, limit:, cursor:, api_key:)
|
|
94
97
|
end
|
|
95
98
|
|
|
96
99
|
def list_all_workspace_activity(key_ids: nil, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
97
|
-
query =
|
|
100
|
+
query = workspace_activity_query(since, binding.local_variable_get(:until), key_ids)
|
|
98
101
|
collect_all(ApiPaths::KEYS_ACTIVITY, query, limit:, cursor:, api_key:)
|
|
99
102
|
end
|
|
100
103
|
|
|
101
104
|
def iterate_workspace_activity(key_ids: nil, since: nil, until: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
102
|
-
query =
|
|
105
|
+
query = workspace_activity_query(since, binding.local_variable_get(:until), key_ids)
|
|
103
106
|
iterate_pages(ApiPaths::KEYS_ACTIVITY, query, limit:, cursor:, api_key:, &)
|
|
104
107
|
end
|
|
105
108
|
|
|
106
109
|
def stats(key_ids: nil, since: nil, until: nil, grain: nil, offset_minutes: nil, api_key: nil)
|
|
107
|
-
query =
|
|
110
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
108
111
|
.merge(query_params(key_ids: joined(key_ids), grain:, offset_minutes:))
|
|
109
112
|
request(ApiPaths::KEYS_STATS, query:, api_key:)
|
|
110
113
|
end
|
|
111
114
|
|
|
112
115
|
private
|
|
113
116
|
|
|
114
|
-
def
|
|
115
|
-
|
|
117
|
+
def workspace_request_query(since, until_value, failed_only, statuses, path, key_ids)
|
|
118
|
+
log_request_query(since, until_value, failed_only, statuses, path).merge(query_params(key_ids: joined(key_ids)))
|
|
116
119
|
end
|
|
117
120
|
|
|
118
|
-
def
|
|
119
|
-
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
def workspace_request_query(since, until_value, failed_only, key_ids)
|
|
123
|
-
request_query(since, until_value, failed_only).merge(query_params(key_ids: joined(key_ids)))
|
|
121
|
+
def workspace_activity_query(since, until_value, key_ids)
|
|
122
|
+
log_window_query(since, until_value).merge(query_params(key_ids: joined(key_ids)))
|
|
124
123
|
end
|
|
125
124
|
end
|
|
126
125
|
end
|
|
@@ -31,6 +31,10 @@ module OpenEmail
|
|
|
31
31
|
request(fill(ApiPaths::LABEL, id:), method: :patch, body: payload(patch, fields), repeatable: true, api_key:)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def test(id, body = nil, api_key: nil, **fields)
|
|
35
|
+
request(fill(ApiPaths::LABEL_TEST, id:), method: :post, body: payload(body, fields), api_key:)
|
|
36
|
+
end
|
|
37
|
+
|
|
34
38
|
def delete(id, api_key: nil)
|
|
35
39
|
request(fill(ApiPaths::LABEL, id:), method: :delete, api_key:)
|
|
36
40
|
end
|
|
@@ -14,6 +14,44 @@ module OpenEmail
|
|
|
14
14
|
def rotate(api_key: nil)
|
|
15
15
|
request(ApiPaths::KEY_SELF_ROTATE, method: :post, api_key:)
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
def list_requests(failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil, cursor: nil,
|
|
19
|
+
api_key: nil)
|
|
20
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
21
|
+
fetch_page(ApiPaths::KEY_SELF_REQUESTS, query, limit:, cursor:, api_key:)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def list_all_requests(failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil, cursor: nil,
|
|
25
|
+
api_key: nil)
|
|
26
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
27
|
+
collect_all(ApiPaths::KEY_SELF_REQUESTS, query, limit:, cursor:, api_key:)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def iterate_requests(failed_only: nil, statuses: nil, path: nil, since: nil, until: nil, limit: nil, cursor: nil,
|
|
31
|
+
api_key: nil, &)
|
|
32
|
+
query = log_request_query(since, binding.local_variable_get(:until), failed_only, statuses, path)
|
|
33
|
+
iterate_pages(ApiPaths::KEY_SELF_REQUESTS, query, limit:, cursor:, api_key:, &)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def list_activity(since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
37
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
38
|
+
fetch_page(ApiPaths::KEY_SELF_ACTIVITY, query, limit:, cursor:, api_key:)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def list_all_activity(since: nil, until: nil, limit: nil, cursor: nil, api_key: nil)
|
|
42
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
43
|
+
collect_all(ApiPaths::KEY_SELF_ACTIVITY, query, limit:, cursor:, api_key:)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def iterate_activity(since: nil, until: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
47
|
+
query = log_window_query(since, binding.local_variable_get(:until))
|
|
48
|
+
iterate_pages(ApiPaths::KEY_SELF_ACTIVITY, query, limit:, cursor:, api_key:, &)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def stats(since: nil, until: nil, grain: nil, offset_minutes: nil, api_key: nil)
|
|
52
|
+
query = log_window_query(since, binding.local_variable_get(:until)).merge(query_params(grain:, offset_minutes:))
|
|
53
|
+
request(ApiPaths::KEY_SELF_STATS, query:, api_key:)
|
|
54
|
+
end
|
|
17
55
|
end
|
|
18
56
|
end
|
|
19
57
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenEmail
|
|
4
|
+
module Resources
|
|
5
|
+
class OutOfOffice < Resource
|
|
6
|
+
def list(address: nil, api_key: nil)
|
|
7
|
+
fetch_list(ApiPaths::OUT_OF_OFFICE, query_params(address:), api_key:)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def set(address, body = nil, api_key: nil, **fields)
|
|
11
|
+
request(ApiPaths::OUT_OF_OFFICE, method: :put, query: query_params(address:),
|
|
12
|
+
body: reply_wire(payload(body, fields)), repeatable: true, api_key:)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def clear(address, api_key: nil)
|
|
16
|
+
request(ApiPaths::OUT_OF_OFFICE, method: :delete, query: query_params(address:), repeatable: true, api_key:)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def reply_wire(wire)
|
|
22
|
+
wire["startsAt"] = instant(wire["startsAt"]) if wire.key?("startsAt")
|
|
23
|
+
wire["endsAt"] = instant(wire["endsAt"]) if wire.key?("endsAt")
|
|
24
|
+
wire
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenEmail
|
|
4
|
+
module Resources
|
|
5
|
+
class Sending < Resource
|
|
6
|
+
def list_streams(api_key: nil)
|
|
7
|
+
request(ApiPaths::SENDING_STREAMS, api_key:)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def resume_stream(stream, api_key: nil)
|
|
11
|
+
request(fill(ApiPaths::SENDING_STREAM_RESUME, stream:), method: :post, api_key:)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def list_dedicated_ips(api_key: nil)
|
|
15
|
+
request(ApiPaths::SENDING_DEDICATED_IPS, api_key:)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def get_dedicated_ip(ip, api_key: nil)
|
|
19
|
+
request(fill(ApiPaths::SENDING_DEDICATED_IP, ip:), api_key:)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -4,23 +4,23 @@ module OpenEmail
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Threads < Resource
|
|
6
6
|
def list(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil, from_contacts: nil,
|
|
7
|
-
semantic: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
|
|
7
|
+
semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
|
|
8
8
|
fetch_page(ApiPaths::THREADS,
|
|
9
|
-
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, address),
|
|
9
|
+
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
|
|
10
10
|
style: PAGE_TOKEN, limit:, cursor:, api_key:)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def list_all(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil,
|
|
14
|
-
from_contacts: nil, semantic: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
|
|
14
|
+
from_contacts: nil, semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil)
|
|
15
15
|
collect_all(ApiPaths::THREADS,
|
|
16
|
-
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, address),
|
|
16
|
+
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
|
|
17
17
|
style: PAGE_TOKEN, limit:, cursor:, api_key:)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def iterate(folder: nil, query: nil, label_ids: nil, sort: nil, date_from: nil, date_to: nil, from_contacts: nil,
|
|
21
|
-
semantic: nil, address: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
21
|
+
semantic: nil, category: nil, address: nil, limit: nil, cursor: nil, api_key: nil, &)
|
|
22
22
|
iterate_pages(ApiPaths::THREADS,
|
|
23
|
-
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, address),
|
|
23
|
+
list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address),
|
|
24
24
|
style: PAGE_TOKEN, limit:, cursor:, api_key:, &)
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -45,6 +45,14 @@ module OpenEmail
|
|
|
45
45
|
request(fill(ApiPaths::THREAD_UNSNOOZE, id:), method: :post, repeatable: true, api_key:)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
def mute(id, api_key: nil)
|
|
49
|
+
request(fill(ApiPaths::THREAD_MUTE, id:), method: :post, repeatable: true, api_key:)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def unmute(id, api_key: nil)
|
|
53
|
+
request(fill(ApiPaths::THREAD_UNMUTE, id:), method: :post, repeatable: true, api_key:)
|
|
54
|
+
end
|
|
55
|
+
|
|
48
56
|
def list_attachments(id, message_id, api_key: nil)
|
|
49
57
|
fetch_list(fill(ApiPaths::THREAD_MESSAGE_ATTACHMENTS, id:, messageId: message_id), api_key:)
|
|
50
58
|
end
|
|
@@ -100,11 +108,25 @@ module OpenEmail
|
|
|
100
108
|
request(fill(ApiPaths::THREAD_UNSUBSCRIBE, id:), method: :post, api_key:)
|
|
101
109
|
end
|
|
102
110
|
|
|
111
|
+
def list_sender_categories(api_key: nil)
|
|
112
|
+
fetch_list(ApiPaths::SENDER_CATEGORIES, api_key:)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def set_sender_category(email, category, api_key: nil)
|
|
116
|
+
request(fill(ApiPaths::SENDER_CATEGORY, email:), method: :put, body: {"category" => category},
|
|
117
|
+
repeatable: true, api_key:)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def clear_sender_category(email, api_key: nil)
|
|
121
|
+
request(fill(ApiPaths::SENDER_CATEGORY, email:), method: :delete, api_key:)
|
|
122
|
+
end
|
|
123
|
+
|
|
103
124
|
private
|
|
104
125
|
|
|
105
|
-
def list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, address)
|
|
126
|
+
def list_query(folder, query, label_ids, sort, date_from, date_to, from_contacts, semantic, category, address)
|
|
106
127
|
query_params(folder:, query:, label_ids: joined(label_ids), sort:, date_from: instant(date_from),
|
|
107
|
-
date_to: instant(date_to), from_contacts: flag(from_contacts), semantic: flag(semantic),
|
|
128
|
+
date_to: instant(date_to), from_contacts: flag(from_contacts), semantic: flag(semantic), category:,
|
|
129
|
+
address:)
|
|
108
130
|
end
|
|
109
131
|
end
|
|
110
132
|
end
|
|
@@ -19,6 +19,14 @@ module OpenEmail
|
|
|
19
19
|
request(ApiPaths::TOOLS_VERIFICATION_CODE, method: :post, body: payload(body, fields), api_key:)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def check_address(email, deep: nil, api_key: nil)
|
|
23
|
+
request(ApiPaths::TOOLS_ADDRESS, query: query_params(email:, deep: flag(deep)), api_key:)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def check_addresses(body = nil, api_key: nil, **fields)
|
|
27
|
+
request(ApiPaths::TOOLS_ADDRESSES, method: :post, body: payload(body, fields), api_key:)
|
|
28
|
+
end
|
|
29
|
+
|
|
22
30
|
def estimate_cost(sends: nil, domains: nil, people: nil, ai_actions: nil, interval: nil, api_key: nil)
|
|
23
31
|
request(ApiPaths::TOOLS_COST, query: query_params(sends:, domains:, people:, ai_actions:, interval:), api_key:)
|
|
24
32
|
end
|
data/lib/openemail/version.rb
CHANGED
data/lib/openemail/wire.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openemail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenEmail
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-10-
|
|
10
|
+
date: 2026-10-12 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: Send email and broadcasts, work with threads, drafts, labels, templates,
|
|
13
13
|
rules, webhooks, tracking, contacts, audiences, sign-up forms, domains, suppressions,
|
|
@@ -38,6 +38,7 @@ files:
|
|
|
38
38
|
- lib/openemail/resources/analytics.rb
|
|
39
39
|
- lib/openemail/resources/app_host.rb
|
|
40
40
|
- lib/openemail/resources/audiences.rb
|
|
41
|
+
- lib/openemail/resources/automations.rb
|
|
41
42
|
- lib/openemail/resources/billing.rb
|
|
42
43
|
- lib/openemail/resources/branding.rb
|
|
43
44
|
- lib/openemail/resources/broadcasts.rb
|
|
@@ -49,8 +50,10 @@ files:
|
|
|
49
50
|
- lib/openemail/resources/drafts.rb
|
|
50
51
|
- lib/openemail/resources/emails.rb
|
|
51
52
|
- lib/openemail/resources/encryption.rb
|
|
53
|
+
- lib/openemail/resources/events.rb
|
|
52
54
|
- lib/openemail/resources/exports.rb
|
|
53
55
|
- lib/openemail/resources/files.rb
|
|
56
|
+
- lib/openemail/resources/follow_ups.rb
|
|
54
57
|
- lib/openemail/resources/forms.rb
|
|
55
58
|
- lib/openemail/resources/imports.rb
|
|
56
59
|
- lib/openemail/resources/keys.rb
|
|
@@ -59,11 +62,13 @@ files:
|
|
|
59
62
|
- lib/openemail/resources/languages.rb
|
|
60
63
|
- lib/openemail/resources/me.rb
|
|
61
64
|
- lib/openemail/resources/members.rb
|
|
65
|
+
- lib/openemail/resources/out_of_office.rb
|
|
62
66
|
- lib/openemail/resources/provider_imports.rb
|
|
63
67
|
- lib/openemail/resources/roles.rb
|
|
64
68
|
- lib/openemail/resources/rules.rb
|
|
65
69
|
- lib/openemail/resources/security.rb
|
|
66
70
|
- lib/openemail/resources/senders.rb
|
|
71
|
+
- lib/openemail/resources/sending.rb
|
|
67
72
|
- lib/openemail/resources/settings.rb
|
|
68
73
|
- lib/openemail/resources/subscriptions.rb
|
|
69
74
|
- lib/openemail/resources/support.rb
|