lucid_shopify 0.12.0 → 0.12.1
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 +7 -3
- data/lib/lucid_shopify/container.rb +2 -0
- data/lib/lucid_shopify/create_all_webhooks.rb +3 -2
- data/lib/lucid_shopify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2beb43231e15f6cc5f05d857bafedbaf49e5e96f7fc6c4c6e2fa4d73afdb5ab
|
4
|
+
data.tar.gz: b1fa7c8dc3c7b14e5e3093d7caec13e0116bb94183fe4a30b39704ac6fe9a4cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad6e9008d5da48f20733a97f70686c88939fe4f67b0d2e639791b603fd1969470eaf9419421f762ba768d944bf34d1648fbdb317ec6952cf30499d4fa31744f
|
7
|
+
data.tar.gz: 44531fb0c0eb3ee4f82195b285865771523237b2974d6b7abfb71e1db6350364febb84608ae1d100768b04c886573adb003abf23a8fdbda54551fb1e52d91015
|
data/README.md
CHANGED
@@ -40,14 +40,18 @@ This is only useful during the OAuth2 process.
|
|
40
40
|
|
41
41
|
Configure each webhook the app will create (if any):
|
42
42
|
|
43
|
-
|
43
|
+
webhooks = LucidShopify::Container['webhook_list']
|
44
|
+
|
45
|
+
webhooks.register('orders/create', fields: 'id,tags'}
|
44
46
|
|
45
47
|
|
46
48
|
### Register webhook handlers
|
47
49
|
|
48
50
|
For each webhook, register one or more handlers:
|
49
51
|
|
50
|
-
LucidShopify
|
52
|
+
handlers = LucidShopify::Container['webhook_handler_list']
|
53
|
+
|
54
|
+
handlers.register('orders/create', OrdersCreateWebhook.new)
|
51
55
|
|
52
56
|
See the inline method documentation for more detail.
|
53
57
|
|
@@ -56,7 +60,7 @@ to create a worker around something like this:
|
|
56
60
|
|
57
61
|
webhook = LucidShopify::Webhook.new(myshopify_domain, topic, data)
|
58
62
|
|
59
|
-
|
63
|
+
handlers.delegate(webhook)
|
60
64
|
|
61
65
|
|
62
66
|
### Create and delete webhooks
|
@@ -20,4 +20,6 @@ module LucidShopify
|
|
20
20
|
Container.register(:send_throttled_request) { SendThrottledRequest.new }
|
21
21
|
Container.register(:verify_callback) { VerifyCallback.new }
|
22
22
|
Container.register(:verify_webhook) { VerifyWebhook.new }
|
23
|
+
Container.register(:webhook_handler_list) { LucidShopify.handlers }
|
24
|
+
Container.register(:webhook_list) { LucidShopify.webhooks }
|
23
25
|
end
|
@@ -16,9 +16,10 @@ module LucidShopify
|
|
16
16
|
# already exist remotely.
|
17
17
|
#
|
18
18
|
# @param request_credentials [RequestCredentials]
|
19
|
+
# @param webhooks [WebhookList]
|
19
20
|
#
|
20
|
-
def call(request_credentials)
|
21
|
-
|
21
|
+
def call(request_credentials, webhooks: Container[:webhook_list])
|
22
|
+
webhooks.map do |webhook|
|
22
23
|
Thread.new { @create_webhook.(request_credentials, webhook) }
|
23
24
|
end.map(&:value)
|
24
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucid_shopify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelsey Judson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|