lucid-shopify 0.34.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +156 -0
- data/lib/lucid/shopify/activate_charge.rb +26 -0
- data/lib/lucid/shopify/authorise.rb +46 -0
- data/lib/lucid/shopify/client.rb +74 -0
- data/lib/lucid/shopify/config.rb +51 -0
- data/lib/lucid/shopify/container.rb +36 -0
- data/lib/lucid/shopify/create_all_webhooks.rb +27 -0
- data/lib/lucid/shopify/create_charge.rb +37 -0
- data/lib/lucid/shopify/create_webhook.rb +24 -0
- data/lib/lucid/shopify/credentials.rb +16 -0
- data/lib/lucid/shopify/delete_all_webhooks.rb +30 -0
- data/lib/lucid/shopify/delete_request.rb +17 -0
- data/lib/lucid/shopify/delete_webhook.rb +22 -0
- data/lib/lucid/shopify/error.rb +11 -0
- data/lib/lucid/shopify/get_request.rb +18 -0
- data/lib/lucid/shopify/post_request.rb +18 -0
- data/lib/lucid/shopify/put_request.rb +18 -0
- data/lib/lucid/shopify/redis_throttled_strategy.rb +75 -0
- data/lib/lucid/shopify/request.rb +55 -0
- data/lib/lucid/shopify/response.rb +127 -0
- data/lib/lucid/shopify/send_request.rb +101 -0
- data/lib/lucid/shopify/throttled_strategy.rb +51 -0
- data/lib/lucid/shopify/types.rb +11 -0
- data/lib/lucid/shopify/verify_callback.rb +55 -0
- data/lib/lucid/shopify/verify_webhook.rb +28 -0
- data/lib/lucid/shopify/version.rb +7 -0
- data/lib/lucid/shopify/webhook.rb +51 -0
- data/lib/lucid/shopify/webhook_handler_list.rb +39 -0
- data/lib/lucid/shopify/webhook_list.rb +29 -0
- data/lib/lucid/shopify.rb +71 -0
- data/lib/lucid-shopify.rb +3 -0
- metadata +199 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'dry/initializer'
|
4
|
+
require 'dry/struct'
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'redis'
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
|
11
|
+
module Lucid
|
12
|
+
module Shopify
|
13
|
+
autoload :ActivateCharge, 'lucid/shopify/activate_charge'
|
14
|
+
autoload :Authorise, 'lucid/shopify/authorise'
|
15
|
+
autoload :Client, 'lucid/shopify/client'
|
16
|
+
autoload :Container, 'lucid/shopify/container'
|
17
|
+
autoload :CreateAllWebhooks, 'lucid/shopify/create_all_webhooks'
|
18
|
+
autoload :CreateCharge, 'lucid/shopify/create_charge'
|
19
|
+
autoload :CreateWebhook, 'lucid/shopify/create_webhook'
|
20
|
+
autoload :Credentials, 'lucid/shopify/credentials'
|
21
|
+
autoload :DeleteAllWebhooks, 'lucid/shopify/delete_all_webhooks'
|
22
|
+
autoload :DeleteRequest, 'lucid/shopify/delete_request'
|
23
|
+
autoload :DeleteWebhook, 'lucid/shopify/delete_webhook'
|
24
|
+
autoload :Error, 'lucid/shopify/error'
|
25
|
+
autoload :GetRequest, 'lucid/shopify/get_request'
|
26
|
+
autoload :PostRequest, 'lucid/shopify/post_request'
|
27
|
+
autoload :PutRequest, 'lucid/shopify/put_request'
|
28
|
+
autoload :RedisThrottledStrategy, 'lucid/shopify/redis_throttled_strategy'
|
29
|
+
autoload :Request, 'lucid/shopify/request'
|
30
|
+
autoload :Response, 'lucid/shopify/response'
|
31
|
+
autoload :Result, 'lucid/shopify/result'
|
32
|
+
autoload :SendRequest, 'lucid/shopify/send_request'
|
33
|
+
autoload :ThrottledStrategy, 'lucid/shopify/throttled_strategy'
|
34
|
+
autoload :Types, 'lucid/shopify/types'
|
35
|
+
autoload :VerifyCallback, 'lucid/shopify/verify_callback'
|
36
|
+
autoload :VerifyWebhook, 'lucid/shopify/verify_webhook'
|
37
|
+
autoload :VERSION, 'lucid/shopify/version'
|
38
|
+
autoload :Webhook, 'lucid/shopify/webhook'
|
39
|
+
autoload :WebhookHandlerList, 'lucid/shopify/webhook_handler_list'
|
40
|
+
autoload :WebhookList, 'lucid/shopify/webhook_list'
|
41
|
+
|
42
|
+
class << self
|
43
|
+
# Webhooks created for each shop.
|
44
|
+
#
|
45
|
+
# @return [WebhookList]
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# Lucid::Shopify.webhooks.register('orders/create', fields: 'id,tags')
|
49
|
+
def webhooks
|
50
|
+
@webhooks ||= WebhookList.new
|
51
|
+
end
|
52
|
+
|
53
|
+
# Handlers for webhook topics.
|
54
|
+
#
|
55
|
+
# @return [WebhookHandlerList]
|
56
|
+
#
|
57
|
+
# @example
|
58
|
+
# Lucid::Shopify.handlers.register('orders/create', OrdersCreateWebhook.new)
|
59
|
+
#
|
60
|
+
# @example Call topic handlers
|
61
|
+
# webhook = Webhook.new(myshopify_domain, topic, data)
|
62
|
+
#
|
63
|
+
# Lucid::Shopify.handlers.delegate(webhook)
|
64
|
+
def handlers
|
65
|
+
@handlers ||= WebhookHandlerList.new
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
require 'lucid/shopify/config'
|
metadata
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lucid-shopify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.34.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kelsey Judson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dotenv
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.67'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.67'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dry-container
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.7'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.7'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: dry-initializer
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: dry-struct
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: http
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.1'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '4.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: lucid-utils
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.1'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.1'
|
139
|
+
description:
|
140
|
+
email: kelsey@lucid.nz
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- README.md
|
146
|
+
- lib/lucid-shopify.rb
|
147
|
+
- lib/lucid/shopify.rb
|
148
|
+
- lib/lucid/shopify/activate_charge.rb
|
149
|
+
- lib/lucid/shopify/authorise.rb
|
150
|
+
- lib/lucid/shopify/client.rb
|
151
|
+
- lib/lucid/shopify/config.rb
|
152
|
+
- lib/lucid/shopify/container.rb
|
153
|
+
- lib/lucid/shopify/create_all_webhooks.rb
|
154
|
+
- lib/lucid/shopify/create_charge.rb
|
155
|
+
- lib/lucid/shopify/create_webhook.rb
|
156
|
+
- lib/lucid/shopify/credentials.rb
|
157
|
+
- lib/lucid/shopify/delete_all_webhooks.rb
|
158
|
+
- lib/lucid/shopify/delete_request.rb
|
159
|
+
- lib/lucid/shopify/delete_webhook.rb
|
160
|
+
- lib/lucid/shopify/error.rb
|
161
|
+
- lib/lucid/shopify/get_request.rb
|
162
|
+
- lib/lucid/shopify/post_request.rb
|
163
|
+
- lib/lucid/shopify/put_request.rb
|
164
|
+
- lib/lucid/shopify/redis_throttled_strategy.rb
|
165
|
+
- lib/lucid/shopify/request.rb
|
166
|
+
- lib/lucid/shopify/response.rb
|
167
|
+
- lib/lucid/shopify/send_request.rb
|
168
|
+
- lib/lucid/shopify/throttled_strategy.rb
|
169
|
+
- lib/lucid/shopify/types.rb
|
170
|
+
- lib/lucid/shopify/verify_callback.rb
|
171
|
+
- lib/lucid/shopify/verify_webhook.rb
|
172
|
+
- lib/lucid/shopify/version.rb
|
173
|
+
- lib/lucid/shopify/webhook.rb
|
174
|
+
- lib/lucid/shopify/webhook_handler_list.rb
|
175
|
+
- lib/lucid/shopify/webhook_list.rb
|
176
|
+
homepage: https://github.com/lucidnz/gem-lucid-shopify
|
177
|
+
licenses:
|
178
|
+
- ISC
|
179
|
+
metadata: {}
|
180
|
+
post_install_message:
|
181
|
+
rdoc_options: []
|
182
|
+
require_paths:
|
183
|
+
- lib
|
184
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
requirements: []
|
195
|
+
rubygems_version: 3.0.3
|
196
|
+
signing_key:
|
197
|
+
specification_version: 4
|
198
|
+
summary: Shopify client library
|
199
|
+
test_files: []
|