kapso-client-ruby 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +81 -81
- data/CHANGELOG.md +262 -91
- data/Gemfile +20 -20
- data/RAILS_INTEGRATION.md +478 -0
- data/README.md +1053 -734
- data/Rakefile +40 -40
- data/TEMPLATE_TOOLS_GUIDE.md +120 -120
- data/WHATSAPP_24_HOUR_GUIDE.md +133 -133
- data/examples/advanced_features.rb +352 -349
- data/examples/advanced_messaging.rb +241 -0
- data/examples/basic_messaging.rb +139 -136
- data/examples/enhanced_interactive.rb +400 -0
- data/examples/flows_usage.rb +307 -0
- data/examples/interactive_messages.rb +343 -0
- data/examples/media_management.rb +256 -253
- data/examples/rails/jobs.rb +388 -0
- data/examples/rails/models.rb +240 -0
- data/examples/rails/notifications_controller.rb +227 -0
- data/examples/template_management.rb +393 -390
- data/kapso-ruby-logo.jpg +0 -0
- data/lib/kapso_client_ruby/client.rb +321 -316
- data/lib/kapso_client_ruby/errors.rb +348 -329
- data/lib/kapso_client_ruby/rails/generators/install_generator.rb +76 -0
- data/lib/kapso_client_ruby/rails/generators/templates/env.erb +21 -0
- data/lib/kapso_client_ruby/rails/generators/templates/initializer.rb.erb +33 -0
- data/lib/kapso_client_ruby/rails/generators/templates/message_service.rb.erb +138 -0
- data/lib/kapso_client_ruby/rails/generators/templates/webhook_controller.rb.erb +62 -0
- data/lib/kapso_client_ruby/rails/railtie.rb +55 -0
- data/lib/kapso_client_ruby/rails/service.rb +189 -0
- data/lib/kapso_client_ruby/rails/tasks.rake +167 -0
- data/lib/kapso_client_ruby/resources/calls.rb +172 -172
- data/lib/kapso_client_ruby/resources/contacts.rb +190 -190
- data/lib/kapso_client_ruby/resources/conversations.rb +103 -103
- data/lib/kapso_client_ruby/resources/flows.rb +382 -0
- data/lib/kapso_client_ruby/resources/media.rb +205 -205
- data/lib/kapso_client_ruby/resources/messages.rb +760 -380
- data/lib/kapso_client_ruby/resources/phone_numbers.rb +85 -85
- data/lib/kapso_client_ruby/resources/templates.rb +283 -283
- data/lib/kapso_client_ruby/types.rb +348 -262
- data/lib/kapso_client_ruby/version.rb +5 -5
- data/lib/kapso_client_ruby.rb +75 -68
- data/scripts/.env.example +17 -17
- data/scripts/kapso_template_finder.rb +91 -91
- data/scripts/sdk_setup.rb +404 -404
- data/scripts/test.rb +60 -60
- metadata +24 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 69afc2eabf951df5ed6149530f2c6512fec01869bcb50f598084db330e5deefd
|
|
4
|
+
data.tar.gz: f12a18a6582d91ff8806a0ae7d07508f4a0a72db3140a83833101c60e24ce46d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48ef162b3575307d5a833a7a2dede4b76eec105f020acf0b1da3c4e8c0aa7f1d04f958695530e5bd9254d31372fe740ed40527bec5186b09e9034af966cb902b
|
|
7
|
+
data.tar.gz: 7b5a2954d39bc0efeb51a8e500eb96ad76e67915a22e1bc0632727cb25fbb1cff3193578d523e13f715ea83164a4e40086408e69e6598c588f17cec40f963ea7
|
data/.rubocop.yml
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# RuboCop configuration for WhatsApp Cloud API Ruby SDK
|
|
4
|
-
|
|
5
|
-
AllCops:
|
|
6
|
-
TargetRubyVersion: 3.0
|
|
7
|
-
NewCops: enable
|
|
8
|
-
Exclude:
|
|
9
|
-
- 'vendor/**/*'
|
|
10
|
-
- 'bin/**/*'
|
|
11
|
-
- 'spec/fixtures/**/*'
|
|
12
|
-
|
|
13
|
-
# Metrics
|
|
14
|
-
Layout/LineLength:
|
|
15
|
-
Max: 120
|
|
16
|
-
AllowedPatterns: ['\A#']
|
|
17
|
-
|
|
18
|
-
Metrics/MethodLength:
|
|
19
|
-
Max: 25
|
|
20
|
-
Exclude:
|
|
21
|
-
- 'spec/**/*'
|
|
22
|
-
|
|
23
|
-
Metrics/ClassLength:
|
|
24
|
-
Max: 150
|
|
25
|
-
Exclude:
|
|
26
|
-
- 'spec/**/*'
|
|
27
|
-
|
|
28
|
-
Metrics/BlockLength:
|
|
29
|
-
Max: 25
|
|
30
|
-
Exclude:
|
|
31
|
-
- 'spec/**/*'
|
|
32
|
-
- '*.gemspec'
|
|
33
|
-
- 'Rakefile'
|
|
34
|
-
|
|
35
|
-
Metrics/AbcSize:
|
|
36
|
-
Max: 20
|
|
37
|
-
Exclude:
|
|
38
|
-
- 'spec/**/*'
|
|
39
|
-
|
|
40
|
-
# Style
|
|
41
|
-
Style/Documentation:
|
|
42
|
-
Enabled: false
|
|
43
|
-
|
|
44
|
-
Style/StringLiterals:
|
|
45
|
-
EnforcedStyle: single_quotes
|
|
46
|
-
|
|
47
|
-
Style/StringLiteralsInInterpolation:
|
|
48
|
-
EnforcedStyle: single_quotes
|
|
49
|
-
|
|
50
|
-
Style/FrozenStringLiteralComment:
|
|
51
|
-
Enabled: true
|
|
52
|
-
|
|
53
|
-
Style/ClassAndModuleChildren:
|
|
54
|
-
EnforcedStyle: compact
|
|
55
|
-
|
|
56
|
-
# Layout
|
|
57
|
-
Layout/MultilineMethodCallIndentation:
|
|
58
|
-
EnforcedStyle: indented
|
|
59
|
-
|
|
60
|
-
Layout/FirstArrayElementIndentation:
|
|
61
|
-
EnforcedStyle: consistent
|
|
62
|
-
|
|
63
|
-
Layout/FirstHashElementIndentation:
|
|
64
|
-
EnforcedStyle: consistent
|
|
65
|
-
|
|
66
|
-
# Naming
|
|
67
|
-
Naming/FileName:
|
|
68
|
-
Exclude:
|
|
69
|
-
- 'whatsapp-cloud-api-ruby.gemspec'
|
|
70
|
-
|
|
71
|
-
# RSpec specific rules
|
|
72
|
-
RSpec/ExampleLength:
|
|
73
|
-
Max: 15
|
|
74
|
-
|
|
75
|
-
RSpec/MultipleExpectations:
|
|
76
|
-
Max: 5
|
|
77
|
-
|
|
78
|
-
RSpec/NestedGroups:
|
|
79
|
-
Max: 4
|
|
80
|
-
|
|
81
|
-
RSpec/DescribeClass:
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# RuboCop configuration for WhatsApp Cloud API Ruby SDK
|
|
4
|
+
|
|
5
|
+
AllCops:
|
|
6
|
+
TargetRubyVersion: 3.0
|
|
7
|
+
NewCops: enable
|
|
8
|
+
Exclude:
|
|
9
|
+
- 'vendor/**/*'
|
|
10
|
+
- 'bin/**/*'
|
|
11
|
+
- 'spec/fixtures/**/*'
|
|
12
|
+
|
|
13
|
+
# Metrics
|
|
14
|
+
Layout/LineLength:
|
|
15
|
+
Max: 120
|
|
16
|
+
AllowedPatterns: ['\A#']
|
|
17
|
+
|
|
18
|
+
Metrics/MethodLength:
|
|
19
|
+
Max: 25
|
|
20
|
+
Exclude:
|
|
21
|
+
- 'spec/**/*'
|
|
22
|
+
|
|
23
|
+
Metrics/ClassLength:
|
|
24
|
+
Max: 150
|
|
25
|
+
Exclude:
|
|
26
|
+
- 'spec/**/*'
|
|
27
|
+
|
|
28
|
+
Metrics/BlockLength:
|
|
29
|
+
Max: 25
|
|
30
|
+
Exclude:
|
|
31
|
+
- 'spec/**/*'
|
|
32
|
+
- '*.gemspec'
|
|
33
|
+
- 'Rakefile'
|
|
34
|
+
|
|
35
|
+
Metrics/AbcSize:
|
|
36
|
+
Max: 20
|
|
37
|
+
Exclude:
|
|
38
|
+
- 'spec/**/*'
|
|
39
|
+
|
|
40
|
+
# Style
|
|
41
|
+
Style/Documentation:
|
|
42
|
+
Enabled: false
|
|
43
|
+
|
|
44
|
+
Style/StringLiterals:
|
|
45
|
+
EnforcedStyle: single_quotes
|
|
46
|
+
|
|
47
|
+
Style/StringLiteralsInInterpolation:
|
|
48
|
+
EnforcedStyle: single_quotes
|
|
49
|
+
|
|
50
|
+
Style/FrozenStringLiteralComment:
|
|
51
|
+
Enabled: true
|
|
52
|
+
|
|
53
|
+
Style/ClassAndModuleChildren:
|
|
54
|
+
EnforcedStyle: compact
|
|
55
|
+
|
|
56
|
+
# Layout
|
|
57
|
+
Layout/MultilineMethodCallIndentation:
|
|
58
|
+
EnforcedStyle: indented
|
|
59
|
+
|
|
60
|
+
Layout/FirstArrayElementIndentation:
|
|
61
|
+
EnforcedStyle: consistent
|
|
62
|
+
|
|
63
|
+
Layout/FirstHashElementIndentation:
|
|
64
|
+
EnforcedStyle: consistent
|
|
65
|
+
|
|
66
|
+
# Naming
|
|
67
|
+
Naming/FileName:
|
|
68
|
+
Exclude:
|
|
69
|
+
- 'whatsapp-cloud-api-ruby.gemspec'
|
|
70
|
+
|
|
71
|
+
# RSpec specific rules
|
|
72
|
+
RSpec/ExampleLength:
|
|
73
|
+
Max: 15
|
|
74
|
+
|
|
75
|
+
RSpec/MultipleExpectations:
|
|
76
|
+
Max: 5
|
|
77
|
+
|
|
78
|
+
RSpec/NestedGroups:
|
|
79
|
+
Max: 4
|
|
80
|
+
|
|
81
|
+
RSpec/DescribeClass:
|
|
82
82
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,92 +1,263 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
####
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.0.0-alpha.1] - 2025-12-10
|
|
9
|
+
|
|
10
|
+
### Added Flows API
|
|
11
|
+
|
|
12
|
+
#### Flows Resource (`client.flows`)
|
|
13
|
+
- **Flow Management**:
|
|
14
|
+
- `create()` - Create a new WhatsApp Flow
|
|
15
|
+
- `update()` - Update Flow properties
|
|
16
|
+
- `delete()` - Delete a Flow
|
|
17
|
+
- `get()` - Retrieve Flow details
|
|
18
|
+
- `list()` - List all Flows for a business account
|
|
19
|
+
|
|
20
|
+
- **Flow Lifecycle**:
|
|
21
|
+
- `publish()` - Publish a Flow to production
|
|
22
|
+
- `deprecate()` - Deprecate an existing Flow
|
|
23
|
+
- `update_asset()` - Update Flow JSON definition with validation
|
|
24
|
+
- `preview()` - Get Flow preview URL and expiration
|
|
25
|
+
- `deploy()` - Idempotent deployment (create/update + publish)
|
|
26
|
+
|
|
27
|
+
- **Flow Webhooks & Server Utilities**:
|
|
28
|
+
- `receive_flow_event()` - Decrypt incoming Flow webhook events
|
|
29
|
+
- `respond_to_flow()` - Encrypt Flow responses for WhatsApp
|
|
30
|
+
- `download_flow_media()` - Download media from Flow submissions
|
|
31
|
+
- AES-128-GCM encryption/decryption with RSA key exchange
|
|
32
|
+
- Automatic payload parsing and validation
|
|
33
|
+
|
|
34
|
+
#### Messages Enhancement
|
|
35
|
+
- **Flow Messages**:
|
|
36
|
+
- `send_flow()` - Send interactive Flow messages
|
|
37
|
+
- Support for Flow CTA buttons
|
|
38
|
+
- Flow token generation for session tracking
|
|
39
|
+
- Navigate to specific screens
|
|
40
|
+
- Flow action payload support
|
|
41
|
+
|
|
42
|
+
#### New Types
|
|
43
|
+
- `FlowResponse` - Flow creation/update response
|
|
44
|
+
- `FlowData` - Detailed Flow information
|
|
45
|
+
- `FlowAssetResponse` - Asset update validation results
|
|
46
|
+
- `FlowPreviewResponse` - Preview URL and expiration
|
|
47
|
+
- `FlowEventData` - Decrypted Flow webhook events
|
|
48
|
+
- `FlowScreen` - Flow screen configuration
|
|
49
|
+
|
|
50
|
+
#### New Errors
|
|
51
|
+
- `FlowDecryptionError` - Flow webhook decryption failures
|
|
52
|
+
- `FlowEncryptionError` - Flow response encryption failures
|
|
53
|
+
|
|
54
|
+
#### Documentation
|
|
55
|
+
- Complete Flows API documentation in README
|
|
56
|
+
- Flow usage examples (`examples/flows_usage.rb`)
|
|
57
|
+
- Webhook handling guide
|
|
58
|
+
- Encryption/decryption examples
|
|
59
|
+
|
|
60
|
+
### Added Interactive Messages
|
|
61
|
+
|
|
62
|
+
#### Interactive CTA URL Messages
|
|
63
|
+
- **`send_interactive_cta_url()`** - Send Call-to-Action URL buttons
|
|
64
|
+
- Support for text, image, video, and document headers
|
|
65
|
+
- URL validation (HTTP/HTTPS)
|
|
66
|
+
- Display text max 20 characters
|
|
67
|
+
- Body text max 1024 characters
|
|
68
|
+
- Optional footer text (max 60 characters)
|
|
69
|
+
|
|
70
|
+
#### Catalog Messages
|
|
71
|
+
- **`send_interactive_catalog_message()`** - Send product catalog messages
|
|
72
|
+
- Thumbnail product selection via retailer ID
|
|
73
|
+
- Body text validation (max 1024 characters)
|
|
74
|
+
- Optional footer text (max 60 characters)
|
|
75
|
+
|
|
76
|
+
#### Enhanced Validations
|
|
77
|
+
- **Header validation** for interactive messages
|
|
78
|
+
- Text header: max 60 characters
|
|
79
|
+
- Media headers: require id or link
|
|
80
|
+
- Type validation (text, image, video, document)
|
|
81
|
+
- **Parameter validation**:
|
|
82
|
+
- CTA URL: display_text, url, body_text, footer_text
|
|
83
|
+
- Catalog: body_text, thumbnail_product_retailer_id, footer_text
|
|
84
|
+
- **Comprehensive error messages** with current vs. max values
|
|
85
|
+
|
|
86
|
+
#### New Private Methods
|
|
87
|
+
- `validate_cta_url_params()` - CTA URL parameter validation
|
|
88
|
+
- `validate_catalog_message_params()` - Catalog message parameter validation
|
|
89
|
+
- `validate_interactive_header()` - Header type and content validation
|
|
90
|
+
- `validate_text_header()` - Text header specific validation
|
|
91
|
+
- `validate_media_header()` - Media header specific validation
|
|
92
|
+
|
|
93
|
+
#### Documentation
|
|
94
|
+
- Interactive Messages examples (`examples/interactive_messages.rb`)
|
|
95
|
+
- CTA URL usage with all header types
|
|
96
|
+
- Catalog message examples
|
|
97
|
+
- Validation examples and error handling
|
|
98
|
+
- Real-world use cases (e-commerce, events, support, restaurants)
|
|
99
|
+
- README updates with comprehensive examples
|
|
100
|
+
|
|
101
|
+
### Added Enhanced Features & Validations
|
|
102
|
+
|
|
103
|
+
#### Enhanced Interactive Button Messages
|
|
104
|
+
- **Media header support** for buttons (previously text-only)
|
|
105
|
+
- Image headers: Display product images with buttons
|
|
106
|
+
- Video headers: Show tutorial videos with feedback buttons
|
|
107
|
+
- Document headers: Attach PDFs/docs with approval buttons
|
|
108
|
+
- Text headers: Traditional text-only headers (existing)
|
|
109
|
+
- **Button validations**:
|
|
110
|
+
- Maximum 3 buttons enforced
|
|
111
|
+
- Minimum 1 button required
|
|
112
|
+
- Header type validation (text, image, video, document)
|
|
113
|
+
- Media header content validation (requires id or link)
|
|
114
|
+
|
|
115
|
+
#### Enhanced Interactive List Messages
|
|
116
|
+
- **Increased body text limit**: 1024 → 4096 characters
|
|
117
|
+
- **Row count validation**: Maximum 10 rows total across all sections
|
|
118
|
+
- **Header restriction**: Text headers only (no media headers for lists)
|
|
119
|
+
- **Improved validations**:
|
|
120
|
+
- Total row count across all sections enforced
|
|
121
|
+
- At least 1 row required
|
|
122
|
+
- Header type validation (text only)
|
|
123
|
+
- Body text length validation with detailed error messages
|
|
124
|
+
|
|
125
|
+
#### Updated Validations
|
|
126
|
+
- **Footer handling**: Support for both string and hash formats
|
|
127
|
+
- **Enhanced error messages**: Show current vs. maximum values
|
|
128
|
+
- **Consistent validation**: All interactive message types use shared validators
|
|
129
|
+
|
|
130
|
+
#### Documentation
|
|
131
|
+
- Enhanced Interactive Messages examples (`examples/enhanced_interactive.rb`)
|
|
132
|
+
- Button header examples (text, image, video, document)
|
|
133
|
+
- List validation examples (4096 chars, 10 rows, text header)
|
|
134
|
+
- Real-world use cases (product selection, tutorials, document approvals)
|
|
135
|
+
- README updates with detailed examples and validation notes
|
|
136
|
+
|
|
137
|
+
### Added Advanced Messaging Features
|
|
138
|
+
|
|
139
|
+
#### Voice Notes Support
|
|
140
|
+
- **Audio voice notes** via `send_audio(voice: true)`
|
|
141
|
+
- Voice flag for voice note format (recommended: OGG/OPUS)
|
|
142
|
+
- Regular audio messages when `voice: false` (default)
|
|
143
|
+
- Perfect for personal messages and support responses
|
|
144
|
+
|
|
145
|
+
#### Group Messaging Support
|
|
146
|
+
- **`recipient_type` parameter** added to all send methods
|
|
147
|
+
- `'individual'` - Send to individual users (default)
|
|
148
|
+
- `'group'` - Send to WhatsApp groups
|
|
149
|
+
- Group ID format: `XXXXXXXXX@g.us`
|
|
150
|
+
- **Supported for all message types**:
|
|
151
|
+
- Text, images, videos, documents, audio, stickers
|
|
152
|
+
- All interactive messages (buttons, lists, CTA URL, etc.)
|
|
153
|
+
- Templates, reactions, contacts, location
|
|
154
|
+
- **Validation**: Enforces valid recipient types ('individual' or 'group')
|
|
155
|
+
|
|
156
|
+
#### Location Request Action
|
|
157
|
+
- **`send_interactive_location_request()`** - Request user location
|
|
158
|
+
- Interactive message asking users to share location
|
|
159
|
+
- Supports headers (text, image, video, document)
|
|
160
|
+
- Optional footer text
|
|
161
|
+
- Perfect for delivery services, meetups, directions
|
|
162
|
+
- Action: `{ name: 'send_location' }`
|
|
163
|
+
|
|
164
|
+
#### Updated Core Methods
|
|
165
|
+
- **`build_base_payload()`** - Enhanced with `recipient_type` support
|
|
166
|
+
- **`send_text()`** - Added `recipient_type` parameter
|
|
167
|
+
- **`send_image()`** - Added `recipient_type` parameter
|
|
168
|
+
- **`send_video()`** - Added `recipient_type` parameter
|
|
169
|
+
- **`send_audio()`** - Added `voice` and `recipient_type` parameters
|
|
170
|
+
|
|
171
|
+
#### Documentation
|
|
172
|
+
- Advanced Messaging examples (`examples/advanced_messaging.rb`)
|
|
173
|
+
- Voice note usage (voice flag, formats)
|
|
174
|
+
- Group messaging examples (text, images, videos)
|
|
175
|
+
- Location request examples (with/without headers)
|
|
176
|
+
- Real-world use cases (support, teams, delivery, education, real estate, community)
|
|
177
|
+
- README updates with all new features
|
|
178
|
+
|
|
179
|
+
## [1.0.0] - 2025-01-09
|
|
180
|
+
|
|
181
|
+
### Added
|
|
182
|
+
|
|
183
|
+
- Initial release of Kapso API Ruby SDK
|
|
184
|
+
- Complete Kapso API support with all message types
|
|
185
|
+
- Support for text, image, audio, video, document, sticker, location, and contact messages
|
|
186
|
+
- Interactive message support (buttons, lists, product catalogs)
|
|
187
|
+
- Template message creation and management
|
|
188
|
+
- Media upload, download, and management
|
|
189
|
+
- Phone number registration and verification
|
|
190
|
+
- Call management and permissions (via Kapso proxy)
|
|
191
|
+
- Conversation history and management (via Kapso proxy)
|
|
192
|
+
- Contact management with metadata and tagging (via Kapso proxy)
|
|
193
|
+
- Comprehensive error handling with categorization and retry hints
|
|
194
|
+
- Debug logging with configurable levels
|
|
195
|
+
- Automatic retry logic with exponential backoff
|
|
196
|
+
- Rate limiting detection and handling
|
|
197
|
+
- Support for both Meta Graph API and Kapso proxy
|
|
198
|
+
- Webhook signature verification utilities
|
|
199
|
+
- Extensive documentation and examples
|
|
200
|
+
- Test suite with VCR cassettes
|
|
201
|
+
- Ruby 2.7+ compatibility
|
|
202
|
+
|
|
203
|
+
### Features
|
|
204
|
+
|
|
205
|
+
#### Core Messaging
|
|
206
|
+
- Send text messages with URL preview support
|
|
207
|
+
- Send media messages (images, audio, video, documents, stickers)
|
|
208
|
+
- Send location and contact messages
|
|
209
|
+
- Send interactive button and list messages
|
|
210
|
+
- Send template messages with parameter substitution
|
|
211
|
+
- Message reactions (add/remove)
|
|
212
|
+
- Message read status and typing indicators
|
|
213
|
+
|
|
214
|
+
#### Media Management
|
|
215
|
+
- Upload media files with automatic MIME type detection
|
|
216
|
+
- Download media with authentication handling
|
|
217
|
+
- Get media metadata (size, type, SHA256)
|
|
218
|
+
- Delete media files
|
|
219
|
+
- Save media directly to files
|
|
220
|
+
- Support for different authentication strategies
|
|
221
|
+
|
|
222
|
+
#### Template Management
|
|
223
|
+
- List, create, update, and delete message templates
|
|
224
|
+
- Template builders for marketing, utility, and authentication templates
|
|
225
|
+
- Component validation and example handling
|
|
226
|
+
- Support for all template types (text, media, interactive)
|
|
227
|
+
|
|
228
|
+
#### Advanced Features (Kapso Proxy)
|
|
229
|
+
- Message history queries with filtering
|
|
230
|
+
- Conversation management and status updates
|
|
231
|
+
- Contact management with metadata and search
|
|
232
|
+
- Call history and management
|
|
233
|
+
- Analytics and reporting
|
|
234
|
+
- Data export/import capabilities
|
|
235
|
+
|
|
236
|
+
#### Error Handling
|
|
237
|
+
- Comprehensive error categorization (14+ categories)
|
|
238
|
+
- Intelligent retry recommendations
|
|
239
|
+
- Rate limiting detection with retry-after support
|
|
240
|
+
- Detailed error context and debugging information
|
|
241
|
+
- Custom error classes for different scenarios
|
|
242
|
+
|
|
243
|
+
#### Developer Experience
|
|
244
|
+
- Extensive documentation with code examples
|
|
245
|
+
- Debug logging with request/response tracing
|
|
246
|
+
- Configurable HTTP client with connection pooling
|
|
247
|
+
- Type-safe response objects
|
|
248
|
+
- Comprehensive test suite
|
|
249
|
+
- Ruby best practices and conventions
|
|
250
|
+
|
|
251
|
+
### Dependencies
|
|
252
|
+
- faraday (~> 2.0) - HTTP client
|
|
253
|
+
- faraday-multipart (~> 1.0) - Multipart form support
|
|
254
|
+
- mime-types (~> 3.0) - MIME type detection
|
|
255
|
+
- dry-validation (~> 1.10) - Input validation
|
|
256
|
+
|
|
257
|
+
### Development Dependencies
|
|
258
|
+
- rspec (~> 3.0) - Testing framework
|
|
259
|
+
- webmock (~> 3.18) - HTTP request mocking
|
|
260
|
+
- vcr (~> 6.0) - HTTP interaction recording
|
|
261
|
+
- rubocop (~> 1.50) - Code style checking
|
|
262
|
+
- simplecov (~> 0.22) - Code coverage
|
|
92
263
|
- yard (~> 0.9) - Documentation generation
|
data/Gemfile
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in whatsapp-cloud-api-ruby.gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
gem 'rake', '~> 13.0'
|
|
9
|
-
|
|
10
|
-
group :development, :test do
|
|
11
|
-
gem 'rspec', '~> 3.12'
|
|
12
|
-
gem 'webmock', '~> 3.18'
|
|
13
|
-
gem 'vcr', '~> 6.1'
|
|
14
|
-
gem 'simplecov', '~> 0.22'
|
|
15
|
-
gem 'rubocop', '~> 1.50'
|
|
16
|
-
gem 'rubocop-rspec', '~> 2.20'
|
|
17
|
-
gem 'yard', '~> 0.9'
|
|
18
|
-
gem 'pry', '~> 0.14'
|
|
19
|
-
gem 'pry-byebug', '~> 3.10'
|
|
20
|
-
gem 'dotenv', '~> 2.8' # For loading .env files in examples
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
# Specify your gem's dependencies in whatsapp-cloud-api-ruby.gemspec
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
gem 'rake', '~> 13.0'
|
|
9
|
+
|
|
10
|
+
group :development, :test do
|
|
11
|
+
gem 'rspec', '~> 3.12'
|
|
12
|
+
gem 'webmock', '~> 3.18'
|
|
13
|
+
gem 'vcr', '~> 6.1'
|
|
14
|
+
gem 'simplecov', '~> 0.22'
|
|
15
|
+
gem 'rubocop', '~> 1.50'
|
|
16
|
+
gem 'rubocop-rspec', '~> 2.20'
|
|
17
|
+
gem 'yard', '~> 0.9'
|
|
18
|
+
gem 'pry', '~> 0.14'
|
|
19
|
+
gem 'pry-byebug', '~> 3.10'
|
|
20
|
+
gem 'dotenv', '~> 2.8' # For loading .env files in examples
|
|
21
21
|
end
|