waha-ruby 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fc9414c7b9bb51ef5a2e118d72f6b0d33bc099b91ea8b705a11f6c17d63ca7ac
4
+ data.tar.gz: 8fa5cba6397385326900b0d420a45fb2029c33350205c038046f0fd314588540
5
+ SHA512:
6
+ metadata.gz: 69d17352f8e08d07e2d86948a31c7079ff7cdacb7b9bca0ac91f72a292caa6eb50e5f7c9a9ba90d4b7b4886cc3ba7683a544176a77c1f56e9de643c6852e935a
7
+ data.tar.gz: 29707e3dfac2eca128adc7ab801e5e062d523944a32db35d0500870fb46b4dfcedeb2c6523828108a0dc556735b91e129bcf1a60d6e6e17c3e176335773ac7f4
@@ -0,0 +1,13 @@
1
+ > [!NOTE]
2
+ > **Changes:** <!-- Describe what has been changed in this PR and, most importantly, why it's changed. Use 3-5 bullet points. -->
3
+ >
4
+
5
+ > [!TIP]
6
+ > **How to review:** <!-- Describe what the reviewer of this PR should be looking for and what results are expected. -->
7
+ >
8
+
9
+ > [!WARNING]
10
+ > **Risks:** <!-- Is there any risk attached to merging this PR? Select the appropriate box. -->
11
+ > - [x] none
12
+ > - [ ] low
13
+ > - [ ] high
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
15
+
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600
18
+ with:
19
+ ruby-version: 4.0.5
20
+ bundler-cache: true
21
+
22
+ - name: Run CI checks
23
+ run: bin/ci
24
+
25
+ - name: Upload coverage
26
+ uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
27
+ if: always()
28
+ with:
29
+ name: coverage-report
30
+ path: coverage/
31
+ retention-days: 30
32
+ if-no-files-found: ignore
@@ -0,0 +1,457 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions: {}
8
+
9
+ concurrency:
10
+ group: release-${{ github.event.release.tag_name }}
11
+ cancel-in-progress: false
12
+
13
+ jobs:
14
+ validate:
15
+ if: ${{ github.event.release.prerelease == false }}
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: read
19
+
20
+ steps:
21
+ - name: Check out release tag
22
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
23
+ with:
24
+ ref: ${{ github.event.release.tag_name }}
25
+ fetch-depth: 0
26
+ persist-credentials: false
27
+
28
+ - name: Set up Ruby
29
+ uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600
30
+ with:
31
+ ruby-version: 4.0.5
32
+ bundler-cache: true
33
+
34
+ - name: Validate release identity
35
+ env:
36
+ RELEASE_SHA: ${{ github.sha }}
37
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
38
+ REPOSITORY: ${{ github.repository }}
39
+ run: |
40
+ set -euo pipefail
41
+
42
+ fail() {
43
+ echo "::error::$1"
44
+ exit 1
45
+ }
46
+
47
+ [[ "$REPOSITORY" == "develoz-com/waha-ruby" ]] ||
48
+ fail "release workflow must run in develoz-com/waha-ruby"
49
+ [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ||
50
+ fail "release tag must match vX.Y.Z"
51
+
52
+ tag_sha="$(git rev-parse --verify "refs/tags/${RELEASE_TAG}^{commit}")"
53
+ head_sha="$(git rev-parse --verify HEAD)"
54
+ main_sha="$(git rev-parse --verify "refs/remotes/origin/main^{commit}")"
55
+
56
+ [[ "$tag_sha" == "$head_sha" ]] ||
57
+ fail "checked-out commit does not match ${RELEASE_TAG}"
58
+ [[ "$tag_sha" == "$RELEASE_SHA" ]] ||
59
+ fail "${RELEASE_TAG} does not match the release event SHA"
60
+ [[ "$tag_sha" == "$main_sha" ]] ||
61
+ fail "${RELEASE_TAG} is not the current origin/main commit"
62
+
63
+ version="$(ruby -Ilib -rwaha/version -e 'print Waha::VERSION')"
64
+ [[ "$RELEASE_TAG" == "v${version}" ]] ||
65
+ fail "${RELEASE_TAG} does not match Waha::VERSION ${version}"
66
+
67
+ - name: Run CI
68
+ run: bin/ci
69
+
70
+ - name: Validate changelog update
71
+ env:
72
+ PUBLISHED_AT: ${{ github.event.release.published_at }}
73
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
74
+ REPOSITORY: ${{ github.repository }}
75
+ run: |
76
+ set -euo pipefail
77
+
78
+ release_date="${PUBLISHED_AT%%T*}"
79
+ [[ "$release_date" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || {
80
+ echo "::error::release published_at must contain a YYYY-MM-DD date"
81
+ exit 1
82
+ }
83
+
84
+ bin/update_changelog \
85
+ --tag "$RELEASE_TAG" \
86
+ --date "$release_date" \
87
+ --repository "$REPOSITORY" \
88
+ --check \
89
+ CHANGELOG.md
90
+
91
+ publish:
92
+ needs: validate
93
+ if: ${{ github.event.release.prerelease == false && needs.validate.result == 'success' }}
94
+ runs-on: ubuntu-latest
95
+ environment: rubygems
96
+ permissions:
97
+ contents: read
98
+ id-token: write
99
+
100
+ steps:
101
+ - name: Check out immutable release commit
102
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
103
+ with:
104
+ ref: ${{ github.sha }}
105
+ fetch-depth: 0
106
+ fetch-tags: true
107
+ persist-credentials: false
108
+
109
+ - name: Validate immutable release refs
110
+ env:
111
+ RELEASE_SHA: ${{ github.sha }}
112
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
113
+ REPOSITORY: ${{ github.repository }}
114
+ run: |
115
+ set -euo pipefail
116
+
117
+ fail() {
118
+ echo "::error::$1"
119
+ exit 1
120
+ }
121
+
122
+ [[ "$REPOSITORY" == "develoz-com/waha-ruby" ]] ||
123
+ fail "release workflow must run in develoz-com/waha-ruby"
124
+ [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ||
125
+ fail "release tag must match vX.Y.Z"
126
+
127
+ tag_sha="$(git rev-parse --verify "refs/tags/${RELEASE_TAG}^{commit}")"
128
+ head_sha="$(git rev-parse --verify HEAD)"
129
+ main_sha="$(git rev-parse --verify "refs/remotes/origin/main^{commit}")"
130
+
131
+ [[ "$head_sha" == "$RELEASE_SHA" ]] ||
132
+ fail "checked-out commit does not match the release event SHA"
133
+ [[ "$tag_sha" == "$RELEASE_SHA" ]] ||
134
+ fail "${RELEASE_TAG} does not match the release event SHA"
135
+ [[ "$main_sha" == "$RELEASE_SHA" ]] ||
136
+ fail "${RELEASE_TAG} is not the current origin/main commit"
137
+
138
+ - name: Set up Ruby
139
+ uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600
140
+ with:
141
+ ruby-version: 4.0.5
142
+ bundler: none
143
+
144
+ - name: Validate gem version
145
+ env:
146
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
147
+ run: |
148
+ set -euo pipefail
149
+
150
+ version="$(ruby -Ilib -rwaha/version -e 'print Waha::VERSION')"
151
+ if [[ "$RELEASE_TAG" != "v${version}" ]]; then
152
+ echo "::error::${RELEASE_TAG} does not match Waha::VERSION ${version}"
153
+ exit 1
154
+ fi
155
+ printf 'VERSION=%s\n' "$version" >> "$GITHUB_ENV"
156
+
157
+ - name: Build exact gem
158
+ run: |
159
+ set -euo pipefail
160
+
161
+ gem_path="pkg/waha-ruby-${VERSION}.gem"
162
+ mkdir -p pkg
163
+ rm -f -- "$gem_path"
164
+ gem build waha-ruby.gemspec --output "$gem_path"
165
+ [[ -f "$gem_path" ]] || {
166
+ echo "::error::gem build did not create ${gem_path}"
167
+ exit 1
168
+ }
169
+ printf 'GEM_PATH=%s\n' "$gem_path" >> "$GITHUB_ENV"
170
+
171
+ - name: Inspect built gem
172
+ run: |
173
+ ruby -rrubygems/package <<'RUBY'
174
+ gem_path = ENV.fetch("GEM_PATH")
175
+ version = ENV.fetch("VERSION")
176
+ package = Gem::Package.new(gem_path)
177
+ package.verify
178
+ specification = package.spec
179
+
180
+ abort "expected gem name waha-ruby, got #{specification.name}" unless specification.name == "waha-ruby"
181
+ abort "expected gem version #{version}, got #{specification.version}" unless specification.version.to_s == version
182
+ abort "expected ruby platform, got #{specification.platform}" unless specification.platform.to_s == "ruby"
183
+ abort "expected no executables" unless specification.executables.empty?
184
+
185
+ files = package.contents
186
+ required_files = %w[
187
+ CHANGELOG.md
188
+ LICENSE.txt
189
+ README.md
190
+ lib/waha.rb
191
+ lib/waha/version.rb
192
+ ]
193
+ missing_files = required_files - files
194
+ abort "gem is missing required files: #{missing_files.join(', ')}" unless missing_files.empty?
195
+
196
+ excluded_files = %w[.gitignore .rspec Gemfile waha-ruby.gemspec]
197
+ excluded_prefixes = %w[bin/ spec/ docs/ templates/]
198
+ unexpected_files = files.select do |file|
199
+ excluded_files.include?(file) || excluded_prefixes.any? { |prefix| file.start_with?(prefix) }
200
+ end
201
+ abort "gem contains excluded files: #{unexpected_files.join(', ')}" unless unexpected_files.empty?
202
+ RUBY
203
+
204
+ - name: Check RubyGems version state
205
+ id: version-state
206
+ env:
207
+ RUN_ATTEMPT: ${{ github.run_attempt }}
208
+ run: |
209
+ set -euo pipefail
210
+
211
+ [[ "$RUN_ATTEMPT" =~ ^[1-9][0-9]*$ ]] || {
212
+ echo "::error::invalid workflow run attempt ${RUN_ATTEMPT}"
213
+ exit 1
214
+ }
215
+
216
+ api_url="https://rubygems.org/api/v2/rubygems/waha-ruby/versions/${VERSION}.json"
217
+ checks=12
218
+
219
+ status=""
220
+ for ((check = 1; check <= checks; check++)); do
221
+ status="$(curl \
222
+ --silent \
223
+ --show-error \
224
+ --location \
225
+ --connect-timeout 10 \
226
+ --max-time 30 \
227
+ --output /dev/null \
228
+ --write-out '%{http_code}' \
229
+ "$api_url")"
230
+
231
+ if [[ "$status" == "200" ]]; then
232
+ break
233
+ fi
234
+ [[ "$status" == "404" ]] || {
235
+ echo "::error::RubyGems API returned HTTP ${status}"
236
+ exit 1
237
+ }
238
+ if (( check < checks )); then
239
+ sleep 5
240
+ fi
241
+ done
242
+
243
+ if [[ "$status" == "200" ]]; then
244
+ echo "should-push=false" >> "$GITHUB_OUTPUT"
245
+ echo "waha-ruby ${VERSION} is already published; skipping gem push"
246
+ else
247
+ echo "should-push=true" >> "$GITHUB_OUTPUT"
248
+ fi
249
+
250
+ - name: Configure RubyGems credentials
251
+ if: ${{ steps.version-state.outputs.should-push == 'true' }}
252
+ uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a
253
+
254
+ - name: Push exact gem
255
+ if: ${{ steps.version-state.outputs.should-push == 'true' }}
256
+ run: gem push "pkg/waha-ruby-${VERSION}.gem"
257
+
258
+ - name: Verify RubyGems API visibility
259
+ env:
260
+ SHOULD_PUSH: ${{ steps.version-state.outputs.should-push }}
261
+ run: |
262
+ set -euo pipefail
263
+
264
+ api_url="https://rubygems.org/api/v2/rubygems/waha-ruby/versions/${VERSION}.json"
265
+ api_response="$RUNNER_TEMP/waha-ruby-${VERSION}.json"
266
+ status=""
267
+
268
+ for ((check = 1; check <= 18; check++)); do
269
+ status="$(curl \
270
+ --silent \
271
+ --show-error \
272
+ --location \
273
+ --connect-timeout 10 \
274
+ --max-time 30 \
275
+ --output "$api_response" \
276
+ --write-out '%{http_code}' \
277
+ "$api_url")"
278
+
279
+ if [[ "$status" == "200" ]]; then
280
+ break
281
+ fi
282
+ [[ "$status" == "404" ]] || {
283
+ echo "::error::RubyGems API returned HTTP ${status}"
284
+ exit 1
285
+ }
286
+ if (( check < 18 )); then
287
+ sleep 5
288
+ fi
289
+ done
290
+
291
+ [[ "$status" == "200" ]] || {
292
+ echo "::error::waha-ruby ${VERSION} did not become visible through the RubyGems API"
293
+ exit 1
294
+ }
295
+
296
+ API_RESPONSE="$api_response" SHOULD_PUSH="$SHOULD_PUSH" ruby -rjson -rdigest <<'RUBY'
297
+ payload = JSON.parse(File.read(ENV.fetch("API_RESPONSE")))
298
+ version = ENV.fetch("VERSION")
299
+
300
+ abort "RubyGems API returned the wrong gem name" unless payload.fetch("name") == "waha-ruby"
301
+ abort "RubyGems API returned the wrong version" unless payload.fetch("version") == version
302
+ abort "RubyGems API returned the wrong platform" unless payload.fetch("platform") == "ruby"
303
+ abort "RubyGems API reports the release as yanked" if payload.fetch("yanked")
304
+
305
+ # Only verify SHA when we pushed the gem in this run
306
+ if ENV.fetch("SHOULD_PUSH") == "true"
307
+ gem_path = ENV.fetch("GEM_PATH")
308
+ expected_sha = Digest::SHA256.file(gem_path).hexdigest
309
+ abort "RubyGems API SHA does not match the built gem" unless payload.fetch("sha") == expected_sha
310
+ else
311
+ puts "Gem was already published; skipping SHA verification"
312
+ end
313
+ RUBY
314
+
315
+ finalize-changelog:
316
+ needs: publish
317
+ if: ${{ github.event.release.prerelease == false && needs.publish.result == 'success' }}
318
+ runs-on: ubuntu-latest
319
+ permissions:
320
+ contents: write
321
+
322
+ steps:
323
+ - name: Check out main
324
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
325
+ with:
326
+ ref: main
327
+ fetch-depth: 0
328
+
329
+ - name: Set up Ruby
330
+ uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600
331
+ with:
332
+ ruby-version: 4.0.5
333
+ bundler: none
334
+
335
+ - name: Validate main and release tag
336
+ env:
337
+ RELEASE_SHA: ${{ github.sha }}
338
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
339
+ REPOSITORY: ${{ github.repository }}
340
+ run: |
341
+ set -euo pipefail
342
+
343
+ fail() {
344
+ echo "::error::$1"
345
+ exit 1
346
+ }
347
+
348
+ [[ "$REPOSITORY" == "develoz-com/waha-ruby" ]] ||
349
+ fail "release workflow must run in develoz-com/waha-ruby"
350
+ [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ||
351
+ fail "release tag must match vX.Y.Z"
352
+
353
+ tag_sha="$(git rev-parse --verify "refs/tags/${RELEASE_TAG}^{commit}")"
354
+ head_sha="$(git rev-parse --verify HEAD)"
355
+ main_sha="$(git rev-parse --verify "refs/remotes/origin/main^{commit}")"
356
+
357
+ [[ "$tag_sha" == "$RELEASE_SHA" ]] ||
358
+ fail "${RELEASE_TAG} no longer matches the release event SHA"
359
+ [[ "$head_sha" == "$main_sha" ]] ||
360
+ fail "checked-out main does not match origin/main"
361
+
362
+ if [[ "$main_sha" == "$RELEASE_SHA" ]]; then
363
+ finalize_state="fresh"
364
+ else
365
+ parents="$(git show -s --format=%P "$main_sha")"
366
+ [[ "$parents" == "$RELEASE_SHA" ]] ||
367
+ fail "main is not the release commit or its single direct child"
368
+
369
+ subject="$(git show -s --format=%s "$main_sha")"
370
+ expected_subject="docs: finalize ${RELEASE_TAG} changelog"
371
+ [[ "$subject" == "$expected_subject" ]] ||
372
+ fail "the commit after the release has an unexpected subject"
373
+
374
+ changed_files="$(git diff-tree --no-commit-id --name-only -r "$main_sha")"
375
+ [[ "$changed_files" == "CHANGELOG.md" ]] ||
376
+ fail "the commit after the release must change only CHANGELOG.md"
377
+
378
+ finalize_state="already-finalized"
379
+ fi
380
+
381
+ version="$(ruby -Ilib -rwaha/version -e 'print Waha::VERSION')"
382
+ [[ "$RELEASE_TAG" == "v${version}" ]] ||
383
+ fail "${RELEASE_TAG} does not match Waha::VERSION ${version}"
384
+ printf 'FINALIZE_STATE=%s\n' "$finalize_state" >> "$GITHUB_ENV"
385
+
386
+ - name: Finalize changelog
387
+ env:
388
+ PUBLISHED_AT: ${{ github.event.release.published_at }}
389
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
390
+ REPOSITORY: ${{ github.repository }}
391
+ run: |
392
+ set -euo pipefail
393
+
394
+ release_date="${PUBLISHED_AT%%T*}"
395
+ [[ "$release_date" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || {
396
+ echo "::error::release published_at must contain a YYYY-MM-DD date"
397
+ exit 1
398
+ }
399
+
400
+ bin/update_changelog \
401
+ --tag "$RELEASE_TAG" \
402
+ --date "$release_date" \
403
+ --repository "$REPOSITORY" \
404
+ CHANGELOG.md
405
+
406
+ - name: Commit changelog if changed
407
+ env:
408
+ RELEASE_SHA: ${{ github.sha }}
409
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
410
+ run: |
411
+ set -euo pipefail
412
+
413
+ if [[ "$FINALIZE_STATE" == "already-finalized" ]]; then
414
+ working_tree="$(git status --porcelain --untracked-files=all)"
415
+ if [[ -n "$working_tree" ]]; then
416
+ echo "::error::changelog updater was not idempotent on the finalized commit"
417
+ exit 1
418
+ fi
419
+ echo "CHANGELOG.md is already finalized for ${RELEASE_TAG}"
420
+ exit 0
421
+ fi
422
+
423
+ [[ "$FINALIZE_STATE" == "fresh" ]] || {
424
+ echo "::error::unexpected changelog finalization state ${FINALIZE_STATE}"
425
+ exit 1
426
+ }
427
+
428
+ if git diff --quiet -- CHANGELOG.md; then
429
+ echo "CHANGELOG.md is already finalized for ${RELEASE_TAG}"
430
+ exit 0
431
+ fi
432
+
433
+ unexpected_files="$(git diff --name-only -- . ':(exclude)CHANGELOG.md')"
434
+ [[ -z "$unexpected_files" ]] || {
435
+ echo "::error::changelog finalization changed unexpected files: ${unexpected_files}"
436
+ exit 1
437
+ }
438
+ git diff --check
439
+
440
+ git add -- CHANGELOG.md
441
+ staged_files="$(git diff --cached --name-only)"
442
+ [[ "$staged_files" == "CHANGELOG.md" ]] || {
443
+ echo "::error::only CHANGELOG.md may be committed"
444
+ exit 1
445
+ }
446
+
447
+ git config user.name "github-actions[bot]"
448
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
449
+ git commit -m "docs: finalize ${RELEASE_TAG} changelog" -- CHANGELOG.md
450
+
451
+ tag_sha="$(git rev-parse --verify "refs/tags/${RELEASE_TAG}^{commit}")"
452
+ [[ "$tag_sha" == "$RELEASE_SHA" ]] || {
453
+ echo "::error::release tag changed during changelog finalization"
454
+ exit 1
455
+ }
456
+
457
+ git push origin HEAD:main
data/.reek.yml ADDED
@@ -0,0 +1,38 @@
1
+ ---
2
+ exclude_paths:
3
+ - config
4
+ - db
5
+ - spec
6
+ - vendor
7
+
8
+ detectors:
9
+ IrresponsibleModule:
10
+ enabled: false
11
+ UtilityFunction:
12
+ enabled: false
13
+ ControlParameter:
14
+ enabled: false
15
+ BooleanParameter:
16
+ enabled: false
17
+ FeatureEnvy:
18
+ enabled: false
19
+ TooManyStatements:
20
+ enabled: false
21
+ DuplicateMethodCall:
22
+ enabled: false
23
+ LongParameterList:
24
+ enabled: false
25
+ RepeatedConditional:
26
+ enabled: false
27
+ DataClump:
28
+ enabled: false
29
+ ManualDispatch:
30
+ enabled: false
31
+ MissingSafeMethod:
32
+ enabled: false
33
+ NilCheck:
34
+ enabled: false
35
+ UncommunicativeVariableName:
36
+ enabled: false
37
+ TooManyMethods:
38
+ max_methods: 25
data/.rubocop.yml ADDED
@@ -0,0 +1,73 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ require:
6
+ - rubocop-rubycw
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 3.4
10
+ NewCops: enable
11
+ SuggestExtensions: false
12
+ Exclude:
13
+ - "bin/**/*"
14
+ - "vendor/**/*"
15
+ - ".git/**/*"
16
+ - "spec/fixtures/**/*"
17
+
18
+ Metrics/BlockLength:
19
+ Exclude:
20
+ - "spec/**/*"
21
+ - "Rakefile"
22
+
23
+ Metrics/MethodLength:
24
+ Max: 20
25
+
26
+ Metrics/ClassLength:
27
+ Exclude:
28
+ - "lib/waha/resources/messages.rb"
29
+
30
+ Metrics/ParameterLists:
31
+ Exclude:
32
+ - "lib/waha/resources/messages.rb"
33
+ - "lib/waha/transport/http_party.rb"
34
+
35
+ Metrics/AbcSize:
36
+ Exclude:
37
+ - "lib/waha/resources/messages.rb"
38
+ - "lib/waha/transport/http_party.rb"
39
+
40
+ Layout/LineLength:
41
+ Exclude:
42
+ - "waha-ruby.gemspec"
43
+
44
+ RSpec/MultipleDescribes:
45
+ Exclude:
46
+ - "spec/waha/gows_spec.rb"
47
+
48
+ RSpec/ExampleLength:
49
+ Max: 15
50
+
51
+ RSpec/MultipleExpectations:
52
+ Max: 3
53
+
54
+ Style/Documentation:
55
+ Enabled: false
56
+
57
+ Style/StringLiterals:
58
+ EnforcedStyle: double_quotes
59
+
60
+ Style/FrozenStringLiteralComment:
61
+ Enabled: true
62
+
63
+ Layout/SpaceInsideArrayLiteralBrackets:
64
+ EnforcedStyle: no_space
65
+
66
+ Style/SymbolArray:
67
+ EnforcedStyle: percent
68
+
69
+ Style/WordArray:
70
+ EnforcedStyle: percent
71
+
72
+ Gemspec/DevelopmentDependencies:
73
+ Enabled: false
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 4.0.5
data/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to
7
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
10
+
11
+ ## [0.1.0] - 2026-09-09
12
+
13
+ ### Added
14
+
15
+ - `Waha::Client` framework-agnostic SDK entry point with explicit
16
+ `base_url`, `api_key`, and `session` configuration, powered by Faraday transport.
17
+ - Session lifecycle API: list, get, create, start, stop, restart, logout,
18
+ destroy, and pairing (`qr`, `request_code`).
19
+ - Messaging API: send text/image/file/voice, edit message, mark chat seen,
20
+ start/stop typing, new-message-id, canonical message id helpers, list and
21
+ find messages.
22
+ - Media API: media download with localhost-to-base URL rebasing.
23
+ - Chats API: chat overview and chat message listing.
24
+ - Contacts API: contact lookup and `check-exists` number verification.
25
+ - Presence API: presence subscription per chat.
26
+ - Webhook configuration API: idempotent session webhook registration.
27
+ - `Waha::Webhook::Verifier` for sha512 HMAC webhook signature verification
28
+ with constant-time comparison.
29
+ - Optional Rails adapter: controller concern for webhook verification and an
30
+ install generator for the `waha.rb` initializer.
31
+ - Typed `Waha::Error` (operation, status, bounded redacted details) with
32
+ provider payload redaction.
33
+ [Unreleased]: https://github.com/develoz-com/waha-ruby/compare/v0.1.0...HEAD
34
+ [0.1.0]: https://github.com/develoz-com/waha-ruby/releases/tag/v0.1.0