pobo-sdk 1.0.0 → 1.1.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 +4 -4
- data/README.md +16 -1
- data/lib/pobo/dto/blog.rb +2 -2
- data/lib/pobo/dto/category.rb +2 -2
- data/lib/pobo/dto/product.rb +2 -2
- data/lib/pobo/enum/webhook_event.rb +2 -1
- data/lib/pobo/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: 9a34c26065802db8c85f460b56f66a0425d1307aa433c6e79f465c1c71a595ef
|
|
4
|
+
data.tar.gz: 218f2c3486337f5dd62da55dc57c7f0add26094dca66158f2605ca8e8a4fb0ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9c48eefa592357f10ee80bee1bd8b7f5464f82135f52e5798a79132a7c92f56cf41dd9894b1b050739be7e69afe41e8000a1db424d806423a609c7bd6b980e6
|
|
7
|
+
data.tar.gz: e5004d4aea1edb6b2d86c49923457378842fcae37aa955b456001883f18cd97201be2a1f7253470e00cef2e105c2eebdd95bb6ff62e72d840e938b11d54a0b48
|
data/README.md
CHANGED
|
@@ -251,6 +251,8 @@ class WebhooksController < ApplicationController
|
|
|
251
251
|
SyncProductsJob.perform_later
|
|
252
252
|
when Pobo::WebhookEvent::CATEGORIES_UPDATE
|
|
253
253
|
SyncCategoriesJob.perform_later
|
|
254
|
+
when Pobo::WebhookEvent::BLOGS_UPDATE
|
|
255
|
+
SyncBlogsJob.perform_later
|
|
254
256
|
end
|
|
255
257
|
|
|
256
258
|
render json: { status: 'ok' }
|
|
@@ -273,7 +275,7 @@ payload = handler.handle(
|
|
|
273
275
|
### Webhook Payload
|
|
274
276
|
|
|
275
277
|
```ruby
|
|
276
|
-
payload.event # String: "products.update" or "
|
|
278
|
+
payload.event # String: "products.update", "categories.update", or "blogs.update"
|
|
277
279
|
payload.timestamp # Time
|
|
278
280
|
payload.eshop_id # Integer
|
|
279
281
|
```
|
|
@@ -336,6 +338,19 @@ name.to_hash # => { 'default' => '...', 'cs' => '...', ...
|
|
|
336
338
|
| `each_category(last_update_from:, is_edited:)` | Iterate all categories |
|
|
337
339
|
| `each_blog(last_update_from:, is_edited:)` | Iterate all blogs |
|
|
338
340
|
|
|
341
|
+
## Limits
|
|
342
|
+
|
|
343
|
+
| Limit | Value |
|
|
344
|
+
|------------------------------|--------------|
|
|
345
|
+
| Max items per import request | 100 |
|
|
346
|
+
| Max items per export page | 100 |
|
|
347
|
+
| Product/Category ID length | 255 chars |
|
|
348
|
+
| Name length | 250 chars |
|
|
349
|
+
| URL length | 255 chars |
|
|
350
|
+
| Image URL length | 650 chars |
|
|
351
|
+
| Description length | 65,000 chars |
|
|
352
|
+
| SEO description length | 500 chars |
|
|
353
|
+
|
|
339
354
|
## Development
|
|
340
355
|
|
|
341
356
|
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests.
|
data/lib/pobo/dto/blog.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Pobo
|
|
|
40
40
|
def self.from_hash(hash)
|
|
41
41
|
new(
|
|
42
42
|
id: hash["id"] || hash[:id],
|
|
43
|
-
is_visible: hash["is_visible"]
|
|
43
|
+
is_visible: hash.key?("is_visible") ? hash["is_visible"] : hash[:is_visible],
|
|
44
44
|
name: LocalizedString.from_hash(hash["name"] || hash[:name]),
|
|
45
45
|
url: LocalizedString.from_hash(hash["url"] || hash[:url]),
|
|
46
46
|
category: hash["category"] || hash[:category],
|
|
@@ -49,7 +49,7 @@ module Pobo
|
|
|
49
49
|
seo_description: LocalizedString.from_hash(hash["seo_description"] || hash[:seo_description]),
|
|
50
50
|
content: Content.from_hash(hash["content"] || hash[:content]),
|
|
51
51
|
images: hash["images"] || hash[:images] || [],
|
|
52
|
-
is_loaded: hash["is_loaded"]
|
|
52
|
+
is_loaded: hash.key?("is_loaded") ? hash["is_loaded"] : hash[:is_loaded],
|
|
53
53
|
created_at: parse_time(hash["created_at"] || hash[:created_at]),
|
|
54
54
|
updated_at: parse_time(hash["updated_at"] || hash[:updated_at])
|
|
55
55
|
)
|
data/lib/pobo/dto/category.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Pobo
|
|
|
40
40
|
def self.from_hash(hash)
|
|
41
41
|
new(
|
|
42
42
|
id: hash["id"] || hash[:id],
|
|
43
|
-
is_visible: hash["is_visible"]
|
|
43
|
+
is_visible: hash.key?("is_visible") ? hash["is_visible"] : hash[:is_visible],
|
|
44
44
|
name: LocalizedString.from_hash(hash["name"] || hash[:name]),
|
|
45
45
|
url: LocalizedString.from_hash(hash["url"] || hash[:url]),
|
|
46
46
|
description: LocalizedString.from_hash(hash["description"] || hash[:description]),
|
|
@@ -49,7 +49,7 @@ module Pobo
|
|
|
49
49
|
content: Content.from_hash(hash["content"] || hash[:content]),
|
|
50
50
|
images: hash["images"] || hash[:images] || [],
|
|
51
51
|
guid: hash["guid"] || hash[:guid],
|
|
52
|
-
is_loaded: hash["is_loaded"]
|
|
52
|
+
is_loaded: hash.key?("is_loaded") ? hash["is_loaded"] : hash[:is_loaded],
|
|
53
53
|
created_at: parse_time(hash["created_at"] || hash[:created_at]),
|
|
54
54
|
updated_at: parse_time(hash["updated_at"] || hash[:updated_at])
|
|
55
55
|
)
|
data/lib/pobo/dto/product.rb
CHANGED
|
@@ -48,7 +48,7 @@ module Pobo
|
|
|
48
48
|
def self.from_hash(hash)
|
|
49
49
|
new(
|
|
50
50
|
id: hash["id"] || hash[:id],
|
|
51
|
-
is_visible: hash["is_visible"]
|
|
51
|
+
is_visible: hash.key?("is_visible") ? hash["is_visible"] : hash[:is_visible],
|
|
52
52
|
name: LocalizedString.from_hash(hash["name"] || hash[:name]),
|
|
53
53
|
url: LocalizedString.from_hash(hash["url"] || hash[:url]),
|
|
54
54
|
short_description: LocalizedString.from_hash(hash["short_description"] || hash[:short_description]),
|
|
@@ -60,7 +60,7 @@ module Pobo
|
|
|
60
60
|
categories_ids: hash["categories_ids"] || hash[:categories_ids] || [],
|
|
61
61
|
parameters_ids: hash["parameters_ids"] || hash[:parameters_ids] || [],
|
|
62
62
|
guid: hash["guid"] || hash[:guid],
|
|
63
|
-
is_loaded: hash["is_loaded"]
|
|
63
|
+
is_loaded: hash.key?("is_loaded") ? hash["is_loaded"] : hash[:is_loaded],
|
|
64
64
|
categories: hash["categories"] || hash[:categories] || [],
|
|
65
65
|
created_at: parse_time(hash["created_at"] || hash[:created_at]),
|
|
66
66
|
updated_at: parse_time(hash["updated_at"] || hash[:updated_at])
|
|
@@ -4,8 +4,9 @@ module Pobo
|
|
|
4
4
|
module WebhookEvent
|
|
5
5
|
PRODUCTS_UPDATE = "products.update"
|
|
6
6
|
CATEGORIES_UPDATE = "categories.update"
|
|
7
|
+
BLOGS_UPDATE = "blogs.update"
|
|
7
8
|
|
|
8
|
-
ALL = [PRODUCTS_UPDATE, CATEGORIES_UPDATE].freeze
|
|
9
|
+
ALL = [PRODUCTS_UPDATE, CATEGORIES_UPDATE, BLOGS_UPDATE].freeze
|
|
9
10
|
|
|
10
11
|
def self.valid?(event)
|
|
11
12
|
ALL.include?(event)
|
data/lib/pobo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pobo-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pobo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|