lex-elastic_app_search 0.1.0 → 0.2.1

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: ba5beb19e8b1be44847c355f19f6d29333ec137d2361af8d1d576f918bdde2dc
4
- data.tar.gz: b85a04878343d8f8a444f786a82870b9e436211b87c06f3c8ee188aeebdec957
3
+ metadata.gz: 27f855161534b6a331b5a37caa8695b02d54630166146c2e8d1c7fd7f57a4039
4
+ data.tar.gz: 0374b8d958024f4da348676f22f28c613c02f366338226dffb0cf6fe67d1aca4
5
5
  SHA512:
6
- metadata.gz: ec63b23ef3a19742f9836417c9509b4ce03b67ca65271b2fdf2272cd00621d5a674ffedbd1fd29672da0be8a5601500d79de91a9f433ff4d7467079b0db8174a
7
- data.tar.gz: 68abe1e2565ba1835de2e6dcd4b830f5791c7b2186796685db4a93cd7b6f38fe51e209a0a4501437f9f691c4fe929606961338b99bf6de7e1282546722f12030
6
+ metadata.gz: 0f80fa145a3b82ae4220f154d81430206de16c7bf64898ece79366a577a5367c51ce9f24f13f6cc1c27ca1bfae14eb8535a8306e3d6669194aa8e12f012b5e21
7
+ data.tar.gz: 42fdf0890ecdff761d72a1c866ab621072fad17527ad3c1bfe0bc9cdd54a66796016cd98690b3299693e41cce3714ba6460bfdf707e3381959ec1b55558f9a12
@@ -0,0 +1,7 @@
1
+ # Auto-generated from team-config.yml
2
+ # Team: extensions
3
+ #
4
+ # To apply: scripts/apply-codeowners.sh lex-elastic_app_search
5
+
6
+ * @LegionIO/maintainers
7
+ * @LegionIO/extensions
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ open-pull-requests-limit: 5
9
+ labels:
10
+ - "type:dependencies"
11
+ - package-ecosystem: github-actions
12
+ directory: /
13
+ schedule:
14
+ interval: weekly
15
+ day: monday
16
+ open-pull-requests-limit: 5
17
+ labels:
18
+ - "type:dependencies"
@@ -0,0 +1,34 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ schedule:
7
+ - cron: '0 9 * * 1'
8
+
9
+ jobs:
10
+ ci:
11
+ uses: LegionIO/.github/.github/workflows/ci.yml@main
12
+
13
+ lint:
14
+ uses: LegionIO/.github/.github/workflows/lint-patterns.yml@main
15
+
16
+ security:
17
+ uses: LegionIO/.github/.github/workflows/security-scan.yml@main
18
+
19
+ version-changelog:
20
+ uses: LegionIO/.github/.github/workflows/version-changelog.yml@main
21
+
22
+ dependency-review:
23
+ uses: LegionIO/.github/.github/workflows/dependency-review.yml@main
24
+
25
+ stale:
26
+ if: github.event_name == 'schedule'
27
+ uses: LegionIO/.github/.github/workflows/stale.yml@main
28
+
29
+ release:
30
+ needs: [ci, lint]
31
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
32
+ uses: LegionIO/.github/.github/workflows/release.yml@main
33
+ secrets:
34
+ rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
data/.gitignore CHANGED
@@ -6,6 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
10
- # rspec failure tracking
11
9
  .rspec_status
10
+ Gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,23 +1,48 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.4
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+
1
6
  Layout/LineLength:
2
- Max: 120
7
+ Max: 160
8
+
9
+ Layout/SpaceAroundEqualsInParameterDefault:
10
+ EnforcedStyle: space
11
+
12
+ Layout/HashAlignment:
13
+ EnforcedHashRocketStyle: table
14
+ EnforcedColonStyle: table
15
+
3
16
  Metrics/MethodLength:
4
- Max: 30
17
+ Max: 50
18
+
5
19
  Metrics/ClassLength:
6
20
  Max: 1500
21
+
22
+ Metrics/ModuleLength:
23
+ Max: 1500
24
+
7
25
  Metrics/BlockLength:
8
- Max: 50
9
- Metrics/ParameterLists:
10
- Max: 10
11
- Layout/SpaceAroundEqualsInParameterDefault:
12
- EnforcedStyle: space
26
+ Max: 40
27
+
28
+ Metrics/AbcSize:
29
+ Max: 60
30
+
31
+ Metrics/CyclomaticComplexity:
32
+ Max: 15
33
+
34
+ Metrics/PerceivedComplexity:
35
+ Max: 17
36
+
13
37
  Style/Documentation:
14
38
  Enabled: false
15
- AllCops:
16
- TargetRubyVersion: 2.5
17
- NewCops: enable
39
+
40
+ Style/SymbolArray:
41
+ Enabled: true
42
+
18
43
  Style/FrozenStringLiteralComment:
19
- Enabled: false
44
+ Enabled: true
45
+ EnforcedStyle: always
46
+
20
47
  Naming/FileName:
21
48
  Enabled: false
22
- Style/ClassAndModuleChildren:
23
- Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## [0.2.1] - 2026-03-22
4
+
5
+ ### Changed
6
+ - Add legion-cache, legion-crypt, legion-data, legion-json, legion-logging, legion-settings, legion-transport as runtime dependencies
7
+ - Update spec_helper with real sub-gem helper stubs
8
+
9
+ ## [0.2.0] - 2026-03-15
10
+
11
+ ### Added
12
+ - Standalone `Client` class that includes all Runner modules and builds `Elastic::AppSearch::Client` from stored `@opts`
13
+ - Client specs covering initialization, default options, and runner method availability
14
+
15
+ ## [0.1.1] - 2026-03-13
16
+
17
+ ### Added
18
+ - Initial release
data/CLAUDE.md ADDED
@@ -0,0 +1,81 @@
1
+ # lex-elastic_app_search: Elastic App Search Integration for LegionIO
2
+
3
+ **Repository Level 3 Documentation**
4
+ - **Parent**: `/Users/miverso2/rubymine/legion/extensions-other/CLAUDE.md`
5
+ - **Grandparent**: `/Users/miverso2/rubymine/legion/CLAUDE.md`
6
+
7
+ ## Purpose
8
+
9
+ Legion Extension that connects to Elastic App Search. Provides runners for managing engines, documents, search, analytics, schemas, synonyms, curations, credentials, and click-through tracking.
10
+
11
+ **GitHub**: https://github.com/LegionIO/lex-elastic_app_search
12
+ **License**: MIT
13
+ **Version**: 0.2.1
14
+
15
+ ## Architecture
16
+
17
+ ```
18
+ Legion::Extensions::ElasticAppSearch
19
+ ├── Client # Standalone client: includes all runners, usable outside Legion runtime
20
+ ├── Runners/
21
+ │ ├── Analytics # Search analytics
22
+ │ ├── ClickThrough # Click-through tracking
23
+ │ ├── Credentials # API key management
24
+ │ ├── Curations # Search curations
25
+ │ ├── Documents # Document CRUD
26
+ │ ├── Engines # Engine management
27
+ │ ├── Schemas # Schema management
28
+ │ ├── Search # Search queries
29
+ │ └── Synonyms # Synonym sets
30
+ └── Helpers/
31
+ └── Client # Elastic::AppSearch::Client wrapper (used by runners in the Legion runtime)
32
+ ```
33
+
34
+ ## Standalone Usage
35
+
36
+ `Legion::Extensions::ElasticAppSearch::Client` can be instantiated directly without running the Legion framework:
37
+
38
+ ```ruby
39
+ client = Legion::Extensions::ElasticAppSearch::Client.new(
40
+ host: 'http://localhost:3002',
41
+ api_key: 'my-api-key'
42
+ )
43
+ client.list_engines
44
+ ```
45
+
46
+ The constructor accepts `host:` and `api_key:` kwargs (both optional; host defaults to `http://localhost:3002`). Each runner method builds a fresh `Elastic::AppSearch::Client` instance from the stored `@opts`.
47
+
48
+ ## Key Files
49
+
50
+ | Path | Purpose |
51
+ |------|---------|
52
+ | `lib/legion/extensions/elastic_app_search.rb` | Entry point, default settings (host: localhost:3002) |
53
+ | `lib/legion/extensions/elastic_app_search/client.rb` | Standalone client class including all runners |
54
+ | `lib/legion/extensions/elastic_app_search/helpers/client.rb` | Elastic App Search client (host_identifier + api_key) used by the runtime |
55
+ | `lib/legion/extensions/elastic_app_search/runners/` | All runners |
56
+
57
+ ## Dependencies
58
+
59
+ | Gem | Purpose |
60
+ |-----|---------|
61
+ | `elastic-app-search` | Official Elastic App Search Ruby client |
62
+
63
+ ## Configuration
64
+
65
+ Default settings:
66
+ - `host`: `http://localhost:3002`
67
+ - `api_key`: set per-call or via Legion settings
68
+
69
+ ## Development
70
+
71
+ 15 specs total.
72
+
73
+ ```bash
74
+ bundle install
75
+ bundle exec rspec
76
+ bundle exec rubocop
77
+ ```
78
+
79
+ ---
80
+
81
+ **Maintained By**: Matthew Iverson (@Esity)
data/Dockerfile ADDED
@@ -0,0 +1,9 @@
1
+ FROM legionio/legion:latest
2
+ LABEL maintainer="Matthew Iverson <matthewdiverson@gmail.com>"
3
+
4
+ RUN mkdir /etc/legionio
5
+ RUN apk update && apk add build-base tzdata gcc git
6
+
7
+ COPY . ./
8
+ RUN gem install lex-elastic_app_search --no-document --no-prerelease
9
+ CMD ruby --yjit $(which legionio)
data/Gemfile CHANGED
@@ -1,4 +1,12 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
- # Specify your gem's dependencies in legion-extensions-elastic_app_search.gemspec
3
+ source 'https://rubygems.org'
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'rake'
8
+ gem 'rspec'
9
+ gem 'rspec_junit_formatter'
10
+ gem 'rubocop'
11
+ gem 'simplecov'
12
+ end
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2021 Esity
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -1,44 +1,70 @@
1
- # Legion::Extensions::ElasticAppSearch
1
+ # lex-elastic_app_search
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/legion/extensions/elastic_app_search`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Elastic App Search integration for [LegionIO](https://github.com/LegionIO/LegionIO). Manages engines, documents, search, analytics, schemas, synonyms, curations, credentials, and click-through tracking.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'legion-extensions-elastic_app_search'
7
+ ```bash
8
+ gem install lex-elastic_app_search
13
9
  ```
14
10
 
15
- And then execute:
16
-
17
- $ bundle install
11
+ Or add to your Gemfile:
18
12
 
19
- Or install it yourself as:
20
-
21
- $ gem install legion-extensions-elastic_app_search
22
-
23
- ## Usage
13
+ ```ruby
14
+ gem 'lex-elastic_app_search'
15
+ ```
24
16
 
25
- TODO: Write usage instructions here
17
+ ## Standalone Usage
26
18
 
27
- ## Development
19
+ ```ruby
20
+ require 'legion/extensions/elastic_app_search'
28
21
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
22
+ client = Legion::Extensions::ElasticAppSearch::Client.new(
23
+ host: 'https://your-deployment.ent-search.region.aws.cloud.es.io',
24
+ api_key: 'your-api-key'
25
+ )
30
26
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+ client.list_engines
28
+ client.search(engine_name: 'my-engine', query: 'hello')
29
+ ```
32
30
 
33
- ## Contributing
31
+ Constructor accepts `host:` (default `http://localhost:3002`) and `api_key:` kwargs.
32
+
33
+ ## Runners
34
+
35
+ | Runner | Operations |
36
+ |--------|-----------|
37
+ | Engines | Engine management |
38
+ | Documents | Document CRUD |
39
+ | Search | Search queries |
40
+ | Analytics | Search analytics |
41
+ | Schemas | Schema management |
42
+ | Synonyms | Synonym sets |
43
+ | Curations | Search curations |
44
+ | Credentials | API key management |
45
+ | ClickThrough | Click-through tracking |
46
+
47
+ ## Configuration
48
+
49
+ Default host: `http://localhost:3002`. Override via Legion settings:
50
+
51
+ ```json
52
+ {
53
+ "extensions": {
54
+ "elastic_app_search": {
55
+ "host": "https://your-deployment.ent-search.region.aws.cloud.es.io",
56
+ "api_key": "your-api-key"
57
+ }
58
+ }
59
+ }
60
+ ```
34
61
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/legion-extensions-elastic_app_search. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/legion-extensions-elastic_app_search/blob/master/CODE_OF_CONDUCT.md).
62
+ ## Requirements
36
63
 
64
+ - Ruby >= 3.4
65
+ - Elastic App Search instance
66
+ - [LegionIO](https://github.com/LegionIO/LegionIO) framework (optional for standalone client)
37
67
 
38
68
  ## License
39
69
 
40
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
-
42
- ## Code of Conduct
43
-
44
- Everyone interacting in the Legion::Extensions::ElasticAppSearch project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/legion-extensions-elastic_app_search/blob/master/CODE_OF_CONDUCT.md).
70
+ MIT
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'lib/legion/extensions/elastic_app_search/version'
2
4
 
3
5
  Gem::Specification.new do |spec|
@@ -5,16 +7,21 @@ Gem::Specification.new do |spec|
5
7
  spec.version = Legion::Extensions::ElasticAppSearch::VERSION
6
8
  spec.authors = ['Esity']
7
9
  spec.email = ['matthewdiverson@gmail.com']
8
-
9
- spec.summary = 'Legion ElasticAppSearch'
10
+ spec.summary = 'LegionIO ElasticAppSearch'
10
11
  spec.description = 'Connects Legion to Elastic App Search'
11
- spec.homepage = 'https://bitbucket.org/legion-io/lex-elastic_app_search'
12
+ spec.homepage = 'https://github.com/LegionIO/lex-elastic_app_search'
12
13
  spec.license = 'MIT'
13
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
14
+ spec.required_ruby_version = '>= 3.4'
14
15
 
15
- spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/lex-elastic_app_search'
17
- spec.metadata['changelog_uri'] = 'https://bitbucket.org/legion-io/lex-elastic_app_search/src/master/CHANGELOG.md'
16
+ spec.metadata = {
17
+ 'bug_tracker_uri' => 'https://github.com/LegionIO/lex-elastic_app_search/issues',
18
+ 'changelog_uri' => 'https://github.com/LegionIO/lex-elastic_app_search/blob/master/CHANGELOG.md',
19
+ 'documentation_uri' => 'https://github.com/LegionIO/lex-elastic_app_search',
20
+ 'homepage_uri' => 'https://github.com/LegionIO/lex-elastic_app_search',
21
+ 'source_code_uri' => 'https://github.com/LegionIO/lex-elastic_app_search',
22
+ 'wiki_uri' => 'https://github.com/LegionIO/lex-elastic_app_search/wiki',
23
+ 'rubygems_mfa_required' => 'true'
24
+ }
18
25
 
19
26
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
27
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -22,11 +29,12 @@ Gem::Specification.new do |spec|
22
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
30
  spec.require_paths = ['lib']
24
31
 
25
- spec.add_development_dependency 'rake'
26
- spec.add_development_dependency 'rspec'
27
- spec.add_development_dependency 'rubocop'
28
- spec.add_development_dependency 'simplecov'
29
-
30
32
  spec.add_dependency 'elastic-app-search'
31
- spec.add_dependency 'legion-exceptions'
33
+ spec.add_dependency 'legion-cache', '>= 1.3.11'
34
+ spec.add_dependency 'legion-crypt', '>= 1.4.9'
35
+ spec.add_dependency 'legion-data', '>= 1.4.17'
36
+ spec.add_dependency 'legion-json', '>= 1.2.1'
37
+ spec.add_dependency 'legion-logging', '>= 1.3.2'
38
+ spec.add_dependency 'legion-settings', '>= 1.3.14'
39
+ spec.add_dependency 'legion-transport', '>= 1.3.9'
32
40
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'helpers/client'
4
+ require_relative 'runners/analytics'
5
+ require_relative 'runners/click_through'
6
+ require_relative 'runners/curations'
7
+ require_relative 'runners/documents'
8
+ require_relative 'runners/engines'
9
+ require_relative 'runners/schemas'
10
+ require_relative 'runners/search'
11
+ require_relative 'runners/synonyms'
12
+
13
+ module Legion
14
+ module Extensions
15
+ module ElasticAppSearch
16
+ class Client
17
+ include Runners::Analytics
18
+ include Runners::ClickThrough
19
+ include Runners::Curations
20
+ include Runners::Documents
21
+ include Runners::Engines
22
+ include Runners::Schemas
23
+ include Runners::Search
24
+ include Runners::Synonyms
25
+
26
+ attr_reader :opts
27
+
28
+ def initialize(host: 'http://localhost:3002', api_key: nil, **extra)
29
+ @opts = { host: host, api_key: api_key, **extra }.compact
30
+ end
31
+
32
+ def client(**_override)
33
+ Elastic::AppSearch::Client.new(
34
+ host_identifier: @opts[:host],
35
+ api_key: @opts[:api_key]
36
+ )
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'elastic-app-search'
2
4
 
3
5
  module Legion
@@ -8,7 +10,7 @@ module Legion
8
10
  def client(**opts)
9
11
  Elastic::AppSearch::Client.new(
10
12
  host_identifier: find_setting('host', opts),
11
- api_key: find_setting('api_key', opts)
13
+ api_key: find_setting('api_key', opts)
12
14
  )
13
15
  end
14
16
  include Legion::Extensions::Helpers::Lex
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -13,15 +15,10 @@ module Legion
13
15
  client(opts).get_credential(name)
14
16
  end
15
17
 
16
- def create(name:, type: 'private', read: true, write: false, access_all_engines: true, engines: [], **opts)
17
- client(opts).create_credential(
18
- { name: name,
19
- type: type,
20
- read: read,
21
- write: write,
22
- access_all_engines: access_all_engines,
23
- engines: engines }
24
- )
18
+ def create(name:, credential_opts: {}, **opts)
19
+ defaults = { type: 'private', read: true, write: false, access_all_engines: true, engines: [] }
20
+ params = defaults.merge(credential_opts).merge(name: name)
21
+ client(opts).create_credential(params)
25
22
  end
26
23
 
27
24
  def update(name:, **opts)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Extensions
3
5
  module ElasticAppSearch
4
- VERSION = '0.1.0'.freeze
6
+ VERSION = '0.2.1'
5
7
  end
6
8
  end
7
9
  end
@@ -1,9 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'legion/extensions/elastic_app_search/version'
4
+ require 'legion/extensions/elastic_app_search/helpers/client'
5
+ require 'legion/extensions/elastic_app_search/runners/analytics'
6
+ require 'legion/extensions/elastic_app_search/runners/click_through'
7
+ require 'legion/extensions/elastic_app_search/runners/curations'
8
+ require 'legion/extensions/elastic_app_search/runners/documents'
9
+ require 'legion/extensions/elastic_app_search/runners/engines'
10
+ require 'legion/extensions/elastic_app_search/runners/schemas'
11
+ require 'legion/extensions/elastic_app_search/runners/search'
12
+ require 'legion/extensions/elastic_app_search/runners/synonyms'
13
+ require 'legion/extensions/elastic_app_search/client'
2
14
 
3
15
  module Legion
4
16
  module Extensions
5
17
  module ElasticAppSearch
6
- extend Legion::Extensions::Core
18
+ extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
7
19
 
8
20
  def self.default_settings
9
21
  {
metadata CHANGED
@@ -1,23 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-elastic_app_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rake
13
+ name: elastic-app-search
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '0'
20
- type: :development
19
+ type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
@@ -25,75 +24,103 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: rspec
27
+ name: legion-cache
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
32
+ version: 1.3.11
33
+ type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: '0'
39
+ version: 1.3.11
41
40
  - !ruby/object:Gem::Dependency
42
- name: rubocop
41
+ name: legion-crypt
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
46
+ version: 1.4.9
47
+ type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: '0'
53
+ version: 1.4.9
55
54
  - !ruby/object:Gem::Dependency
56
- name: simplecov
55
+ name: legion-data
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
60
+ version: 1.4.17
61
+ type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
- version: '0'
67
+ version: 1.4.17
69
68
  - !ruby/object:Gem::Dependency
70
- name: elastic-app-search
69
+ name: legion-json
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
- version: '0'
74
+ version: 1.2.1
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - ">="
81
80
  - !ruby/object:Gem::Version
82
- version: '0'
81
+ version: 1.2.1
83
82
  - !ruby/object:Gem::Dependency
84
- name: legion-exceptions
83
+ name: legion-logging
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - ">="
88
87
  - !ruby/object:Gem::Version
89
- version: '0'
88
+ version: 1.3.2
90
89
  type: :runtime
91
90
  prerelease: false
92
91
  version_requirements: !ruby/object:Gem::Requirement
93
92
  requirements:
94
93
  - - ">="
95
94
  - !ruby/object:Gem::Version
96
- version: '0'
95
+ version: 1.3.2
96
+ - !ruby/object:Gem::Dependency
97
+ name: legion-settings
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.3.14
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.14
110
+ - !ruby/object:Gem::Dependency
111
+ name: legion-transport
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.3.9
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.3.9
97
124
  description: Connects Legion to Elastic App Search
98
125
  email:
99
126
  - matthewdiverson@gmail.com
@@ -101,18 +128,21 @@ executables: []
101
128
  extensions: []
102
129
  extra_rdoc_files: []
103
130
  files:
131
+ - ".github/CODEOWNERS"
132
+ - ".github/dependabot.yml"
133
+ - ".github/workflows/ci.yml"
104
134
  - ".gitignore"
105
135
  - ".rspec"
106
136
  - ".rubocop.yml"
107
- - CODE_OF_CONDUCT.md
137
+ - CHANGELOG.md
138
+ - CLAUDE.md
139
+ - Dockerfile
108
140
  - Gemfile
109
- - LICENSE.txt
141
+ - LICENSE
110
142
  - README.md
111
- - Rakefile
112
- - bin/console
113
- - bin/setup
114
143
  - lex-elastic_app_search.gemspec
115
144
  - lib/legion/extensions/elastic_app_search.rb
145
+ - lib/legion/extensions/elastic_app_search/client.rb
116
146
  - lib/legion/extensions/elastic_app_search/helpers/client.rb
117
147
  - lib/legion/extensions/elastic_app_search/runners/analytics.rb
118
148
  - lib/legion/extensions/elastic_app_search/runners/click_through.rb
@@ -124,14 +154,17 @@ files:
124
154
  - lib/legion/extensions/elastic_app_search/runners/search.rb
125
155
  - lib/legion/extensions/elastic_app_search/runners/synonyms.rb
126
156
  - lib/legion/extensions/elastic_app_search/version.rb
127
- homepage: https://bitbucket.org/legion-io/lex-elastic_app_search
157
+ homepage: https://github.com/LegionIO/lex-elastic_app_search
128
158
  licenses:
129
159
  - MIT
130
160
  metadata:
131
- homepage_uri: https://bitbucket.org/legion-io/lex-elastic_app_search
132
- source_code_uri: https://bitbucket.org/legion-io/lex-elastic_app_search
133
- changelog_uri: https://bitbucket.org/legion-io/lex-elastic_app_search/src/master/CHANGELOG.md
134
- post_install_message:
161
+ bug_tracker_uri: https://github.com/LegionIO/lex-elastic_app_search/issues
162
+ changelog_uri: https://github.com/LegionIO/lex-elastic_app_search/blob/master/CHANGELOG.md
163
+ documentation_uri: https://github.com/LegionIO/lex-elastic_app_search
164
+ homepage_uri: https://github.com/LegionIO/lex-elastic_app_search
165
+ source_code_uri: https://github.com/LegionIO/lex-elastic_app_search
166
+ wiki_uri: https://github.com/LegionIO/lex-elastic_app_search/wiki
167
+ rubygems_mfa_required: 'true'
135
168
  rdoc_options: []
136
169
  require_paths:
137
170
  - lib
@@ -139,15 +172,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
172
  requirements:
140
173
  - - ">="
141
174
  - !ruby/object:Gem::Version
142
- version: 2.5.0
175
+ version: '3.4'
143
176
  required_rubygems_version: !ruby/object:Gem::Requirement
144
177
  requirements:
145
178
  - - ">="
146
179
  - !ruby/object:Gem::Version
147
180
  version: '0'
148
181
  requirements: []
149
- rubygems_version: 3.1.2
150
- signing_key:
182
+ rubygems_version: 3.6.9
151
183
  specification_version: 4
152
- summary: Legion ElasticAppSearch
184
+ summary: LegionIO ElasticAppSearch
153
185
  test_files: []
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at matthewdiverson@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Esity
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'legion/extensions/elastic_app_search'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here