warb 1.0.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/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +25 -0
- data/README.md +120 -0
- data/Rakefile +12 -0
- data/docs/README.md +13 -0
- data/docs/components/README.md +21 -0
- data/docs/components/address.md +68 -0
- data/docs/components/cta_action.md +13 -0
- data/docs/components/email.md +40 -0
- data/docs/components/list_action.md +29 -0
- data/docs/components/name.md +49 -0
- data/docs/components/org.md +42 -0
- data/docs/components/phone.md +57 -0
- data/docs/components/reply_button_action.md +32 -0
- data/docs/components/row.md +13 -0
- data/docs/components/section.md +30 -0
- data/docs/components/url.md +40 -0
- data/docs/images/contact-with-wa_id.png +0 -0
- data/docs/images/contact-without-wa_id.png +0 -0
- data/docs/messages/README.md +79 -0
- data/docs/messages/audio.md +119 -0
- data/docs/messages/contact.md +134 -0
- data/docs/messages/document.md +122 -0
- data/docs/messages/flow.md +12 -0
- data/docs/messages/image.md +116 -0
- data/docs/messages/indicator.md +39 -0
- data/docs/messages/interactive_call_to_action_url.md +96 -0
- data/docs/messages/interactive_list.md +159 -0
- data/docs/messages/interactive_reply_button.md +67 -0
- data/docs/messages/location.md +34 -0
- data/docs/messages/location_request.md +21 -0
- data/docs/messages/reaction.md +23 -0
- data/docs/messages/sticker.md +116 -0
- data/docs/messages/text.md +47 -0
- data/docs/messages/video.md +116 -0
- data/docs/setup.md +46 -0
- data/docs/webhook.md +24 -0
- data/examples/audio.rb +86 -0
- data/examples/document.rb +116 -0
- data/examples/image.rb +97 -0
- data/examples/interactive_call_to_action_url.rb +177 -0
- data/examples/interactive_list.rb +201 -0
- data/examples/interactive_reply_button.rb +174 -0
- data/examples/location.rb +85 -0
- data/examples/location_request.rb +55 -0
- data/examples/message.rb +61 -0
- data/examples/sticker.rb +86 -0
- data/examples/video.rb +96 -0
- data/examples/webhook.rb +144 -0
- data/lib/warb/client.rb +46 -0
- data/lib/warb/components/action.rb +121 -0
- data/lib/warb/components/address.rb +31 -0
- data/lib/warb/components/email.rb +21 -0
- data/lib/warb/components/name.rb +29 -0
- data/lib/warb/components/org.rb +23 -0
- data/lib/warb/components/phone.rb +23 -0
- data/lib/warb/components/url.rb +21 -0
- data/lib/warb/configuration.rb +13 -0
- data/lib/warb/connection.rb +47 -0
- data/lib/warb/dispatcher.rb +16 -0
- data/lib/warb/dispatcher_concern.rb +69 -0
- data/lib/warb/indicator_dispatcher.rb +31 -0
- data/lib/warb/media_dispatcher.rb +46 -0
- data/lib/warb/resources/audio.rb +19 -0
- data/lib/warb/resources/contact.rb +89 -0
- data/lib/warb/resources/document.rb +32 -0
- data/lib/warb/resources/flow.rb +34 -0
- data/lib/warb/resources/image.rb +31 -0
- data/lib/warb/resources/interactive_call_to_action_url.rb +48 -0
- data/lib/warb/resources/interactive_list.rb +36 -0
- data/lib/warb/resources/interactive_reply_button.rb +48 -0
- data/lib/warb/resources/location.rb +21 -0
- data/lib/warb/resources/location_request.rb +24 -0
- data/lib/warb/resources/reaction.rb +19 -0
- data/lib/warb/resources/resource.rb +51 -0
- data/lib/warb/resources/sticker.rb +19 -0
- data/lib/warb/resources/text.rb +29 -0
- data/lib/warb/resources/video.rb +31 -0
- data/lib/warb/utils.rb +5 -0
- data/lib/warb/version.rb +5 -0
- data/lib/warb.rb +58 -0
- data/sig/warb.rbs +4 -0
- metadata +153 -0
data/lib/warb/version.rb
ADDED
data/lib/warb.rb
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "faraday"
|
|
4
|
+
require "faraday/multipart"
|
|
5
|
+
require_relative "warb/version"
|
|
6
|
+
require_relative "warb/configuration"
|
|
7
|
+
require_relative "warb/dispatcher_concern"
|
|
8
|
+
require_relative "warb/client"
|
|
9
|
+
require_relative "warb/resources/resource"
|
|
10
|
+
require_relative "warb/resources/text"
|
|
11
|
+
require_relative "warb/resources/image"
|
|
12
|
+
require_relative "warb/resources/video"
|
|
13
|
+
require_relative "warb/resources/sticker"
|
|
14
|
+
require_relative "warb/resources/audio"
|
|
15
|
+
require_relative "warb/resources/document"
|
|
16
|
+
require_relative "warb/resources/location"
|
|
17
|
+
require_relative "warb/resources/reaction"
|
|
18
|
+
require_relative "warb/resources/location_request"
|
|
19
|
+
require_relative "warb/resources/interactive_reply_button"
|
|
20
|
+
require_relative "warb/resources/interactive_list"
|
|
21
|
+
require_relative "warb/resources/interactive_call_to_action_url"
|
|
22
|
+
require_relative "warb/resources/contact"
|
|
23
|
+
require_relative "warb/resources/flow"
|
|
24
|
+
require_relative "warb/dispatcher"
|
|
25
|
+
require_relative "warb/media_dispatcher"
|
|
26
|
+
require_relative "warb/indicator_dispatcher"
|
|
27
|
+
require_relative "warb/utils"
|
|
28
|
+
require_relative "warb/components/action"
|
|
29
|
+
|
|
30
|
+
module Warb
|
|
31
|
+
MESSAGING_PRODUCT = "whatsapp"
|
|
32
|
+
RECIPIENT_TYPE = "individual"
|
|
33
|
+
|
|
34
|
+
class Error < StandardError; end
|
|
35
|
+
# Your code goes here...
|
|
36
|
+
|
|
37
|
+
class << self
|
|
38
|
+
include DispatcherConcern
|
|
39
|
+
|
|
40
|
+
def new(**args)
|
|
41
|
+
Client.new(**args)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def client
|
|
45
|
+
@client ||= Client.new(configuration)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def configuration
|
|
49
|
+
@configuration ||= Configuration.new
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def setup
|
|
53
|
+
yield(configuration)
|
|
54
|
+
|
|
55
|
+
client
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
data/sig/warb.rbs
ADDED
metadata
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: warb
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Rebase
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: faraday
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '2.13'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '2.13'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: faraday-multipart
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.1'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.1'
|
|
40
|
+
description: A simple yet powerfull whatsapp api wrapper
|
|
41
|
+
email:
|
|
42
|
+
- devs@rebase.com.br
|
|
43
|
+
executables: []
|
|
44
|
+
extensions: []
|
|
45
|
+
extra_rdoc_files: []
|
|
46
|
+
files:
|
|
47
|
+
- ".rspec"
|
|
48
|
+
- ".rubocop.yml"
|
|
49
|
+
- CHANGELOG.md
|
|
50
|
+
- README.md
|
|
51
|
+
- Rakefile
|
|
52
|
+
- docs/README.md
|
|
53
|
+
- docs/components/README.md
|
|
54
|
+
- docs/components/address.md
|
|
55
|
+
- docs/components/cta_action.md
|
|
56
|
+
- docs/components/email.md
|
|
57
|
+
- docs/components/list_action.md
|
|
58
|
+
- docs/components/name.md
|
|
59
|
+
- docs/components/org.md
|
|
60
|
+
- docs/components/phone.md
|
|
61
|
+
- docs/components/reply_button_action.md
|
|
62
|
+
- docs/components/row.md
|
|
63
|
+
- docs/components/section.md
|
|
64
|
+
- docs/components/url.md
|
|
65
|
+
- docs/images/contact-with-wa_id.png
|
|
66
|
+
- docs/images/contact-without-wa_id.png
|
|
67
|
+
- docs/messages/README.md
|
|
68
|
+
- docs/messages/audio.md
|
|
69
|
+
- docs/messages/contact.md
|
|
70
|
+
- docs/messages/document.md
|
|
71
|
+
- docs/messages/flow.md
|
|
72
|
+
- docs/messages/image.md
|
|
73
|
+
- docs/messages/indicator.md
|
|
74
|
+
- docs/messages/interactive_call_to_action_url.md
|
|
75
|
+
- docs/messages/interactive_list.md
|
|
76
|
+
- docs/messages/interactive_reply_button.md
|
|
77
|
+
- docs/messages/location.md
|
|
78
|
+
- docs/messages/location_request.md
|
|
79
|
+
- docs/messages/reaction.md
|
|
80
|
+
- docs/messages/sticker.md
|
|
81
|
+
- docs/messages/text.md
|
|
82
|
+
- docs/messages/video.md
|
|
83
|
+
- docs/setup.md
|
|
84
|
+
- docs/webhook.md
|
|
85
|
+
- examples/audio.rb
|
|
86
|
+
- examples/document.rb
|
|
87
|
+
- examples/image.rb
|
|
88
|
+
- examples/interactive_call_to_action_url.rb
|
|
89
|
+
- examples/interactive_list.rb
|
|
90
|
+
- examples/interactive_reply_button.rb
|
|
91
|
+
- examples/location.rb
|
|
92
|
+
- examples/location_request.rb
|
|
93
|
+
- examples/message.rb
|
|
94
|
+
- examples/sticker.rb
|
|
95
|
+
- examples/video.rb
|
|
96
|
+
- examples/webhook.rb
|
|
97
|
+
- lib/warb.rb
|
|
98
|
+
- lib/warb/client.rb
|
|
99
|
+
- lib/warb/components/action.rb
|
|
100
|
+
- lib/warb/components/address.rb
|
|
101
|
+
- lib/warb/components/email.rb
|
|
102
|
+
- lib/warb/components/name.rb
|
|
103
|
+
- lib/warb/components/org.rb
|
|
104
|
+
- lib/warb/components/phone.rb
|
|
105
|
+
- lib/warb/components/url.rb
|
|
106
|
+
- lib/warb/configuration.rb
|
|
107
|
+
- lib/warb/connection.rb
|
|
108
|
+
- lib/warb/dispatcher.rb
|
|
109
|
+
- lib/warb/dispatcher_concern.rb
|
|
110
|
+
- lib/warb/indicator_dispatcher.rb
|
|
111
|
+
- lib/warb/media_dispatcher.rb
|
|
112
|
+
- lib/warb/resources/audio.rb
|
|
113
|
+
- lib/warb/resources/contact.rb
|
|
114
|
+
- lib/warb/resources/document.rb
|
|
115
|
+
- lib/warb/resources/flow.rb
|
|
116
|
+
- lib/warb/resources/image.rb
|
|
117
|
+
- lib/warb/resources/interactive_call_to_action_url.rb
|
|
118
|
+
- lib/warb/resources/interactive_list.rb
|
|
119
|
+
- lib/warb/resources/interactive_reply_button.rb
|
|
120
|
+
- lib/warb/resources/location.rb
|
|
121
|
+
- lib/warb/resources/location_request.rb
|
|
122
|
+
- lib/warb/resources/reaction.rb
|
|
123
|
+
- lib/warb/resources/resource.rb
|
|
124
|
+
- lib/warb/resources/sticker.rb
|
|
125
|
+
- lib/warb/resources/text.rb
|
|
126
|
+
- lib/warb/resources/video.rb
|
|
127
|
+
- lib/warb/utils.rb
|
|
128
|
+
- lib/warb/version.rb
|
|
129
|
+
- sig/warb.rbs
|
|
130
|
+
homepage: https://github.com/Rebase-BR/warb
|
|
131
|
+
licenses: []
|
|
132
|
+
metadata:
|
|
133
|
+
homepage_uri: https://github.com/Rebase-BR/warb
|
|
134
|
+
source_code_uri: https://github.com/Rebase-BR/warb
|
|
135
|
+
changelog_uri: https://github.com/Rebase-BR/warb/blob/main/CHANGELOG.md?ref_type=heads
|
|
136
|
+
rdoc_options: []
|
|
137
|
+
require_paths:
|
|
138
|
+
- lib
|
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
|
+
requirements:
|
|
141
|
+
- - ">="
|
|
142
|
+
- !ruby/object:Gem::Version
|
|
143
|
+
version: 3.1.0
|
|
144
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
|
+
requirements:
|
|
146
|
+
- - ">="
|
|
147
|
+
- !ruby/object:Gem::Version
|
|
148
|
+
version: '0'
|
|
149
|
+
requirements: []
|
|
150
|
+
rubygems_version: 3.6.7
|
|
151
|
+
specification_version: 4
|
|
152
|
+
summary: A simple yet powerfull whatsapp api wrapper
|
|
153
|
+
test_files: []
|