hephaestus 0.6.1 → 0.6.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: b58de861c02e9f029be16c4ffc63a7d328569e00d17b620fe192cbc9c4788579
4
- data.tar.gz: 634c07e912d979106ff8eefc6eaed83c4331321652754edd95f6ee87af2e6706
3
+ metadata.gz: 8ee150804d80090a603c52698b45937f96bbd8bf52d13f295f68471831b2e69b
4
+ data.tar.gz: de6060aa80ddfd82cc2d122cb8c0b941c1fd6fa70fce4d44190aec6ff91ad779
5
5
  SHA512:
6
- metadata.gz: f1517fe22cb5f81eca885f702051a9546aa3088e3cad6d3159190f9673368a601b59cd243505380bd6129cbdcc3ba9e1ddb8e771c90722efabfe51d534793277
7
- data.tar.gz: a3d9dffb9397754e98696bb1c1ca10718026aeb5580a36342298da0e61476e0c78dbf16429a03823cd673fba8bdbdd56121d1b184098dd93195e174eb6a4ba1a
6
+ metadata.gz: 8b022f681eccc353d032f1f5799b8412d13d69dbcfdbc080d526d2f8f40817c44653f77ef9f901449c1b6fcd658f187bf6092fb54e32e3df8b60ad8b321e7720
7
+ data.tar.gz: 8c95113092f22e23f201c17d0bef1ff71cfb7ad10f5ef44acd6370f847f69970e980ceae58e8f697bbd9427fdc5bd9196b68d68b5c84885987701520275baf7a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [v0.6.2] - 19-06-2024
2
+ ## What's Changed
3
+ * Use Ruby test suite by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/18
4
+ * Catch up with plug updates by @balevine in https://github.com/yettoapp/hephaestus/pull/17
5
+
6
+
7
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.6.1...v0.6.2
8
+ ## [v0.6.1] - 12-02-2024
9
+ ## What's Changed
10
+ * Port recent Ruby, TOML, and OpenAPI changes by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/16
11
+
12
+
13
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.6.0...v0.6.1
1
14
  ## [v0.6.0] - 19-12-2023
2
15
  ## What's Changed
3
16
  * Remove switch logic from plugs by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/15
@@ -196,7 +196,7 @@ module Hephaestus
196
196
  strip_blank_lines_between_setter_calls(node.children)
197
197
 
198
198
  node.children.each do |child_node|
199
- send("on_#{child_node.type}", child_node)
199
+ send(:"on_#{child_node.type}", child_node)
200
200
  end
201
201
  end
202
202
 
@@ -164,7 +164,7 @@ module Hephaestus
164
164
 
165
165
  replace_in_files(destination_root, "PlugApp", app_name.underscore.camelcase)
166
166
  replace_in_files(destination_root, "plug-app", app_name.dasherize)
167
- replace_in_files("destination_root}/.github/workflows/test.yml", "plug-app", app_name.dasherize)
167
+ replace_in_files("#{destination_root}/.github/workflows", "plug-app", app_name.dasherize)
168
168
  replace_in_files(destination_root, "PLUG_APP", app_name.underscore.upcase)
169
169
  replace_in_files(destination_root, "plug_app", app_name.underscore)
170
170
 
@@ -29,7 +29,7 @@ module Hephaestus
29
29
  raltie_overload = <<~CONFIG
30
30
 
31
31
  # Load dotenv only in development environment
32
- Dotenv::Railtie.overload if Rails.env.development?
32
+ Dotenv::Rails.overwrite = true if Rails.env.development?
33
33
  CONFIG
34
34
  inject_into_file(
35
35
  "config/application.rb",
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.6.1"
5
+ VERSION = "0.6.2"
6
6
  RAILS_VERSION = "~> 7.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
Binary file
@@ -6,9 +6,11 @@ on:
6
6
 
7
7
  jobs:
8
8
  ruby:
9
- uses: yettoapp/actions/.github/workflows/ruby_test_suite.yml@main
9
+ uses: yettoapp/actions/.github/workflows/rails_test_suite.yml@main
10
10
  secrets:
11
11
  gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
12
+ with:
13
+ system_tests: false
12
14
 
13
15
  docker:
14
16
  uses: yettoapp/actions/.github/workflows/test_dockerbuild.yml@main
@@ -7,116 +7,123 @@ module BodyParameter
7
7
 
8
8
  sig { returns(String) }
9
9
  def bparam_organization_id
10
- plug_installation_params[:organization][:id]
10
+ plug_installation_params[:yetto][:organization][:id]
11
11
  end
12
12
 
13
13
  sig { returns(String) }
14
14
  def bparam_inbox_id
15
- plug_installation_params[:inbox][:id]
15
+ plug_installation_params[:yetto][:inbox][:id]
16
16
  end
17
17
 
18
18
  sig { returns(String) }
19
19
  def bparam_plug_installation_id
20
- plug_installation_params[:plug_installation][:id]
20
+ plug_installation_params[:yetto][:plug_installation][:id]
21
21
  end
22
22
 
23
23
  sig { returns(String) }
24
24
  def bparam_plug_id
25
- plug_installation_params[:plug][:id]
25
+ plug_installation_params[:yetto][:plug][:id]
26
26
  end
27
27
 
28
28
  sig { returns(T::Hash[Symbol, String]) }
29
29
  def bparam_plug_installation_settings
30
- plug_installation_params[:plug_installation][:settings]
30
+ plug_installation_params[:yetto][:plug_installation][:settings]
31
31
  end
32
32
 
33
33
  sig { returns(T::Hash[Symbol, String]) }
34
34
  def plug_installation_params
35
35
  return {} if params.blank?
36
36
 
37
- plug_installation = params.fetch(:plug_installation, {})
37
+ yetto_params = params.fetch(:yetto, {})
38
+ plug_installation = yetto_params.fetch(:plug_installation, {})
39
+
38
40
  plug_installation_id = plug_installation.fetch(:id, "")
39
41
  settings = plug_installation.fetch(:settings, {}).to_unsafe_hash
40
42
 
41
- organization_id = params.fetch(:organization, {}).fetch(:id, "")
42
- plug_id = params.fetch(:plug, {}).fetch(:id, "")
43
- inbox_id = params.fetch(:inbox, {}).fetch(:id, "")
43
+ organization_id = yetto_params.fetch(:organization, {}).fetch(:id, "")
44
+ plug_id = yetto_params.fetch(:plug, {}).fetch(:id, "")
45
+ inbox_id = yetto_params.fetch(:inbox, {}).fetch(:id, "")
44
46
 
45
47
  {
46
- plug_installation: {
47
- id: plug_installation_id,
48
- settings: settings,
49
- },
50
- organization: {
51
- id: organization_id,
52
- },
53
- plug: {
54
- id: plug_id,
55
- },
56
- inbox: {
57
- id: inbox_id,
48
+ yetto: {
49
+ plug_installation: {
50
+ id: plug_installation_id,
51
+ settings: settings,
52
+ },
53
+ organization: {
54
+ id: organization_id,
55
+ },
56
+ plug: {
57
+ id: plug_id,
58
+ },
59
+ inbox: {
60
+ id: inbox_id,
61
+ },
58
62
  },
59
63
  }
60
64
  end
61
65
 
62
66
  sig { returns(String) }
63
67
  def bparam_message_id
64
- message_params[:message][:id]
68
+ message_params[:yetto][:message][:id]
65
69
  end
66
70
 
67
71
  sig { returns(String) }
68
72
  def bparam_message_text_content
69
- message_params[:message][:text_content]
73
+ message_params[:yetto][:message][:text_content]
70
74
  end
71
75
 
72
76
  sig { returns(String) }
73
77
  def bparam_message_conversation_id
74
- message_params[:message][:conversation][:id]
78
+ message_params[:yetto][:message][:conversation][:id]
75
79
  end
76
80
 
77
81
  sig { returns(String) }
78
82
  def bparam_message_conversation_title
79
- message_params[:message][:conversation][:title]
83
+ message_params[:yetto][:message][:conversation][:title]
80
84
  end
81
85
 
82
86
  sig { returns(String) }
83
87
  def bparam_message_author_name
84
- message_params[:message].fetch(:author, {}).fetch(:name, "Noone")
88
+ message_params[:yetto][:message].fetch(:author, {}).fetch(:name, "Noone")
85
89
  end
86
90
 
87
91
  sig { returns(T::Hash[Symbol, String]) }
88
92
  def bparam_message_metadata
89
- message_params[:message][:metadata]
93
+ message_params[:yetto][:message][:metadata]
90
94
  end
91
95
 
92
96
  sig { returns(T::Hash[Symbol, String]) }
93
97
  def message_params
94
98
  return {} if params.blank?
95
99
 
96
- message = params.fetch(:message, {})
100
+ yetto_params = params.fetch(:yetto, {})
101
+ message = yetto_params.fetch(:message, {})
97
102
  message_id = message.fetch(:id, "")
98
103
  text_content = message.fetch(:text_content, "")
99
104
  conversation = message.fetch(:conversation, {})
100
105
  conversation_id = conversation.fetch(:id, "")
101
106
  title = conversation.fetch(:title, "")
102
- created_by_user = message.fetch(:created_by_user, {})
107
+ created_by_membership = message.fetch(:created_by_membership, {})
103
108
  created_by_plug = message.fetch(:created_by_plug, {})
104
- author = created_by_user.presence || created_by_plug
109
+ author = created_by_membership.fetch(:user) || created_by_plug
105
110
  name = author.fetch(:name, "")
106
111
  metadata = message.fetch(:metadata, {}).to_unsafe_hash
107
112
 
108
113
  {
109
- message: {
110
- id: message_id,
111
- text_content: text_content,
112
- conversation: {
113
- id: conversation_id,
114
- title: title,
115
- },
116
- author: {
117
- name: name,
114
+ yetto: {
115
+ message: {
116
+ id: message_id,
117
+ text_content: text_content,
118
+ conversation: {
119
+ id: conversation_id,
120
+ title: title,
121
+ },
122
+ author: {
123
+ name: name,
124
+ },
125
+ metadata: metadata,
118
126
  },
119
- metadata: metadata,
120
127
  },
121
128
  }
122
129
  end
@@ -1,5 +1,3 @@
1
- version: "3.8"
2
-
3
1
  services:
4
2
  redis-db:
5
3
  image: redis:7-bookworm
@@ -1,5 +1,6 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
+
3
4
  # Be sure to restart your server when you modify this file.
4
5
 
5
6
  # Avoid CORS issues when API is called from the frontend app.
@@ -2,98 +2,77 @@
2
2
  "CreateAppMessage": {
3
3
  "type": "object",
4
4
  "required": [
5
- "plug_installation",
6
- "message",
7
- "inbox"
5
+ "yetto"
8
6
  ],
9
7
  "properties": {
10
- "plug_installation": {
8
+ "yetto": {
11
9
  "type": "object",
12
10
  "required": [
13
- "id",
14
- "settings"
11
+ "plug_installation",
12
+ "message"
15
13
  ],
16
14
  "properties": {
17
- "id": {
18
- "type": "string",
19
- "pattern": "^(?:pli)_[A-Z0-9]{26}$"
20
- },
21
- "settings": {
22
- "type": "object",
23
- "required": [],
24
- "properties": {}
25
- }
26
- }
27
- },
28
- "inbox": {
29
- "type": "object",
30
- "required": [
31
- "id",
32
- "organization"
33
- ],
34
- "properties": {
35
- "id": {
36
- "type": "string",
37
- "pattern": "^(?:ibx)_[A-Z0-9]{26}$"
38
- },
39
- "organization": {
15
+ "plug_installation": {
40
16
  "type": "object",
41
17
  "required": [
42
18
  "id",
43
- "status"
19
+ "settings"
44
20
  ],
45
21
  "properties": {
46
22
  "id": {
47
23
  "type": "string",
48
- "pattern": "^(?:org)_[A-Z0-9]{26}$"
24
+ "pattern": "^(?:pli)_[A-Z0-9]{26}$"
49
25
  },
50
- "status": {
51
- "type": "string"
26
+ "settings": {
27
+ "type": "object",
28
+ "required": [],
29
+ "properties": {}
52
30
  }
53
31
  }
54
- }
55
- }
56
- },
57
- "message": {
58
- "type": "object",
59
- "required": [
60
- "id",
61
- "conversation",
62
- "text_content",
63
- "metadata"
64
- ],
65
- "properties": {
66
- "id": {
67
- "type": "string",
68
- "pattern": "^(?:msg)_[A-Z0-9]{26}$"
69
- },
70
- "text_content": {
71
- "type": "string"
72
- },
73
- "metadata": {
74
- "type": "object"
75
32
  },
76
- "conversation": {
33
+ "message": {
77
34
  "type": "object",
78
35
  "required": [
79
36
  "id",
80
- "title",
37
+ "conversation",
38
+ "text_content",
81
39
  "metadata"
82
40
  ],
83
41
  "properties": {
84
42
  "id": {
85
43
  "type": "string",
86
- "pattern": "^(?:cnv)_[A-Z0-9]{26}$"
44
+ "pattern": "^(?:msg)_[A-Z0-9]{26}$"
87
45
  },
88
- "title": {
46
+ "text_content": {
89
47
  "type": "string"
90
48
  },
91
49
  "metadata": {
92
50
  "type": "object"
51
+ },
52
+ "conversation": {
53
+ "type": "object",
54
+ "required": [
55
+ "id",
56
+ "title",
57
+ "metadata"
58
+ ],
59
+ "properties": {
60
+ "id": {
61
+ "type": "string",
62
+ "pattern": "^(?:cnv)_[A-Z0-9]{26}$"
63
+ },
64
+ "title": {
65
+ "type": "string"
66
+ },
67
+ "metadata": {
68
+ "type": "object"
69
+ }
70
+ }
93
71
  }
94
72
  }
95
73
  }
96
- }
74
+ },
75
+ "additionalProperties": false
97
76
  }
98
77
  },
99
78
  "additionalProperties": false
@@ -101,65 +80,35 @@
101
80
  "ConfigureApp": {
102
81
  "type": "object",
103
82
  "required": [
104
- "plug_installation",
105
- "organization",
106
- "plug",
107
- "inbox"
83
+ "yetto"
108
84
  ],
109
85
  "properties": {
110
- "plug_installation": {
86
+ "yetto": {
111
87
  "type": "object",
112
88
  "required": [
113
- "id",
114
- "settings"
89
+ "plug_installation",
115
90
  ],
116
91
  "properties": {
117
- "id": {
118
- "type": "string",
119
- "pattern": "^(?:pli)_[A-Z0-9]{26}$"
120
- },
121
- "settings": {
92
+ "plug_installation": {
122
93
  "type": "object",
123
- "required": [],
124
- "properties": {}
125
- }
126
- }
127
- },
128
- "organization": {
129
- "type": "object",
130
- "required": [
131
- "id"
132
- ],
133
- "properties": {
134
- "id": {
135
- "type": "string",
136
- "pattern": "^(?:org)_[A-Z0-9]{26}$"
137
- }
138
- }
139
- },
140
- "plug": {
141
- "type": "object",
142
- "required": [
143
- "id"
144
- ],
145
- "properties": {
146
- "id": {
147
- "type": "string",
148
- "pattern": "^(?:plg)_[A-Z0-9]{26}$"
149
- }
150
- }
151
- },
152
- "inbox": {
153
- "type": "object",
154
- "required": [
155
- "id"
156
- ],
157
- "properties": {
158
- "id": {
159
- "type": "string",
160
- "pattern": "^(?:ibx)_[A-Z0-9]{26}$"
94
+ "required": [
95
+ "id",
96
+ "settings"
97
+ ],
98
+ "properties": {
99
+ "id": {
100
+ "type": "string",
101
+ "pattern": "^(?:pli)_[A-Z0-9]{26}$"
102
+ },
103
+ "settings": {
104
+ "type": "object",
105
+ "required": [],
106
+ "properties": {}
107
+ }
108
+ }
161
109
  }
162
- }
110
+ },
111
+ "additionalProperties": false
163
112
  }
164
113
  },
165
114
  "additionalProperties": false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,7 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
- force_ruby_platform: false
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rails
44
43
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +52,6 @@ dependencies:
53
52
  - - "~>"
54
53
  - !ruby/object:Gem::Version
55
54
  version: '7.0'
56
- force_ruby_platform: false
57
55
  - !ruby/object:Gem::Dependency
58
56
  name: rainbow
59
57
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +66,6 @@ dependencies:
68
66
  - - "~>"
69
67
  - !ruby/object:Gem::Version
70
68
  version: '3.0'
71
- force_ruby_platform: false
72
69
  - !ruby/object:Gem::Dependency
73
70
  name: minitest
74
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +97,7 @@ dependencies:
100
97
  description: 'Hephaestus is a Rails generator to create plugs for Yetto.
101
98
 
102
99
  '
103
- email:
100
+ email:
104
101
  executables:
105
102
  - hephaestus
106
103
  extensions: []
@@ -130,6 +127,7 @@ files:
130
127
  - lib/hephaestus/version.rb
131
128
  - templates/.dockerignore
132
129
  - templates/.env.sample
130
+ - templates/.github/.DS_Store
133
131
  - templates/.github/dependabot.yml
134
132
  - templates/.github/workflows/automerge.yml
135
133
  - templates/.github/workflows/deploy.yml
@@ -233,7 +231,7 @@ homepage: http://github.com/yettoapp/hephaestus
233
231
  licenses:
234
232
  - MIT
235
233
  metadata: {}
236
- post_install_message:
234
+ post_install_message:
237
235
  rdoc_options:
238
236
  - "--charset=UTF-8"
239
237
  require_paths:
@@ -249,8 +247,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
247
  - !ruby/object:Gem::Version
250
248
  version: 3.4.7
251
249
  requirements: []
252
- rubygems_version: 3.5.6
253
- signing_key:
250
+ rubygems_version: 3.5.9
251
+ signing_key:
254
252
  specification_version: 4
255
253
  summary: Generate a Rails app that can be used to create plugs for Yetto.
256
254
  test_files: []