cloud-waba-ruby-client 0.0.10 → 0.0.12
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/README.md +16 -14
- data/cloud-waba-ruby-client.gemspec +3 -1
- data/lib/cloud-waba-ruby-client.rb +7 -0
- data/lib/cloud_waba.rb +12 -0
- data/node_modules/.yarn-integrity +10 -0
- data/yarn.lock +4 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0c8075f042ed9a22dab184ab4d24523d990c669a9ccac1b85bcc2920b62bb98
|
4
|
+
data.tar.gz: cb54e89fc26f3c6d1ef655110a806a0c4572dced3fb407f43b4921cc5fcd482d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b89699168601430eb4772032711c79c93cf4147def5f967c1f727e7d27a47fcfb9ad74495b28d7eea37e669085c33ff27737b922ec24bd855359ea699ff169c9
|
7
|
+
data.tar.gz: 283c9530b7f59b1b39d1b6688c4014c5d79d0526b08e8b6b0b0def99a27c297e65271fa6c266c44a20ca420d6d8ea63b7010fe4d4b17daeccfded3823267e4e6
|
data/README.md
CHANGED
@@ -29,8 +29,10 @@ gem install cloud-waba-ruby-client
|
|
29
29
|
- A phone number added to your WhatsApp business account
|
30
30
|
- Meta developer app
|
31
31
|
### Initiating clients using parameters
|
32
|
+
|
33
|
+
**Option 1: Manual require (explicit)**
|
32
34
|
```ruby
|
33
|
-
require "cloud_waba
|
35
|
+
require "cloud_waba" # Auto-loads the entire gem
|
34
36
|
client_1 = CloudWaba::Client.new(
|
35
37
|
app_id: param_app_id_1,
|
36
38
|
app_secret: param_app_secret_1,
|
@@ -64,13 +66,13 @@ Add following environment variables to your `.env` file:
|
|
64
66
|
```
|
65
67
|
Fill credentials for your meta developer app, business account and phone number ids.
|
66
68
|
```ruby
|
67
|
-
require "cloud_waba
|
69
|
+
require "cloud_waba"
|
68
70
|
client = CloudWaba::Client.new # If no params provided, configuration will fallback to env variables
|
69
71
|
```
|
70
72
|
## Usage
|
71
73
|
### Sending template message
|
72
74
|
```ruby
|
73
|
-
require "cloud_waba
|
75
|
+
require "cloud_waba"
|
74
76
|
|
75
77
|
client = CloudWaba::Client.new
|
76
78
|
client.messages.send_template(recipient: "+201XXXXXXXXX", template_name: "hello_world", template_lang: "en_US", components: [])
|
@@ -78,7 +80,7 @@ client.messages.send_template(recipient: "+201XXXXXXXXX", template_name: "hello_
|
|
78
80
|
|
79
81
|
### Sending text message
|
80
82
|
```ruby
|
81
|
-
require "cloud_waba
|
83
|
+
require "cloud_waba"
|
82
84
|
|
83
85
|
client = CloudWaba::Client.new
|
84
86
|
client.messages.send_text(body: "Hello World!", recipient: "+201XXXXXXXXX")
|
@@ -86,7 +88,7 @@ client.messages.send_text(body: "Hello World!", recipient: "+201XXXXXXXXX")
|
|
86
88
|
|
87
89
|
### Sending image message
|
88
90
|
```ruby
|
89
|
-
require "cloud_waba
|
91
|
+
require "cloud_waba"
|
90
92
|
|
91
93
|
client = CloudWaba::Client.new
|
92
94
|
client.messages.send_image(caption: "Nice caption for image!", link: "https://picsum.photos/200/300",recipient: "+201XXXXXXXXX")
|
@@ -94,7 +96,7 @@ client.messages.send_image(caption: "Nice caption for image!", link: "https://pi
|
|
94
96
|
|
95
97
|
### Sending audio message
|
96
98
|
```ruby
|
97
|
-
require "cloud_waba
|
99
|
+
require "cloud_waba"
|
98
100
|
|
99
101
|
client = CloudWaba::Client.new
|
100
102
|
client.messages.send_audio(link: "https://samplelib.com/lib/preview/mp3/sample-3s.mp3",recipient: "+201XXXXXXXXX")
|
@@ -102,7 +104,7 @@ client.messages.send_audio(link: "https://samplelib.com/lib/preview/mp3/sample-3
|
|
102
104
|
|
103
105
|
### Sending video message
|
104
106
|
```ruby
|
105
|
-
require "cloud_waba
|
107
|
+
require "cloud_waba"
|
106
108
|
|
107
109
|
client = CloudWaba::Client.new
|
108
110
|
client.messages.send_video(caption: "Nice caption for video!", link: "https://samplelib.com/lib/preview/mp4/sample-5s.mp4",recipient: "+201XXXXXXXXX")
|
@@ -110,7 +112,7 @@ client.messages.send_video(caption: "Nice caption for video!", link: "https://sa
|
|
110
112
|
|
111
113
|
### Sending document message
|
112
114
|
```ruby
|
113
|
-
require "cloud_waba
|
115
|
+
require "cloud_waba"
|
114
116
|
|
115
117
|
client = CloudWaba::Client.new
|
116
118
|
client.messages.send_document(caption: "Nice caption for doc!", link: "https://download.samplelib.com/xls/sample-empty.xls",recipient: "+201XXXXXXXXX")
|
@@ -118,7 +120,7 @@ client.messages.send_document(caption: "Nice caption for doc!", link: "https://d
|
|
118
120
|
|
119
121
|
### Sending location message
|
120
122
|
```ruby
|
121
|
-
require "cloud_waba
|
123
|
+
require "cloud_waba"
|
122
124
|
|
123
125
|
client = CloudWaba::Client.new
|
124
126
|
client.messages.send_location(longitude: 30.0849643, latitude: 31.2913638, name: "Cairo University", address: "1 شارع الجامعة, Giza Governorate 12613", recipient: "+201XXXXXXXXX")
|
@@ -126,7 +128,7 @@ client.messages.send_location(longitude: 30.0849643, latitude: 31.2913638, name:
|
|
126
128
|
|
127
129
|
### Sending contact message
|
128
130
|
```ruby
|
129
|
-
require "cloud_waba
|
131
|
+
require "cloud_waba"
|
130
132
|
|
131
133
|
client = CloudWaba::Client.new
|
132
134
|
name = ::CloudWaba::Models::Messages::ContactName.new(formatted_name: "Ahmed Ali", first_name: "Ashley")
|
@@ -137,7 +139,7 @@ client.messages.send_contact(contacts: contacts,recipient: "+201XXXXXXXXX")
|
|
137
139
|
|
138
140
|
### Sending reaction on a message
|
139
141
|
```ruby
|
140
|
-
require "cloud_waba
|
142
|
+
require "cloud_waba"
|
141
143
|
|
142
144
|
client = CloudWaba::Client.new
|
143
145
|
client.messages.send_reaction(recipient: "+201XXXXXXXXX", emoji: "💙", reply_message_id: "wamid.HBgMMjAxMjAxMzIyMzMxFQIAEZgSQTU5QkExMUUyQlRCNTU1NTVEAA==")
|
@@ -152,13 +154,13 @@ client = CloudWaba::Client.new
|
|
152
154
|
|
153
155
|
### Listing templates
|
154
156
|
```ruby
|
155
|
-
require "cloud_waba
|
157
|
+
require "cloud_waba"
|
156
158
|
client = CloudWaba::Client.new
|
157
159
|
client.templates.list(limit: 5)
|
158
160
|
```
|
159
161
|
### Creating a template
|
160
162
|
```ruby
|
161
|
-
require "cloud_waba
|
163
|
+
require "cloud_waba"
|
162
164
|
|
163
165
|
client = CloudWaba::Client.new
|
164
166
|
client.templates.create(name: "welcome", category: ::CloudWaba::Models::Enums::Templates::Category::Utility, language: "en", components: [::CloudWaba::Models::Templates::BodyComponent.new(text: "Welcome to our store!, how can we help?")])
|
@@ -166,7 +168,7 @@ client.templates.create(name: "welcome", category: ::CloudWaba::Models::Enums::T
|
|
166
168
|
|
167
169
|
### Creating a template with header, body and footer components with variables
|
168
170
|
```ruby
|
169
|
-
require "cloud_waba
|
171
|
+
require "cloud_waba"
|
170
172
|
|
171
173
|
client = CloudWaba::Client.new
|
172
174
|
category = ::CloudWaba::Models::Enums::Templates::Category::Marketing
|
@@ -1,12 +1,14 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cloud-waba-ruby-client"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.12"
|
4
4
|
s.summary = "Cloud Waba Client for Ruby."
|
5
5
|
s.description = "A simple API wrapper for Cloud Whatsapp Business API"
|
6
6
|
s.authors = ["Ahmed Bassell"]
|
7
7
|
s.email = "ahmedbassell@gmail.com"
|
8
8
|
# s.platform = Gem::Platform::RUBY
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
|
+
s.require_paths = ["lib"]
|
11
|
+
s.autorequire = "cloud-waba-ruby-client"
|
10
12
|
s.homepage =
|
11
13
|
"https://rubygems.org/gems/cloud_waba"
|
12
14
|
s.license = "MIT"
|
data/lib/cloud_waba.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# typed: true
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "sorbet-runtime"
|
5
|
+
|
6
|
+
# Main entry point for the CloudWaba gem
|
7
|
+
# This file should be required to load the entire gem
|
8
|
+
|
9
|
+
module CloudWaba
|
10
|
+
# Auto-load the main client class when first accessed
|
11
|
+
autoload :Client, "cloud_waba/client"
|
12
|
+
end
|
data/yarn.lock
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-waba-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmed Bassell
|
8
|
-
autorequire:
|
8
|
+
autorequire: cloud-waba-ruby-client
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- cloud-waba-ruby-client.gemspec
|
112
112
|
- lib/api/messages/service.rb
|
113
113
|
- lib/api/templates/service.rb
|
114
|
+
- lib/cloud-waba-ruby-client.rb
|
115
|
+
- lib/cloud_waba.rb
|
114
116
|
- lib/cloud_waba/client.rb
|
115
117
|
- lib/cloud_waba/errors/bad_request.rb
|
116
118
|
- lib/cloud_waba/errors/missing_parameter.rb
|
@@ -147,8 +149,10 @@ files:
|
|
147
149
|
- lib/cloud_waba/models/templates/message_template.rb
|
148
150
|
- lib/cloud_waba/models/templates/response.rb
|
149
151
|
- lib/cloud_waba/utils.rb
|
152
|
+
- node_modules/.yarn-integrity
|
150
153
|
- spec/cloud_waba/client_spec.rb
|
151
154
|
- spec/spec_helper.rb
|
155
|
+
- yarn.lock
|
152
156
|
homepage: https://rubygems.org/gems/cloud_waba
|
153
157
|
licenses:
|
154
158
|
- MIT
|