attio 0.1.1 → 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 +4 -4
- data/.github/workflows/ci.yml +39 -15
- data/.github/workflows/coverage.yml +67 -0
- data/.github/workflows/pr_checks.yml +25 -7
- data/.github/workflows/release.yml +27 -13
- data/.github/workflows/tests.yml +67 -0
- data/.rubocop.yml +362 -90
- data/CHANGELOG.md +49 -1
- data/CONCEPTS.md +428 -0
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +8 -5
- data/Gemfile.lock +4 -4
- data/README.md +164 -2
- data/Rakefile +8 -6
- data/attio.gemspec +6 -7
- data/danger/Dangerfile +22 -34
- data/docs/example.rb +30 -29
- data/examples/advanced_filtering.rb +178 -0
- data/examples/basic_usage.rb +110 -0
- data/examples/collaboration_example.rb +173 -0
- data/examples/full_workflow.rb +348 -0
- data/examples/notes_and_tasks.rb +200 -0
- data/lib/attio/client.rb +67 -29
- data/lib/attio/connection_pool.rb +26 -14
- data/lib/attio/errors.rb +4 -2
- data/lib/attio/http_client.rb +70 -41
- data/lib/attio/logger.rb +37 -27
- data/lib/attio/resources/attributes.rb +12 -5
- data/lib/attio/resources/base.rb +66 -27
- data/lib/attio/resources/comments.rb +147 -0
- data/lib/attio/resources/lists.rb +21 -24
- data/lib/attio/resources/notes.rb +110 -0
- data/lib/attio/resources/objects.rb +11 -4
- data/lib/attio/resources/records.rb +49 -67
- data/lib/attio/resources/tasks.rb +131 -0
- data/lib/attio/resources/threads.rb +154 -0
- data/lib/attio/resources/users.rb +10 -4
- data/lib/attio/resources/workspaces.rb +9 -1
- data/lib/attio/retry_handler.rb +19 -11
- data/lib/attio/version.rb +3 -1
- data/lib/attio.rb +15 -9
- metadata +13 -18
- data/run_tests.rb +0 -52
- data/test_basic.rb +0 -51
- data/test_typhoeus.rb +0 -31
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernest Sim
|
@@ -23,20 +23,6 @@ dependencies:
|
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: '1.4'
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: yard
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - "~>"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0.9'
|
33
|
-
type: :development
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0.9'
|
40
26
|
description: A Ruby library for interacting with the Attio API, providing easy access
|
41
27
|
to CRM functionality
|
42
28
|
email:
|
@@ -52,15 +38,18 @@ files:
|
|
52
38
|
- ".github/dependabot.yml"
|
53
39
|
- ".github/pull_request_template.md"
|
54
40
|
- ".github/workflows/ci.yml"
|
41
|
+
- ".github/workflows/coverage.yml"
|
55
42
|
- ".github/workflows/dependabot-auto-merge.yml"
|
56
43
|
- ".github/workflows/pr_checks.yml"
|
57
44
|
- ".github/workflows/release.yml"
|
45
|
+
- ".github/workflows/tests.yml"
|
58
46
|
- ".gitignore"
|
59
47
|
- ".rspec"
|
60
48
|
- ".rubocop.yml"
|
61
49
|
- ".yardopts"
|
62
50
|
- CHANGELOG.md
|
63
51
|
- CODE_OF_CONDUCT.md
|
52
|
+
- CONCEPTS.md
|
64
53
|
- CONTRIBUTING.md
|
65
54
|
- Gemfile
|
66
55
|
- Gemfile.lock
|
@@ -114,6 +103,11 @@ files:
|
|
114
103
|
- docs/js/jquery.js
|
115
104
|
- docs/method_list.html
|
116
105
|
- docs/top-level-namespace.html
|
106
|
+
- examples/advanced_filtering.rb
|
107
|
+
- examples/basic_usage.rb
|
108
|
+
- examples/collaboration_example.rb
|
109
|
+
- examples/full_workflow.rb
|
110
|
+
- examples/notes_and_tasks.rb
|
117
111
|
- lib/attio.rb
|
118
112
|
- lib/attio/client.rb
|
119
113
|
- lib/attio/connection_pool.rb
|
@@ -122,16 +116,17 @@ files:
|
|
122
116
|
- lib/attio/logger.rb
|
123
117
|
- lib/attio/resources/attributes.rb
|
124
118
|
- lib/attio/resources/base.rb
|
119
|
+
- lib/attio/resources/comments.rb
|
125
120
|
- lib/attio/resources/lists.rb
|
121
|
+
- lib/attio/resources/notes.rb
|
126
122
|
- lib/attio/resources/objects.rb
|
127
123
|
- lib/attio/resources/records.rb
|
124
|
+
- lib/attio/resources/tasks.rb
|
125
|
+
- lib/attio/resources/threads.rb
|
128
126
|
- lib/attio/resources/users.rb
|
129
127
|
- lib/attio/resources/workspaces.rb
|
130
128
|
- lib/attio/retry_handler.rb
|
131
129
|
- lib/attio/version.rb
|
132
|
-
- run_tests.rb
|
133
|
-
- test_basic.rb
|
134
|
-
- test_typhoeus.rb
|
135
130
|
homepage: https://github.com/idl3/attio
|
136
131
|
licenses:
|
137
132
|
- MIT
|
data/run_tests.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# Add lib to load path
|
4
|
-
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
5
|
-
|
6
|
-
# Load the gem
|
7
|
-
require 'attio'
|
8
|
-
|
9
|
-
# Basic smoke test
|
10
|
-
begin
|
11
|
-
puts "Testing Attio gem..."
|
12
|
-
puts "Version: #{Attio::VERSION}"
|
13
|
-
|
14
|
-
# Test client initialization
|
15
|
-
begin
|
16
|
-
Attio::Client.new(api_key: nil)
|
17
|
-
puts "ERROR: Should have raised error for nil API key"
|
18
|
-
rescue ArgumentError => e
|
19
|
-
puts "✓ Client validation works: #{e.message}"
|
20
|
-
end
|
21
|
-
|
22
|
-
# Test client creation
|
23
|
-
client = Attio::Client.new(api_key: "test_key")
|
24
|
-
puts "✓ Client created successfully"
|
25
|
-
|
26
|
-
# Test resource access
|
27
|
-
puts "✓ Records resource available: #{client.records.class}"
|
28
|
-
puts "✓ Objects resource available: #{client.objects.class}"
|
29
|
-
puts "✓ Lists resource available: #{client.lists.class}"
|
30
|
-
puts "✓ Workspaces resource available: #{client.workspaces.class}"
|
31
|
-
puts "✓ Attributes resource available: #{client.attributes.class}"
|
32
|
-
puts "✓ Users resource available: #{client.users.class}"
|
33
|
-
|
34
|
-
# Test error classes
|
35
|
-
[
|
36
|
-
Attio::Error,
|
37
|
-
Attio::AuthenticationError,
|
38
|
-
Attio::NotFoundError,
|
39
|
-
Attio::ValidationError,
|
40
|
-
Attio::RateLimitError,
|
41
|
-
Attio::ServerError
|
42
|
-
].each do |error_class|
|
43
|
-
puts "✓ #{error_class} is defined"
|
44
|
-
end
|
45
|
-
|
46
|
-
puts "\nAll basic tests passed!"
|
47
|
-
|
48
|
-
rescue StandardError => e
|
49
|
-
puts "ERROR: #{e.message}"
|
50
|
-
puts e.backtrace
|
51
|
-
exit 1
|
52
|
-
end
|
data/test_basic.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# Test without loading external dependencies
|
4
|
-
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
5
|
-
|
6
|
-
puts "Testing Attio gem structure..."
|
7
|
-
|
8
|
-
# Test version file
|
9
|
-
require 'attio/version'
|
10
|
-
puts "✓ Version loaded: #{Attio::VERSION}"
|
11
|
-
|
12
|
-
# Test error definitions
|
13
|
-
require 'attio/errors'
|
14
|
-
[
|
15
|
-
Attio::Error,
|
16
|
-
Attio::AuthenticationError,
|
17
|
-
Attio::NotFoundError,
|
18
|
-
Attio::ValidationError,
|
19
|
-
Attio::RateLimitError,
|
20
|
-
Attio::ServerError
|
21
|
-
].each do |error_class|
|
22
|
-
puts "✓ #{error_class} is defined"
|
23
|
-
end
|
24
|
-
|
25
|
-
# Test that all files exist
|
26
|
-
files_to_check = [
|
27
|
-
'lib/attio.rb',
|
28
|
-
'lib/attio/client.rb',
|
29
|
-
'lib/attio/resources/base.rb',
|
30
|
-
'lib/attio/resources/records.rb',
|
31
|
-
'lib/attio/resources/objects.rb',
|
32
|
-
'lib/attio/resources/lists.rb',
|
33
|
-
'lib/attio/resources/workspaces.rb',
|
34
|
-
'lib/attio/resources/attributes.rb',
|
35
|
-
'lib/attio/resources/users.rb'
|
36
|
-
]
|
37
|
-
|
38
|
-
files_to_check.each do |file|
|
39
|
-
if File.exist?(file)
|
40
|
-
puts "✓ #{file} exists"
|
41
|
-
else
|
42
|
-
puts "✗ #{file} is missing!"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Test spec files exist
|
47
|
-
spec_files = Dir.glob('spec/**/*_spec.rb')
|
48
|
-
puts "\nFound #{spec_files.length} spec files:"
|
49
|
-
spec_files.each { |f| puts " - #{f}" }
|
50
|
-
|
51
|
-
puts "\nBasic structure test completed!"
|
data/test_typhoeus.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require_relative 'lib/attio'
|
4
|
-
|
5
|
-
# Test the gem with Typhoeus
|
6
|
-
puts "=== Testing Attio Ruby Gem with Typhoeus ==="
|
7
|
-
puts "Version: #{Attio::VERSION}"
|
8
|
-
|
9
|
-
# Initialize client
|
10
|
-
API_KEY = '5472096a0d3ad936523a7a9101807bb3155616a3e04a7649ad41cd5a0261dddd'
|
11
|
-
client = Attio.client(api_key: API_KEY)
|
12
|
-
puts "✓ Client initialized"
|
13
|
-
|
14
|
-
# Test listing people
|
15
|
-
puts "\nListing people..."
|
16
|
-
begin
|
17
|
-
result = client.records.list(object: "people", sorts: [], limit: 5)
|
18
|
-
records = result["data"]
|
19
|
-
puts "✓ Found #{records.length} records"
|
20
|
-
|
21
|
-
records.each do |record|
|
22
|
-
name = record["values"]["name"][0]["full_name"] rescue "Unknown"
|
23
|
-
email = record["values"]["email_addresses"][0]["email_address"] rescue "No email"
|
24
|
-
puts " - #{name} (#{email})"
|
25
|
-
end
|
26
|
-
rescue => e
|
27
|
-
puts "✗ Failed to list records: #{e.message}"
|
28
|
-
puts e.backtrace
|
29
|
-
end
|
30
|
-
|
31
|
-
puts "\n✨ Test complete!"
|