easy-resources 0.10.1 → 1.0.2

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: 29cce503c0d0908bb6a5bd6816fda1add2f38ae73e9b69eb4fb1f81e0106c3d4
4
- data.tar.gz: d5e6499693d14816b6d986fb7c892b9cec455d4d22216e5cac9d47d8b9211fb9
3
+ metadata.gz: 73b8b62272d316495b8965f0e417f2b311e5fbe12de71dd73c11f6c4de73fb08
4
+ data.tar.gz: c7611434906239211072702fc74c0b162fab3605d3cb6e52d2189e54a0389559
5
5
  SHA512:
6
- metadata.gz: 54620a9d039d0932dd32be642445592340f0d7ad1b3c943f909a76b84f133ea29ed78faaf18697d9f9e9d17cc50569a504310ee9fb5ed68b2c791f63a8721f82
7
- data.tar.gz: f472afbf20f03bf5828040e0283df010bb1f86540fc6fd2231abcdfbd96af4e0a0eb9726cd40992379c9c478fe0e17a5a2a04d7e24b793a4136e7de655686c3a
6
+ metadata.gz: 0df08d01925bbf03516218add41fb05ccd0843edd3ef3067339605f288708e0a4b1c75aab5f279a5ce1f35b2104210ca9edaaaa49dda6dfb7d27b6246e39a71e
7
+ data.tar.gz: e50f75ca41fd866d9df80e07759c087b58272cb31449f8b309713c52c7a5de5442e146343a1caa91828a6e000ab9b61c76ec3387efd2904d983afb00717f28c6
data/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ## [1.0.2] - 2024-02-27
9
+ ### Added
10
+ - EWA's extra_env_variables hash | [@lukas](https://git.easy.cz/lukas)
11
+ - Chain and Chroma images to EasyWebApplication | [@jiri.vojta](https://git.easy.cz/jiri.vojta)
12
+
13
+ ## [1.0.0] - 2023-07-03
14
+ ### Changed
15
+ - update activeresources
16
+
8
17
  ## [0.10.1] - 2021-09-03
9
18
  ### Added
10
19
  - rexml gem as a dependency (because of XML requests)
@@ -18,6 +18,9 @@ module Easy
18
18
  expire_at: :date,
19
19
  custom_repository: :boolean,
20
20
  custom_domain: :boolean,
21
+ internal_user_limit: :integer,
22
+ chromadb_docker_image: :string,
23
+ easy_ai_chain_docker_image: :string,
21
24
  }
22
25
 
23
26
  belongs_to :easy_contact, class_name: 'Easy::Resources::Redmine::EasyContact'
@@ -45,6 +48,14 @@ module Easy
45
48
  custom_fields.find { |cf| cf.internal_name == "application_updates_on_request" }&.cast_value
46
49
  end
47
50
 
51
+ # @return [Hash]
52
+ def extra_env_variables
53
+ value = attributes["extra_env_variables"] || {}
54
+ return value.attributes if value.respond_to? :attributes
55
+
56
+ value
57
+ end
58
+
48
59
  end
49
60
  end
50
61
  end
@@ -28,7 +28,7 @@ module Easy
28
28
  # Parse value of TOTAL amount of entities from headers or response
29
29
  # @return [Integer]
30
30
  def retrieve_total(response)
31
- (response['Total'] || response.body[/total_count[:="]+(\d+)/] && Regexp.last_match(1)).to_i
31
+ (response['Total'] || (response.body[/total_count[:="]+(\d+)/] && Regexp.last_match(1))).to_i
32
32
  end
33
33
 
34
34
  def get_all(**params, &block)
@@ -1,7 +1,7 @@
1
1
  module Easy
2
2
  module Resources
3
3
 
4
- VERSION = '0.10.1'
4
+ VERSION = '1.0.2'
5
5
 
6
6
  end
7
7
  end
@@ -49,6 +49,10 @@
49
49
  "value": "0"
50
50
  }
51
51
  ],
52
- "plugins": []
52
+ "plugins": [],
53
+ "extra_env_variables": {
54
+ "OPENAI_API_KEY": "secret-key",
55
+ "EASY_AI_JWT_SECRET": "token0001"
56
+ }
53
57
  }
54
58
  }
@@ -21,4 +21,5 @@
21
21
  </custom_fields>
22
22
  <created_at>2018-03-22T09:10:47Z</created_at>
23
23
  <updated_at>2018-05-24T10:55:28Z</updated_at>
24
+ <extra_env_variables OPENAI_API_KEY="secret-key" EASY_AI_JWT_SECRET="token0001"/>
24
25
  </easy_web_application>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <easy_web_application>
3
+ <id>65739</id>
4
+ <easy_external_id>3955</easy_external_id>
5
+ <application_type>trial</application_type>
6
+ <url>lukas.easyproject.cz</url>
7
+ <status>running</status>
8
+ <monitored>false</monitored>
9
+ <version>2017.1.3 (03.02)</version>
10
+ <easy_server id="22" host_name="bigdemo.cz" type="application" server_type="bigdemo"/>
11
+ <author id="14" name="Anonymní"/>
12
+ <internal_user_limit>0</internal_user_limit>
13
+ <git_repository type="string">git@git.easy.cz:package.git</git_repository>
14
+ <custom_fields type="array">
15
+ <custom_field id="695" name="Move on-request" internal_name="application_move_on_request" field_format="bool">
16
+ <value>1</value>
17
+ </custom_field>
18
+ <custom_field id="463" name="Updates on-request" internal_name="application_updates_on_request" field_format="bool">
19
+ <value>0</value>
20
+ </custom_field>
21
+ </custom_fields>
22
+ <created_at>2018-03-22T09:10:47Z</created_at>
23
+ <updated_at>2018-05-24T10:55:28Z</updated_at>
24
+ </easy_web_application>
@@ -67,4 +67,31 @@ RSpec.describe Easy::Resources::Redmine::EasyWebApplication do
67
67
  is_expected.to be_falsey
68
68
  end
69
69
  end
70
+
71
+ describe "#extra_env_variables" do
72
+ subject { find_entity.extra_env_variables }
73
+ it { is_expected.to be_a Hash }
74
+
75
+ it "check hash in json" do
76
+ expect(find_entity.as_json["easy_web_application"]).to include("extra_env_variables" => { "EASY_AI_JWT_SECRET" => "token0001", "OPENAI_API_KEY" => "secret-key" })
77
+ end
78
+
79
+ it "if ewa has no extra_env_Variables yet" do
80
+ ewa = find_entity("without_extra_env_variables")
81
+ expect(ewa.extra_env_variables).to eq({})
82
+ end
83
+ end
84
+
85
+ describe "#extra_env_variables=" do
86
+ let(:entity) { find_entity }
87
+ before { entity.extra_env_variables = { "CHAIN_LIMIT" => "two-hands" } }
88
+
89
+ it "should be a hash" do
90
+ expect(entity.extra_env_variables).to be_a Hash
91
+ end
92
+
93
+ it "check hash in json" do
94
+ expect(entity.as_json["easy_web_application"]).to include("extra_env_variables" => { "CHAIN_LIMIT" => "two-hands" })
95
+ end
96
+ end
70
97
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-03 00:00:00.000000000 Z
12
+ date: 2024-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeresource
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '5.1'
20
+ version: '6.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '5.1'
27
+ version: '6.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activeresource-response
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.2'
34
+ version: '1.4'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.2'
41
+ version: '1.4'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: railties
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,7 @@ files:
204
204
  - spec/fixtures/files/easy_web_application/with_easy_contact.xml
205
205
  - spec/fixtures/files/easy_web_application/with_easy_crm_case.xml
206
206
  - spec/fixtures/files/easy_web_application/with_ewaa.xml
207
+ - spec/fixtures/files/easy_web_application/without_extra_env_variables.xml
207
208
  - spec/fixtures/files/easy_web_hook/index.xml
208
209
  - spec/fixtures/files/easy_web_hook/show.xml
209
210
  - spec/fixtures/files/issue.json
@@ -252,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
253
  - !ruby/object:Gem::Version
253
254
  version: '0'
254
255
  requirements: []
255
- rubygems_version: 3.2.19
256
+ rubygems_version: 3.3.26
256
257
  signing_key:
257
258
  specification_version: 4
258
259
  summary: ActiveResources connectors for Easy Project / Easy Redmine
@@ -278,6 +279,7 @@ test_files:
278
279
  - spec/fixtures/files/easy_web_application/with_easy_contact.xml
279
280
  - spec/fixtures/files/easy_web_application/with_easy_crm_case.xml
280
281
  - spec/fixtures/files/easy_web_application/with_ewaa.xml
282
+ - spec/fixtures/files/easy_web_application/without_extra_env_variables.xml
281
283
  - spec/fixtures/files/easy_web_hook/index.xml
282
284
  - spec/fixtures/files/easy_web_hook/show.xml
283
285
  - spec/fixtures/files/issue/show.xml