ruby_api_pack_active_campaign 0.2.0
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 +7 -0
- data/.all-contributorsrc +23 -0
- data/.circleci/config.yml +44 -0
- data/.claude/settings.json +36 -0
- data/.claude/settings.local.json +36 -0
- data/.coderabbit.yaml +75 -0
- data/.codex/README.md +32 -0
- data/.codex/change-watch.md +17 -0
- data/.codex/release-readiness.md +30 -0
- data/.editorconfig +22 -0
- data/.rspec +3 -0
- data/.rubocop.yml +71 -0
- data/AGENTS.md +107 -0
- data/CHANGELOG.md +140 -0
- data/CLAUDE.md +91 -0
- data/CODEX.md +63 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/CONTRIBUTING.md +118 -0
- data/COPILOT.md +29 -0
- data/FUNDING.yml +1 -0
- data/JULES.md +33 -0
- data/MIT-LICENSE +21 -0
- data/README.md +270 -0
- data/ROADMAP.md +40 -0
- data/Rakefile +12 -0
- data/SECURITY.md +43 -0
- data/TODO.md +31 -0
- data/lib/ruby_api_pack_active_campaign/api/ac_contacts.rb +145 -0
- data/lib/ruby_api_pack_active_campaign/configuration.rb +12 -0
- data/lib/ruby_api_pack_active_campaign/connection/ac_connect.rb +15 -0
- data/lib/ruby_api_pack_active_campaign/version.rb +5 -0
- data/lib/ruby_api_pack_active_campaign.rb +15 -0
- data/ruby_api_pack_active_campaign.code-workspace +8 -0
- data/sig/ruby_api_pack_active_campaign.rbs +4 -0
- metadata +99 -0
data/README.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Ruby API Pack ActiveCampaign
|
|
2
|
+
|
|
3
|
+
## Repository Snapshot
|
|
4
|
+
|
|
5
|
+
| Field | Value |
|
|
6
|
+
|-------|-------|
|
|
7
|
+
| Project team | `project-ruby` |
|
|
8
|
+
| Repository role | ActiveCampaign API client |
|
|
9
|
+
| Package/artifact | `ruby_api_pack_active_campaign` |
|
|
10
|
+
| Current version/status | 0.2.0 |
|
|
11
|
+
|
|
12
|
+
## Standard Workflow
|
|
13
|
+
|
|
14
|
+
1. Read [AGENTS.md](AGENTS.md), then the agent-specific guide for the task.
|
|
15
|
+
2. Check [TODO.md](TODO.md) and [ROADMAP.md](ROADMAP.md) for current scope.
|
|
16
|
+
3. Make the smallest repo-local change that satisfies the task.
|
|
17
|
+
4. Run `bundle exec rspec`, `bundle exec rubocop`, and
|
|
18
|
+
`gem build ruby_api_pack_active_campaign.gemspec` when validation is
|
|
19
|
+
required or practical.
|
|
20
|
+
5. Update docs and changelog history only when behavior, public contracts, or
|
|
21
|
+
release-relevant metadata changed.
|
|
22
|
+
|
|
23
|
+
## Documentation Map
|
|
24
|
+
|
|
25
|
+
| Guide | Path |
|
|
26
|
+
|-------|------|
|
|
27
|
+
| Agent rules | [AGENTS.md](AGENTS.md) |
|
|
28
|
+
| Claude Code | [CLAUDE.md](CLAUDE.md) |
|
|
29
|
+
| Codex | [CODEX.md](CODEX.md) |
|
|
30
|
+
| Copilot | [COPILOT.md](COPILOT.md) |
|
|
31
|
+
| Jules | [JULES.md](JULES.md) |
|
|
32
|
+
| Roadmap | [ROADMAP.md](ROADMAP.md) |
|
|
33
|
+
| Todo | [TODO.md](TODO.md) |
|
|
34
|
+
| Changelog | [CHANGELOG.md](CHANGELOG.md) |
|
|
35
|
+
| Security | [SECURITY.md](SECURITY.md) |
|
|
36
|
+
| Code of Conduct | [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) |
|
|
37
|
+
| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |
|
|
38
|
+
|
|
39
|
+
[](https://rubygems.org/gems/ruby_api_pack_active_campaign)
|
|
40
|
+
[](https://circleci.com/gh/phcdevworks/ruby_api_pack_active_campaign)
|
|
41
|
+
[](https://codecov.io/gh/phcdevworks/ruby_api_pack_active_campaign)
|
|
42
|
+
[](MIT-LICENSE)
|
|
43
|
+
|
|
44
|
+
`ruby_api_pack_active_campaign` is a Ruby client gem for the ActiveCampaign API.
|
|
45
|
+
It centralizes ActiveCampaign configuration, HTTP connection handling, response
|
|
46
|
+
parsing, and contact-oriented API helpers so Ruby and Rails applications can
|
|
47
|
+
consume ActiveCampaign without duplicating low-level request code.
|
|
48
|
+
|
|
49
|
+
[Contributing](CONTRIBUTING.md) | [Code of Conduct](CODE_OF_CONDUCT.md) |
|
|
50
|
+
[Changelog](CHANGELOG.md) | [Roadmap](ROADMAP.md) |
|
|
51
|
+
[Security Policy](SECURITY.md) | [AI Guide](AGENTS.md)
|
|
52
|
+
|
|
53
|
+
## Source of Truth
|
|
54
|
+
|
|
55
|
+
The gem's public behavior is defined by its configuration object, connection
|
|
56
|
+
wrapper, contact API helpers, and specs. Keep those surfaces aligned whenever an
|
|
57
|
+
ActiveCampaign endpoint or request shape changes.
|
|
58
|
+
|
|
59
|
+
| Layer | Path | Rule |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| Gem entry point | `lib/ruby_api_pack_active_campaign.rb` | Loads configuration, connection, and API helper surfaces |
|
|
62
|
+
| Configuration | `lib/ruby_api_pack_active_campaign/configuration.rb` | Owns ActiveCampaign base URL and API token settings |
|
|
63
|
+
| Connection wrapper | `lib/ruby_api_pack_active_campaign/connection/ac_connect.rb` | Centralizes HTTParty requests, headers, JSON parsing, and API errors |
|
|
64
|
+
| Contact API helpers | `lib/ruby_api_pack_active_campaign/api/ac_contacts.rb` | Public contact, automation, import, activity, note, and related-resource helpers |
|
|
65
|
+
| Version | `lib/ruby_api_pack_active_campaign/version.rb` | Gem release version |
|
|
66
|
+
| Specs | `spec/` | Contract and regression coverage for configuration, connection, and API helpers |
|
|
67
|
+
|
|
68
|
+
After behavior changes, run:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bundle exec rspec
|
|
72
|
+
bundle exec rubocop
|
|
73
|
+
gem build ruby_api_pack_active_campaign.gemspec
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## What This Gem Owns
|
|
77
|
+
|
|
78
|
+
- ActiveCampaign API configuration through `RubyApiPackActiveCampaign.configure`
|
|
79
|
+
- HTTParty-based GET, POST, PUT, and DELETE request helpers
|
|
80
|
+
- ActiveCampaign contact helper methods under
|
|
81
|
+
`RubyApiPackActiveCampaign::Api::AcContacts`
|
|
82
|
+
- JSON response parsing and raised errors for unsuccessful API responses
|
|
83
|
+
- RSpec coverage for connection behavior and API helper delegation
|
|
84
|
+
|
|
85
|
+
## What This Gem Does Not Own
|
|
86
|
+
|
|
87
|
+
- ActiveCampaign account setup, billing, lists, automations, or dashboard
|
|
88
|
+
configuration
|
|
89
|
+
- Host application models, persistence, background jobs, or authorization
|
|
90
|
+
- User-facing Rails controllers or UI components
|
|
91
|
+
- Storage of production credentials or API tokens
|
|
92
|
+
- A complete wrapper for every ActiveCampaign endpoint
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
Add the gem to your application's Gemfile:
|
|
97
|
+
|
|
98
|
+
```ruby
|
|
99
|
+
gem "ruby_api_pack_active_campaign"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Install dependencies:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
bundle install
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Or install the gem directly:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
gem install ruby_api_pack_active_campaign
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Configuration
|
|
115
|
+
|
|
116
|
+
Configure the ActiveCampaign API URL and token before calling API helpers. In a
|
|
117
|
+
Rails application, this typically belongs in an initializer.
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
# config/initializers/ruby_api_pack_active_campaign.rb
|
|
121
|
+
RubyApiPackActiveCampaign.configure do |config|
|
|
122
|
+
config.ac_api_url = ENV.fetch("AC_API_URL")
|
|
123
|
+
config.ac_api_token = ENV.fetch("AC_API_TOKEN")
|
|
124
|
+
end
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`ac_api_url` should include the API version path, for example:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
https://youraccountname.api-us1.com/api/3
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Do not commit real ActiveCampaign API tokens. Use Rails credentials, encrypted
|
|
134
|
+
environment management, or your deployment platform's secret manager.
|
|
135
|
+
|
|
136
|
+
## Contact Usage
|
|
137
|
+
|
|
138
|
+
Require the gem and call contact helpers through
|
|
139
|
+
`RubyApiPackActiveCampaign::Api::AcContacts`.
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
require "ruby_api_pack_active_campaign"
|
|
143
|
+
|
|
144
|
+
RubyApiPackActiveCampaign.configure do |config|
|
|
145
|
+
config.ac_api_url = ENV.fetch("AC_API_URL")
|
|
146
|
+
config.ac_api_token = ENV.fetch("AC_API_TOKEN")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
contacts = RubyApiPackActiveCampaign::Api::AcContacts.contact_list
|
|
150
|
+
contact = RubyApiPackActiveCampaign::Api::AcContacts.contact_by_id(123)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Create or sync contacts by passing request bodies that match ActiveCampaign's
|
|
154
|
+
API contract:
|
|
155
|
+
|
|
156
|
+
```ruby
|
|
157
|
+
RubyApiPackActiveCampaign::Api::AcContacts.create_contact(
|
|
158
|
+
contact: {
|
|
159
|
+
email: "jane@example.com",
|
|
160
|
+
firstName: "Jane",
|
|
161
|
+
lastName: "Example"
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
RubyApiPackActiveCampaign::Api::AcContacts.sync_contact(
|
|
166
|
+
contact: {
|
|
167
|
+
email: "jane@example.com",
|
|
168
|
+
firstName: "Jane"
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Public API Helpers
|
|
174
|
+
|
|
175
|
+
The current public helper surface is contact-focused:
|
|
176
|
+
|
|
177
|
+
| Method | ActiveCampaign path |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `contact_list` | `GET /contacts` |
|
|
180
|
+
| `contact_by_id(contact_id)` | `GET /contacts/:contact_id` |
|
|
181
|
+
| `create_contact(contact_params)` | `POST /contacts` |
|
|
182
|
+
| `sync_contact(contact_params)` | `POST /contact/sync` |
|
|
183
|
+
| `update_contact(contact_id, contact_params)` | `PUT /contacts/:contact_id` |
|
|
184
|
+
| `delete_contact(contact_id)` | `DELETE /contacts/:contact_id` |
|
|
185
|
+
| `update_contact_list_status(contact_list_params)` | `POST /contactLists` |
|
|
186
|
+
| `list_automations(contact_id)` | `GET /contacts/:contact_id/contactAutomations` |
|
|
187
|
+
| `retrieve_contact_score(contact_id)` | `GET /contacts/:contact_id/scoreValues` |
|
|
188
|
+
| `bulk_import_contacts(import_params)` | `POST /import/bulk_import` |
|
|
189
|
+
| `bulk_import_status_list` | `GET /import/bulk_import` |
|
|
190
|
+
| `bulk_import_status_info` | `GET /import/info` |
|
|
191
|
+
| `list_contact_activities` | `GET /activities` |
|
|
192
|
+
| `retrieve_bounce_logs(contact_id)` | `GET /contacts/:contact_id/bounceLogs` |
|
|
193
|
+
| `retrieve_contact_data(contact_id)` | `GET /contacts/:contact_id/contactData` |
|
|
194
|
+
| `retrieve_contact_goals(contact_id)` | `GET /contacts/:contact_id/contactGoals` |
|
|
195
|
+
| `retrieve_contact_list_memberships(contact_id)` | `GET /contacts/:contact_id/contactLists` |
|
|
196
|
+
| `retrieve_contact_logs(contact_id)` | `GET /contacts/:contact_id/contactLogs` |
|
|
197
|
+
| `retrieve_contact_deals(contact_id)` | `GET /contacts/:contact_id/deals` |
|
|
198
|
+
| `retrieve_contact_field_values(contact_id)` | `GET /contacts/:contact_id/fieldValues` |
|
|
199
|
+
| `retrieve_contact_geo_ips(contact_id)` | `GET /contacts/:contact_id/geoIps` |
|
|
200
|
+
| `retrieve_geo_ip_address(geo_address_id)` | `GET /geoIps/:geo_address_id/geoAddress` |
|
|
201
|
+
| `retrieve_contact_notes(contact_id)` | `GET /contacts/:contact_id/notes` |
|
|
202
|
+
| `list_all_notes` | `GET /notes` |
|
|
203
|
+
| `retrieve_contact_organization(contact_id)` | `GET /contacts/:contact_id/organization` |
|
|
204
|
+
| `retrieve_contact_plus_append(contact_id)` | `GET /contacts/:contact_id/plusAppend` |
|
|
205
|
+
| `retrieve_tracking_logs(contact_id)` | `GET /contacts/:contact_id/trackingLogs` |
|
|
206
|
+
| `retrieve_account_contacts(contact_id)` | `GET /contacts/:contact_id/accountContacts` |
|
|
207
|
+
| `retrieve_automation_entry_counts(contact_id)` | `GET /contacts/:contact_id/automationEntryCounts` |
|
|
208
|
+
|
|
209
|
+
## Error Handling
|
|
210
|
+
|
|
211
|
+
Successful responses are parsed from JSON and returned as Ruby hashes. Non-2xx
|
|
212
|
+
responses raise an error with the HTTP status and response body. Invalid JSON
|
|
213
|
+
responses raise a parsing error.
|
|
214
|
+
|
|
215
|
+
Handle these errors at your application boundary so API failures do not expose
|
|
216
|
+
tokens, request bodies, or sensitive contact data in logs.
|
|
217
|
+
|
|
218
|
+
## Development
|
|
219
|
+
|
|
220
|
+
Install dependencies:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
bundle install
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Run the test suite:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
bundle exec rspec
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Run style checks:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
bundle exec rubocop
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Build the gem locally:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
gem build ruby_api_pack_active_campaign.gemspec
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Documentation and AI Guides
|
|
245
|
+
|
|
246
|
+
This repository follows the PHCDevworks documentation model used across the
|
|
247
|
+
Spectre and Rails/Ruby workspaces:
|
|
248
|
+
|
|
249
|
+
- `AGENTS.md` defines shared AI boundaries.
|
|
250
|
+
- `CLAUDE.md`, `CODEX.md`, `COPILOT.md`, and `JULES.md` define agent-specific
|
|
251
|
+
working rules.
|
|
252
|
+
- `.github/copilot-instructions.md` and `.github/codex-instructions.md` provide
|
|
253
|
+
GitHub-integrated assistant guidance.
|
|
254
|
+
- `CHANGELOG.md`, `ROADMAP.md`, and `TODO.md` keep release and planning context
|
|
255
|
+
visible.
|
|
256
|
+
|
|
257
|
+
## Contributing
|
|
258
|
+
|
|
259
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, coding standards, pull
|
|
260
|
+
request expectations, and release hygiene.
|
|
261
|
+
|
|
262
|
+
## Security
|
|
263
|
+
|
|
264
|
+
Please do not report vulnerabilities through public issues. Follow
|
|
265
|
+
[SECURITY.md](SECURITY.md) for responsible disclosure.
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
The gem is available as open source under the terms of the
|
|
270
|
+
[MIT License](MIT-LICENSE).
|
data/ROADMAP.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
This roadmap tracks the direction for `ruby_api_pack_active_campaign` as a Ruby
|
|
4
|
+
client gem for ActiveCampaign. It is planning context, not a release promise.
|
|
5
|
+
|
|
6
|
+
## Current Focus
|
|
7
|
+
|
|
8
|
+
- Keep the contact helper surface stable and well tested.
|
|
9
|
+
- Keep ActiveCampaign API credentials centralized through configuration.
|
|
10
|
+
- Keep HTTP request behavior centralized in the connection wrapper.
|
|
11
|
+
- Improve release hygiene for RubyGems publishing.
|
|
12
|
+
|
|
13
|
+
## Near-Term
|
|
14
|
+
|
|
15
|
+
- Expand README examples for common Rails initializer usage.
|
|
16
|
+
- Add clearer guidance for ActiveCampaign request payload shapes.
|
|
17
|
+
- Review response and error handling for a typed error class.
|
|
18
|
+
- Confirm supported Ruby versions across CI and gem metadata (gemspec allows
|
|
19
|
+
`>= 3.0.0`; CI currently tests only 3.1 and 3.3.x).
|
|
20
|
+
- Add specs for any helper methods that are not covered by endpoint-path
|
|
21
|
+
assertions.
|
|
22
|
+
- Evaluate additional ActiveCampaign resource groups (lists, tags, deals,
|
|
23
|
+
automations) now that the project is being actively revived — contact
|
|
24
|
+
workflows are the only resource group implemented today.
|
|
25
|
+
|
|
26
|
+
## Later
|
|
27
|
+
|
|
28
|
+
- Consider separate modules for automations, lists, accounts, and notes if the
|
|
29
|
+
helper surface grows.
|
|
30
|
+
- Add pagination guidance for list endpoints.
|
|
31
|
+
- Add retry, timeout, and instrumentation guidance without exposing sensitive
|
|
32
|
+
data.
|
|
33
|
+
|
|
34
|
+
## Out of Scope
|
|
35
|
+
|
|
36
|
+
- ActiveCampaign dashboard administration
|
|
37
|
+
- Host application data models or persistence
|
|
38
|
+
- User-facing Rails controllers or views
|
|
39
|
+
- Application-specific marketing automation workflows
|
|
40
|
+
- Storage or management of production secrets
|
data/Rakefile
ADDED
data/SECURITY.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
PHCDevworks applies security fixes to the current release line of this gem.
|
|
6
|
+
Please use the latest published version of `ruby_api_pack_active_campaign`
|
|
7
|
+
whenever possible.
|
|
8
|
+
|
|
9
|
+
## Reporting a Vulnerability
|
|
10
|
+
|
|
11
|
+
Do not open a public issue for security problems.
|
|
12
|
+
|
|
13
|
+
Use GitHub Security Advisories for this repository whenever possible. If that
|
|
14
|
+
is not available, contact the maintainers through GitHub.
|
|
15
|
+
|
|
16
|
+
Include:
|
|
17
|
+
|
|
18
|
+
1. A clear description of the issue and its impact
|
|
19
|
+
2. Steps to reproduce or a proof of concept
|
|
20
|
+
3. Affected versions, if known
|
|
21
|
+
4. Any suggested mitigation
|
|
22
|
+
|
|
23
|
+
## Response Expectations
|
|
24
|
+
|
|
25
|
+
1. We aim to acknowledge reports within 48 hours.
|
|
26
|
+
2. We aim to provide an initial assessment within 5 business days.
|
|
27
|
+
3. We will coordinate disclosure timing with the reporter when possible.
|
|
28
|
+
|
|
29
|
+
## Security Guidance
|
|
30
|
+
|
|
31
|
+
- Keep Ruby, Bundler, HTTParty, and development dependencies up to date.
|
|
32
|
+
- Do not expose ActiveCampaign API tokens, production account URLs, contact
|
|
33
|
+
data, request payloads, or full response bodies in logs or examples.
|
|
34
|
+
- Store API credentials through Rails encrypted credentials, environment
|
|
35
|
+
variables, or a secure deployment secret manager.
|
|
36
|
+
- Review automated dependency updates and advisories before release.
|
|
37
|
+
- Mock external ActiveCampaign requests in specs instead of recording sensitive
|
|
38
|
+
production traffic.
|
|
39
|
+
|
|
40
|
+
## Contact
|
|
41
|
+
|
|
42
|
+
For non-sensitive security questions, open an issue or discussion in this
|
|
43
|
+
repository.
|
data/TODO.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# TODO
|
|
2
|
+
|
|
3
|
+
## Documentation
|
|
4
|
+
|
|
5
|
+
- [x] Standardize README structure.
|
|
6
|
+
- [x] Add AI operating guides.
|
|
7
|
+
- [x] Standardize community health docs.
|
|
8
|
+
- [x] Add changelog and roadmap.
|
|
9
|
+
- [ ] Add Rails initializer examples for common host app shapes.
|
|
10
|
+
- [ ] Add ActiveCampaign payload examples for common contact workflows.
|
|
11
|
+
- [ ] Add pagination and rate-limit guidance.
|
|
12
|
+
|
|
13
|
+
## Ruby Gem
|
|
14
|
+
|
|
15
|
+
- [ ] Review helper naming for long-term compatibility.
|
|
16
|
+
- [ ] Confirm all public helper methods have endpoint-path specs.
|
|
17
|
+
- [ ] Consider a custom error class for API failures.
|
|
18
|
+
- [ ] Consider timeout configuration for HTTParty requests.
|
|
19
|
+
- [x] Review whether `Oj` should be used directly or removed if unused —
|
|
20
|
+
removed; `lib/` only ever used `JSON.parse`.
|
|
21
|
+
|
|
22
|
+
## Release
|
|
23
|
+
|
|
24
|
+
- [ ] Confirm gemspec metadata links point to the repository and changelog.
|
|
25
|
+
- [ ] Document RubyGems release steps.
|
|
26
|
+
- [x] Keep CI, Codecov, and publish workflows aligned with release docs —
|
|
27
|
+
removed stray `.github/workflows/main.yml` (bundler-gem scaffold
|
|
28
|
+
targeting a nonexistent `master` branch, duplicated `test.yml`).
|
|
29
|
+
- [ ] Confirm supported Ruby versions in CI match the gemspec — gemspec
|
|
30
|
+
requires `>= 3.0.0`, but CI only tests 3.1 and 3.3.x; either lower the
|
|
31
|
+
matrix to include 3.0 or raise `required_ruby_version` to match CI.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'ruby_api_pack_core'
|
|
4
|
+
|
|
5
|
+
module RubyApiPackActiveCampaign
|
|
6
|
+
module Api
|
|
7
|
+
class AcContacts
|
|
8
|
+
extend RubyApiPackCore::Handlers::ResponseValidator
|
|
9
|
+
|
|
10
|
+
ENDPOINT = '/contacts'
|
|
11
|
+
|
|
12
|
+
class << self
|
|
13
|
+
def contact_by_id(contact_id)
|
|
14
|
+
validate_response(connection(contact_id).api_get, expected_type: :hash)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def contact_list
|
|
18
|
+
validate_response(connection.api_get, expected_type: :hash)['contacts']
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def create_contact(contact_params)
|
|
22
|
+
validate_response(connection.api_post(contact_params), expected_type: :hash)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def sync_contact(contact_params)
|
|
26
|
+
validate_response(connection(nil, '/contact/sync').api_post(contact_params), expected_type: :hash)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def update_contact(contact_id, contact_params)
|
|
30
|
+
validate_response(connection(contact_id).api_put(contact_params), expected_type: :hash)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def delete_contact(contact_id)
|
|
34
|
+
validate_response(connection(contact_id).api_delete, expected_type: :hash)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def update_contact_list_status(contact_list_params)
|
|
38
|
+
validate_response(connection(nil, '/contactLists').api_post(contact_list_params), expected_type: :hash)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def list_automations(contact_id)
|
|
42
|
+
validate_response(connection(contact_id, '/contactAutomations').api_get, expected_type: :hash)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def retrieve_contact_score(contact_id)
|
|
46
|
+
validate_response(connection(contact_id, '/scoreValues').api_get, expected_type: :hash)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def bulk_import_contacts(import_params)
|
|
50
|
+
validate_response(connection(nil, '/import/bulk_import').api_post(import_params), expected_type: :hash)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def bulk_import_status_list
|
|
54
|
+
validate_response(connection(nil, '/import/bulk_import').api_get, expected_type: :hash)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def bulk_import_status_info
|
|
58
|
+
validate_response(connection(nil, '/import/info').api_get, expected_type: :hash)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def list_contact_activities
|
|
62
|
+
validate_response(connection(nil, '/activities').api_get, expected_type: :hash)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def retrieve_bounce_logs(contact_id)
|
|
66
|
+
validate_response(connection(contact_id, '/bounceLogs').api_get, expected_type: :hash)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def retrieve_contact_data(contact_id)
|
|
70
|
+
validate_response(connection(contact_id, '/contactData').api_get, expected_type: :hash)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def retrieve_contact_goals(contact_id)
|
|
74
|
+
validate_response(connection(contact_id, '/contactGoals').api_get, expected_type: :hash)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def retrieve_contact_list_memberships(contact_id)
|
|
78
|
+
validate_response(connection(contact_id, '/contactLists').api_get, expected_type: :hash)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def retrieve_contact_logs(contact_id)
|
|
82
|
+
validate_response(connection(contact_id, '/contactLogs').api_get, expected_type: :hash)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def retrieve_contact_deals(contact_id)
|
|
86
|
+
validate_response(connection(contact_id, '/deals').api_get, expected_type: :hash)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def retrieve_contact_field_values(contact_id)
|
|
90
|
+
validate_response(connection(contact_id, '/fieldValues').api_get, expected_type: :hash)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def retrieve_contact_geo_ips(contact_id)
|
|
94
|
+
validate_response(connection(contact_id, '/geoIps').api_get, expected_type: :hash)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def retrieve_geo_ip_address(geo_address_id)
|
|
98
|
+
validate_response(
|
|
99
|
+
Connection::AcConnect.new(
|
|
100
|
+
RubyApiPackActiveCampaign.configuration.ac_api_url,
|
|
101
|
+
"/geoIps/#{geo_address_id}/geoAddress"
|
|
102
|
+
).api_get,
|
|
103
|
+
expected_type: :hash
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def retrieve_contact_notes(contact_id)
|
|
108
|
+
validate_response(connection(contact_id, '/notes').api_get, expected_type: :hash)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def list_all_notes
|
|
112
|
+
validate_response(connection(nil, '/notes').api_get, expected_type: :hash)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def retrieve_contact_organization(contact_id)
|
|
116
|
+
validate_response(connection(contact_id, '/organization').api_get, expected_type: :hash)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def retrieve_contact_plus_append(contact_id)
|
|
120
|
+
validate_response(connection(contact_id, '/plusAppend').api_get, expected_type: :hash)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def retrieve_tracking_logs(contact_id)
|
|
124
|
+
validate_response(connection(contact_id, '/trackingLogs').api_get, expected_type: :hash)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def retrieve_account_contacts(contact_id)
|
|
128
|
+
validate_response(connection(contact_id, '/accountContacts').api_get, expected_type: :hash)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def retrieve_automation_entry_counts(contact_id)
|
|
132
|
+
validate_response(connection(contact_id, '/automationEntryCounts').api_get, expected_type: :hash)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
private
|
|
136
|
+
|
|
137
|
+
def connection(id = nil, suffix = nil)
|
|
138
|
+
path = id ? "#{ENDPOINT}/#{id}" : ENDPOINT
|
|
139
|
+
path = "#{path}#{suffix}" if suffix
|
|
140
|
+
Connection::AcConnect.new(RubyApiPackActiveCampaign.configuration.ac_api_url, path)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'ruby_api_pack_core'
|
|
4
|
+
|
|
5
|
+
module RubyApiPackActiveCampaign
|
|
6
|
+
module Connection
|
|
7
|
+
class AcConnect < RubyApiPackCore::Connection::Base
|
|
8
|
+
private
|
|
9
|
+
|
|
10
|
+
def auth_headers
|
|
11
|
+
{ 'Api-Token' => RubyApiPackActiveCampaign.configuration.ac_api_token }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'ruby_api_pack_core'
|
|
4
|
+
|
|
5
|
+
require_relative 'ruby_api_pack_active_campaign/configuration'
|
|
6
|
+
require_relative 'ruby_api_pack_active_campaign/connection/ac_connect'
|
|
7
|
+
require_relative 'ruby_api_pack_active_campaign/api/ac_contacts'
|
|
8
|
+
|
|
9
|
+
module RubyApiPackActiveCampaign
|
|
10
|
+
extend RubyApiPackCore::Configurable
|
|
11
|
+
|
|
12
|
+
def self.configuration_class
|
|
13
|
+
Configuration
|
|
14
|
+
end
|
|
15
|
+
end
|