moysklad 0.4.6 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3435d7c195bd20de53d97c82ac10d8269d94fc0e35a2e1aaf1330e5939ac28cb
4
- data.tar.gz: d6067f848aa3a3568d996a9c9f02537035661fbfb67a5f7cf24193c6114490c6
3
+ metadata.gz: 11853c0cd626e6f922838a5d91e0cb83a48092f359ddc8b1437374d0ccf0c29a
4
+ data.tar.gz: 61dbc0e2db3b56ba8ed1200dd8b2d91b5e7500a926bd32c839c92d2e73ce58a4
5
5
  SHA512:
6
- metadata.gz: 6847920c2dc4f7d99f9c45b77fe3d0e438cf606452e6cde86fe0c69846268d860ea23ffbcf759d9559acda614de7fa880921b54fcd839cc3cc96e36743118f21
7
- data.tar.gz: 82d5e908c6888f8abc700f400d3041b23d08b1642e6deec87a5074acd6327855231de5aac8fd5bf59bdcd855af03e8d2c386bd30a68883000b2c174833270d10
6
+ metadata.gz: 5aeaa2c2892de2abed0dcabe6f30a88428bbe0635a67a548330aa049af6b303be2743394ceb8e2a41f73407addaa9bc606b26b51ca8c4dd43b62dbec701b8759
7
+ data.tar.gz: c177b77a933b4ae86d18a353f7eb96d2a1e370707251cce96e22ef7138e04a531ef9aac159593fc7410e64ed784fd7a78bdd3e5575e72e0b0771d68f3a4c8be1
@@ -4,7 +4,6 @@ module Moysklad::Entities
4
4
  attribute :title, String
5
5
  attribute :filename, String
6
6
  attribute :size, Integer
7
-
8
7
  attribute :updated, Time
9
8
  attribute :miniature, Meta
10
9
  attribute :tiny, Meta
@@ -0,0 +1,15 @@
1
+ module Moysklad::Entities
2
+ class ImagesMeta < Base
3
+ attribute :href, String
4
+ attribute :type, String
5
+ attribute :mediaType, String
6
+ attribute :size, Integer
7
+ attribute :limit, Integer
8
+ attribute :offset, Integer
9
+ end
10
+
11
+ class Images < Base
12
+ attribute :meta, ImagesMeta
13
+ end
14
+ end
15
+
@@ -4,6 +4,7 @@ module Moysklad::Entities
4
4
  attribute :metadataHref, String
5
5
  attribute :type, String
6
6
  attribute :mediaType, String # application/json
7
+ attribute :downloadHref, String
7
8
 
8
9
  def id
9
10
  @id ||= href.split('/').last
@@ -17,7 +17,7 @@ module Moysklad::Entities
17
17
  attribute :buyPrice, Currency
18
18
  attribute :salePrices, Array[Price]
19
19
 
20
- attribute :image, Image
20
+ attribute :images, Images # MetaArray
21
21
 
22
22
  attribute :article, String
23
23
  attribute :weighed, Boolean
@@ -44,5 +44,9 @@ module Moysklad::Entities
44
44
  universe.features.where goodUuid: uuid
45
45
  end
46
46
  end
47
+
48
+ def product_images(universe)
49
+ Moysklad::Resources::ProductImages.new(client: universe.client, list_path: images.meta.href).list
50
+ end
47
51
  end
48
52
  end
@@ -17,6 +17,7 @@ module Moysklad
17
17
  price_type
18
18
  price
19
19
  image
20
+ images
20
21
  employee
21
22
  context
22
23
  product
@@ -0,0 +1,14 @@
1
+ module Moysklad::Resources
2
+ class ProductImages < Base
3
+ # Публичный чтобы был доступен из индекса
4
+ def cache_key
5
+ [list_path].join(':')
6
+ end
7
+
8
+ private
9
+
10
+ def item_path
11
+ raise
12
+ end
13
+ end
14
+ end
@@ -13,6 +13,7 @@ module Moysklad::Resources
13
13
  assortments
14
14
  custom_entities
15
15
  custom_entity_metadata
16
+ product_images
16
17
  embedded_entity_metadata
17
18
  where_filter
18
19
  indexed_cache
@@ -1,3 +1,3 @@
1
1
  module Moysklad
2
- VERSION = '0.4.6'
2
+ VERSION = '0.4.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moysklad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danil Pismenny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-19 00:00:00.000000000 Z
11
+ date: 2023-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -322,6 +322,7 @@ files:
322
322
  - lib/moysklad/entities/entity.rb
323
323
  - lib/moysklad/entities/group.rb
324
324
  - lib/moysklad/entities/image.rb
325
+ - lib/moysklad/entities/images.rb
325
326
  - lib/moysklad/entities/meta.rb
326
327
  - lib/moysklad/entities/organization.rb
327
328
  - lib/moysklad/entities/owner.rb
@@ -351,6 +352,7 @@ files:
351
352
  - lib/moysklad/resources/indexed_cache.rb
352
353
  - lib/moysklad/resources/load_all.rb
353
354
  - lib/moysklad/resources/positions.rb
355
+ - lib/moysklad/resources/product_images.rb
354
356
  - lib/moysklad/resources/products.rb
355
357
  - lib/moysklad/resources/stock.rb
356
358
  - lib/moysklad/resources/subresource.rb