zaikio-hub 0.13.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8871384444312b780a66e1756657180cec59ab6e07150ae9e3e9a0fa2bd436bf
4
- data.tar.gz: 3cdc2b2b8a67f04435739afde96fd7d24d3b800c3168d16d6a6fa3f350661211
3
+ metadata.gz: 21034ad19f960a61c6915992847982ea17569fd50d0db27ab65c3a2413c30d8b
4
+ data.tar.gz: f6875101f6e31151639c973198faad9f482082225aeafc222bef39f027e73db5
5
5
  SHA512:
6
- metadata.gz: 2bad5d02cdd35556265e045d104beaaa1cd2c9e57e69584ae5379dca4516611b004bec8b4763658c93d8f8e045b0d66091a94cd0cd3f227d94294cfd92bc5559
7
- data.tar.gz: 8749c277f88ff0df4fd68420db575806e034740f4b7fe20e7587d6b1766b218ff0d51d1de0091e46c2e85759674b2849e42838a9b0ed3d951bb46c12d290e950
6
+ metadata.gz: ac78ee6cb982a9c793888e1ac08685d140daf649ccf1567934021d2c19c9ec9fcba41b1e39bd2333c631f5cd35a02dc9d3c044f500beae6fa56402130fbb7b10
7
+ data.tar.gz: cc46a9f88015acb80c9360fc605d1732dd9654855caaa3f2bd4f80972e2e170698fa91c033db3292031dbaa7120f1165b73d35052c5660cebd8f2e117d2a0668
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.15.0] - 2023-04-12
11
+
12
+ * Add `capabilities` attribute to `Machine` and `Specialist`
13
+ * Add `Zaikio::Hub::Asset.capabilities` method for a list of all capabilities
14
+
15
+ ## [0.14.0] - 2023-04-03
16
+
17
+ * **BREAKING** Remove `Software` asset type
18
+ * **BREAKING** Remove `Asset#specification`
19
+
10
20
  ## [0.13.0] - 2023-03-24
11
21
 
12
22
  * Add `Zaikio::Hub::SubscriptionInvitation`
@@ -112,7 +122,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112
122
  ### Added
113
123
  - Added subscriptions (migration required)
114
124
 
115
- [Unreleased]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.13.0..HEAD
125
+ [Unreleased]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.15.0..HEAD
126
+ [0.15.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.14.0..v0.15.0
127
+ [0.14.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.13.0..v0.14.0
116
128
  [0.13.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.12.0..v0.13.0
117
129
  [0.12.0]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.11.2..v0.12.0
118
130
  [0.11.2]: https://github.com/zaikio/zaikio-hub-ruby/compare/v0.11.1..v0.11.2
data/README.md CHANGED
@@ -52,7 +52,6 @@ Zaikio::Hub.with_token(token) do
52
52
  # Note that .all understands pagination headers and will fetch all pages
53
53
  organization.members.all
54
54
  organization.machines.all
55
- organization.software.all
56
55
  organization.sites.all
57
56
  organization.sites.find('123')
58
57
  organization.business_relationships.all
@@ -0,0 +1,52 @@
1
+ de:
2
+ activemodel:
3
+ attributes:
4
+ "zaikio/hub/machine/capability":
5
+ ctp: CTP
6
+ digital_printing: Digitaldruck
7
+ digital_web_printing: Digitaler Rollendruck
8
+ inkjet_printing: Inkjet-Druck
9
+ inkjet_web_printing: Inkjet-Rollendruck
10
+ offset_printing: Offsetdruck
11
+ offset_uv_printing: UV-Offsetdruck
12
+ offset_uvle_printing: Offset-UVLE-Druck
13
+ offset_web_printing: Offset-Rollendruck
14
+ offset_web_uv_printing: Offset-Rollen-UV-Druck
15
+ offset_web_uvle_printing: Offset-Rollen-UVLE-Druck
16
+ flexo_printing: Flexodruck
17
+ letterpress_printing: Buchdruck
18
+ pad_printing: Tampondruck
19
+ pre_cutting: Vorschneiden
20
+ cutting: Schneiden
21
+ intermediate_cutting: Zwischenschneiden
22
+ folding: Falten
23
+ laminating: Laminieren
24
+ perfect_binding: Perfekte Bindung
25
+ hole_drilling: Löcher bohren
26
+ comb_binding: Kamm-Bindung
27
+ embossing: Prägen
28
+ engraving: Gravieren
29
+ foil_stamping: Folie prägen
30
+ gluing: Kleben
31
+ head_banding: Kopfbinden
32
+ perforating: Perforieren
33
+ ring_binding: Ringbindung
34
+ saddle_stitching: Sattelnaht
35
+ spiral_binding: Spiralbindung
36
+ strip_binding: Streifenbindung
37
+ thread_sewing: Fadenheftung
38
+ envelope_stuffing: Umschlag füllen
39
+ counting: Zählen
40
+ wrapping: Verpacken
41
+ boxing: Paketverpacken
42
+ shrink_wrapping: Schrumpffolienverpackung
43
+ addressing: Adressieren
44
+ franking: Frankieren
45
+ "zaikio/hub/specialist/capability":
46
+ envelope_stuffing: Umschlag füllen
47
+ counting: Zählen
48
+ wrapping: Verpacken
49
+ boxing: Paketverpacken
50
+ shrink_wrapping: Schrumpffolienverpackung
51
+ addressing: Adressieren
52
+ franking: Frankieren
@@ -0,0 +1,52 @@
1
+ en:
2
+ activemodel:
3
+ attributes:
4
+ "zaikio/hub/machine/capability":
5
+ ctp: CTP
6
+ digital_printing: Digital printing
7
+ digital_web_printing: Digital web printing
8
+ inkjet_printing: Inkjet printing
9
+ inkjet_web_printing: Inkjet web printing
10
+ offset_printing: Offset printing
11
+ offset_uv_printing: Offset UV printing
12
+ offset_uvle_printing: Offset UVLE printing
13
+ offset_web_printing: Offset web printing
14
+ offset_web_uv_printing: Offset web UV printing
15
+ offset_web_uvle_printing: Offset web UVLE printing
16
+ flexo_printing: Flexo printing
17
+ letterpress_printing: Letterpress printing
18
+ pad_printing: Pad printing
19
+ pre_cutting: Pre cutting
20
+ cutting: Cutting
21
+ intermediate_cutting: Intermediate cutting
22
+ folding: Folding
23
+ laminating: Laminating
24
+ perfect_binding: Perfect binding
25
+ hole_drilling: Hole drilling
26
+ comb_binding: Comb binding
27
+ embossing: Embossing
28
+ engraving: Engraving
29
+ foil_stamping: Foil stamping
30
+ gluing: Gluing
31
+ head_banding: Head banding
32
+ perforating: Perforating
33
+ ring_binding: Ring binding
34
+ saddle_stitching: Saddle stitching
35
+ spiral_binding: Spiral binding
36
+ strip_binding: Strip binding
37
+ thread_sewing: Thread sewing
38
+ envelope_stuffing: Envelope stuffing
39
+ counting: Counting
40
+ wrapping: Wrapping
41
+ boxing: Boxing
42
+ shrink_wrapping: Shrink wrapping
43
+ addressing: Addressing
44
+ franking: Franking
45
+ "zaikio/hub/specialist/capability":
46
+ envelope_stuffing: Envelope stuffing
47
+ counting: Counting
48
+ wrapping: Wrapping
49
+ boxing: Boxing
50
+ shrink_wrapping: Shrink wrapping
51
+ addressing: Addressing
52
+ franking: Franking
@@ -3,6 +3,19 @@ module Zaikio
3
3
  module Asset
4
4
  extend ActiveSupport::Concern
5
5
 
6
+ # Constants
7
+ def self.capabilities
8
+ %w[
9
+ ctp digital_printing digital_web_printing inkjet_printing inkjet_web_printing
10
+ offset_printing offset_uv_printing offset_uvle_printing offset_web_printing
11
+ offset_web_uv_printing offset_web_uvle_printing flexo_printing letterpress_printing
12
+ pad_printing pre_cutting cutting intermediate_cutting folding laminating perfect_binding
13
+ hole_drilling comb_binding embossing engraving foil_stamping gluing head_banding
14
+ perforating ring_binding saddle_stitching spiral_binding strip_binding thread_sewing
15
+ envelope_stuffing counting wrapping boxing shrink_wrapping addressing franking
16
+ ].freeze
17
+ end
18
+
6
19
  included do
7
20
  # Callbacks
8
21
  after_create :make_organization_owner
@@ -30,17 +43,6 @@ module Zaikio
30
43
  end
31
44
  end
32
45
 
33
- def specification
34
- prefix = if Zaikio::Hub.current_token_data.subject_type == "Person"
35
- "person/organizations/#{owner_id || organization_id}/"
36
- else
37
- ""
38
- end
39
- self.class.request(:get,
40
- "#{prefix}#{collection_name}/#{id}/#{singular_name}_specification")
41
- &.body&.dig("data")
42
- end
43
-
44
46
  private
45
47
 
46
48
  def collection_name
@@ -27,8 +27,6 @@ module Zaikio
27
27
  uri: "organization/memberships(/:id)"
28
28
  has_many :business_relationships, class_name: "Zaikio::Hub::BusinessRelationship",
29
29
  uri: "organization/business_relationships(/:id)"
30
- has_many :software, class_name: "Zaikio::Hub::Software",
31
- uri: "software(/:id)"
32
30
  has_many :machines, class_name: "Zaikio::Hub::Machine",
33
31
  uri: "machines(/:id)"
34
32
  has_many :specialists, class_name: "Zaikio::Hub::Specialist",
@@ -7,7 +7,7 @@ module Zaikio
7
7
  include_root_in_json :machine
8
8
 
9
9
  # Attributes
10
- attributes :name, :updated_at, :created_at, :site_id, :kind,
10
+ attributes :name, :updated_at, :created_at, :site_id, :kind, :capabilities,
11
11
  :manufacturer_id, :serial_number, :manufacturer, :owner_id
12
12
  end
13
13
  end
@@ -15,8 +15,6 @@ module Zaikio
15
15
  # Associations
16
16
  has_many :memberships, class_name: "Zaikio::Hub::Membership",
17
17
  uri: "person/organizations/:organization_id/memberships"
18
- has_many :software, class_name: "Zaikio::Hub::Software",
19
- uri: "person/organizations/:organization_id/software"
20
18
  has_many :machines, class_name: "Zaikio::Hub::Machine",
21
19
  uri: "person/organizations/:organization_id/machines"
22
20
  has_many :specialists, class_name: "Zaikio::Hub::Specialist",
@@ -7,7 +7,7 @@ module Zaikio
7
7
  include_root_in_json :specialist
8
8
 
9
9
  # Attributes
10
- attributes :name, :updated_at, :created_at, :site_id, :kind, :owner_id
10
+ attributes :name, :updated_at, :created_at, :site_id, :kind, :owner_id, :capabilities
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Hub
3
- VERSION = "0.13.0".freeze
3
+ VERSION = "0.15.0".freeze
4
4
  end
5
5
  end
data/lib/zaikio/hub.rb CHANGED
@@ -14,7 +14,6 @@ require "zaikio/hub/business_relationship"
14
14
  require "zaikio/hub/organization"
15
15
  require "zaikio/hub/person"
16
16
  require "zaikio/hub/machine"
17
- require "zaikio/hub/software"
18
17
  require "zaikio/hub/specialist"
19
18
  require "zaikio/hub/address"
20
19
  require "zaikio/hub/site"
@@ -43,6 +42,7 @@ module Zaikio
43
42
  yield(configuration)
44
43
 
45
44
  Base.connection = create_connection
45
+ I18n.load_path += Dir["#{File.expand_path('../../config/locales', __dir__)}/*.yml"]
46
46
  end
47
47
 
48
48
  def with_token(token, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - crispymtn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-03-24 00:00:00.000000000 Z
13
+ date: 2023-04-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby
@@ -26,6 +26,20 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: i18n
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: jwt
31
45
  requirement: !ruby/object:Gem::Requirement
@@ -133,6 +147,8 @@ files:
133
147
  - MIT-LICENSE
134
148
  - README.md
135
149
  - Rakefile
150
+ - config/locales/de.yml
151
+ - config/locales/en.yml
136
152
  - lib/zaikio/hub.rb
137
153
  - lib/zaikio/hub/address.rb
138
154
  - lib/zaikio/hub/app.rb
@@ -153,7 +169,6 @@ files:
153
169
  - lib/zaikio/hub/revoked_access_token.rb
154
170
  - lib/zaikio/hub/role.rb
155
171
  - lib/zaikio/hub/site.rb
156
- - lib/zaikio/hub/software.rb
157
172
  - lib/zaikio/hub/specialist.rb
158
173
  - lib/zaikio/hub/subscription.rb
159
174
  - lib/zaikio/hub/subscription_invitation.rb
@@ -1,20 +0,0 @@
1
- module Zaikio
2
- module Hub
3
- class Software < Base
4
- include Asset
5
-
6
- uri "software(/:id)"
7
- include_root_in_json :software
8
-
9
- # Attributes
10
- attributes :name, :updated_at, :created_at, :site_id, :kind, :owner_id,
11
- :vendor_id, :vendor
12
-
13
- private
14
-
15
- def collection_name
16
- "software"
17
- end
18
- end
19
- end
20
- end