mifiel 2.1.0 → 2.1.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: fba43da41b56717d0f34d2d23441a29685b1014eff732a8c7c3c2a886cbcf81f
4
- data.tar.gz: a067295115e5ae373cb996708138bef64ed3f5a5f7406e3027df2f321ff13d3b
3
+ metadata.gz: eba6455242cf49846c2a5034b49e8e52607301c3fb2a95b070c078cdb81f5ce9
4
+ data.tar.gz: 865eba0522c078f3c475b23e242f963a6875010be73a4ee0b8d1411626df6afe
5
5
  SHA512:
6
- metadata.gz: 224c26fd5767508ffaddd0a8f824f6f70129728c7ff1d81834a33117a470d6e697b92d5a8b5f166f4679f57fe8619ef048936c9e45bd3a6717100b23dd427956
7
- data.tar.gz: 6babe35d31fcc72e070079b5e718f47e2157254f33a40f01989685bcf2e0d91a4cd73bb2793183f65d090593e6adb852b25ab6d6de2b2056b379d5e8bb08edca
6
+ metadata.gz: 0f4aee8345311d6354d2471e8bc674772217a87176c5519d12739ad07817ca1adc44f31d0f071433d0b35abceb057adbd0e8aa00df70baf9b552ae8040731974
7
+ data.tar.gz: 4d15e16bc5561c6f102e829df1d7964c8e1b5d6421e658ca8cc06d3304b83663a8ba399353b6b548173769e2f4513b05baf95258d473c6109424b537b1170467
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ commit-message:
8
+ prefix: "chore(deps)"
9
+ prefix-development: "chore(deps-dev)"
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "monthly"
14
+ cooldown:
15
+ default-days: 7
16
+ commit-message:
17
+ prefix: "chore(deps)"
@@ -2,8 +2,25 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
5
11
 
6
12
  jobs:
13
+ rubocop:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v7
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: '4.0'
20
+ bundler-cache: true
21
+ - name: RuboCop
22
+ run: bundle exec rubocop
23
+
7
24
  test:
8
25
  runs-on: ubuntu-latest
9
26
  strategy:
@@ -16,14 +33,12 @@ jobs:
16
33
  env:
17
34
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
18
35
  steps:
19
- - uses: actions/checkout@v7
20
- - uses: ruby/setup-ruby@v1
36
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37
+ - uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0
21
38
  with:
22
39
  ruby-version: ${{ matrix.ruby }}
23
40
  bundler-cache: true
24
41
  - name: Create tmp dir
25
42
  run: mkdir -p tmp
26
- - name: RuboCop
27
- run: bundle exec rubocop
28
43
  - name: RSpec
29
44
  run: bundle exec rspec
@@ -0,0 +1,35 @@
1
+ name: PR title
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, edited, synchronize, reopened]
6
+
7
+ permissions:
8
+ pull-requests: read
9
+
10
+ jobs:
11
+ pr-title:
12
+ name: pr-title
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ pull-requests: read
16
+ steps:
17
+ - uses: amannn/action-semantic-pull-request@66e72920af32222769c386d81f89656ebcb6d6d5 # v6.1.4
18
+ env:
19
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20
+ with:
21
+ # Same list as the action default (commitizen/conventional-commit-types).
22
+ # Listed explicitly so a default change in a later release cannot widen types.
23
+ types: |
24
+ feat
25
+ fix
26
+ docs
27
+ style
28
+ refactor
29
+ perf
30
+ test
31
+ build
32
+ ci
33
+ chore
34
+ revert
35
+ # requireScope is off (the action default). A scope is allowed but not required.
@@ -0,0 +1,86 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+"
7
+
8
+ permissions: {}
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17
+ with:
18
+ fetch-depth: 0
19
+ persist-credentials: false
20
+
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0
23
+ with:
24
+ ruby-version: "3.4"
25
+ bundler-cache: false
26
+
27
+ - name: Check version matches tag
28
+ env:
29
+ GITHUB_REF_NAME: ${{ github.ref_name }}
30
+ run: |
31
+ set -euo pipefail
32
+ [[ "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "Tag $GITHUB_REF_NAME is not vMAJOR.MINOR.PATCH" >&2; exit 1; }
33
+ tag="${GITHUB_REF_NAME#v}"
34
+ version="$(ruby -Ilib -rmifiel/version -e 'puts Mifiel::VERSION')"
35
+ if [ "$tag" != "$version" ]; then
36
+ echo "version mismatch: tag=${tag} version=${version}" >&2
37
+ exit 1
38
+ fi
39
+
40
+ - name: Check tagged commit is on main
41
+ run: |
42
+ set -euo pipefail
43
+ git fetch --no-tags origin main
44
+ if ! git merge-base --is-ancestor HEAD origin/main; then
45
+ echo "tagged commit $(git rev-parse --short HEAD) is not an ancestor of origin/main" >&2
46
+ exit 1
47
+ fi
48
+
49
+ - name: Build gem
50
+ run: gem build mifiel.gemspec
51
+
52
+ - name: Upload gem
53
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
54
+ with:
55
+ name: gem
56
+ path: mifiel-*.gem
57
+ if-no-files-found: error
58
+
59
+ publish:
60
+ needs: build
61
+ runs-on: ubuntu-latest
62
+ environment: release
63
+ permissions:
64
+ id-token: write
65
+ steps:
66
+ - name: Download gem
67
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
68
+ with:
69
+ name: gem
70
+ path: pkg
71
+
72
+ # Exchanges the OIDC token for a short-lived RubyGems API key.
73
+ # rubygems/release-gem also pushes a tag, which this workflow must not do.
74
+ - name: Configure RubyGems credentials
75
+ uses: rubygems/configure-rubygems-credentials@c6ca7f4bac0e29c9bde8eeae0a0a986b27efa05f # v2.2.0
76
+
77
+ - name: Publish to RubyGems
78
+ run: |
79
+ set -euo pipefail
80
+ shopt -s nullglob
81
+ gems=(pkg/*.gem)
82
+ if [ "${#gems[@]}" -ne 1 ]; then
83
+ echo "expected one gem, found ${#gems[@]}" >&2
84
+ exit 1
85
+ fi
86
+ gem push "${gems[0]}"
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.1.1"
3
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ ## [2.1.1](https://github.com/Mifiel/ruby-api-client/compare/v2.1.0...v2.1.1) (2026-12-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * PATCH document and template updates ([#24](https://github.com/Mifiel/ruby-api-client/issues/24)) ([94a81f8](https://github.com/Mifiel/ruby-api-client/commit/94a81f8a979671e504ef02ebb308f1f95d411d66))
9
+
10
+ ## v2.1.0 - 2026-10-11
11
+
12
+ - Add account-level webhook subscriptions and queued or instant triggering.
13
+ - Slim the README to installation and client setup. The API reference stays at docs.mifiel.com.
14
+
15
+ ## v2.0.0 - 2026-08-25
16
+
17
+ ### Breaking changes
18
+
19
+ - Require Ruby >= 3.2. Ruby 2.6 through 3.1 are no longer supported.
20
+ - Require `api-auth` ~> 2.0. Request signatures use a SHA1 digest.
21
+
22
+ ### Changed
23
+
24
+ - Run continuous integration on GitHub Actions for Ruby 3.3, 3.4, and 4.0 against Rails 7 and 8.
25
+ - Remove Travis CI and the Rails 6 appraisal.
data/RELEASING.md ADDED
@@ -0,0 +1,71 @@
1
+ ---
2
+ releasing_schema: 1
3
+ repo: Mifiel/ruby-api-client
4
+ default_branch: main
5
+ owners: ["@genaromadrid"]
6
+ packages:
7
+ - id: api-client
8
+ name: mifiel
9
+ path: "."
10
+ registry: rubygems
11
+ registry_url: https://rubygems.org
12
+ visibility: public
13
+ version_files:
14
+ - path: lib/mifiel/version.rb
15
+ const: "Mifiel::VERSION"
16
+ changelog:
17
+ path: CHANGELOG.md
18
+ format: keep-a-changelog
19
+ tag:
20
+ pattern: "v{version}"
21
+ annotated: true
22
+ signed: true
23
+ release_tool:
24
+ name: manual
25
+ mode: pr-only
26
+ commands:
27
+ prepare: []
28
+ verify:
29
+ - ["gem", "build", "mifiel.gemspec"]
30
+ - ["bundle", "exec", "rspec"]
31
+ publish:
32
+ mode: ci-trusted-publishing
33
+ workflow: .github/workflows/publish.yml
34
+ trigger: tag
35
+ environment: release
36
+ secrets: []
37
+ bot:
38
+ registry_credentials: none
39
+ ---
40
+
41
+ # Releasing mifiel
42
+
43
+ Pip, Mifiel's release-preparer bot, opens the release PR. This repo has no release-please workflow or config, and no workflow creates tags.
44
+
45
+ ## Steps
46
+
47
+ 1. Squash-merge the release PR.
48
+ 2. On the merge commit, a maintainer runs:
49
+
50
+ ```sh
51
+ git tag -s vX.Y.Z -m "mifiel X.Y.Z" && git push origin vX.Y.Z
52
+ ```
53
+
54
+ The organization tag ruleset restricts who can create, move, or delete `v*` tags. It does not verify tag signatures, and the publish workflow does not check them. Signing release tags with `git tag -s` is a process step. The publish workflow checks a `vMAJOR.MINOR.PATCH` tag (`v[0-9]+.[0-9]+.[0-9]+`), that it matches `Mifiel::VERSION`, and that the tagged commit is an ancestor of the default branch.
55
+
56
+ 3. Approve the `release` environment deployment.
57
+ 4. Confirm the version on RubyGems.
58
+
59
+ No GitHub Release.
60
+
61
+ Never delete or move a pushed tag.
62
+
63
+ ## Secrets and 2FA
64
+
65
+ - No RubyGems API token anywhere: not in repository, organization, or environment secrets.
66
+ - RubyGems MFA stays required. The gemspec sets `rubygems_mfa_required`.
67
+ - The RubyGems trusted publisher is owner `Mifiel`, repo `ruby-api-client`, workflow `publish.yml`, environment `release`.
68
+
69
+ ## Missing tag
70
+
71
+ RubyGems `mifiel` 2.1.0 was published on 2026-10-11 and the signed tag `v2.1.0` is missing. Genaro-only follow-up: after confirming the published gem matches a rebuild, push a signed tag on commit `a69bffe` (`bump v2.1.0`). Do not create that tag from a workflow.
@@ -5,7 +5,6 @@ require 'api-auth'
5
5
 
6
6
  module Mifiel
7
7
  class Document < Mifiel::Base
8
- get :all, '/documents'
9
8
  get :find, '/documents/:id'
10
9
 
11
10
  get :raw_file, '/documents/:id/file', plain: true
@@ -18,7 +17,7 @@ module Mifiel
18
17
 
19
18
  get :raw_xml, '/documents/:id/xml', plain: true
20
19
 
21
- put :save, '/documents/:id'
20
+ patch :save, '/documents/:id'
22
21
  delete :delete, '/documents/:id'
23
22
  post :create_from_template, '/templates/:template_id/generate_document', timeout: 60
24
23
  post :create_many_from_template, '/templates/:template_id/generate_documents', timeout: 60
@@ -4,7 +4,7 @@ module Mifiel
4
4
  class Template < Mifiel::Base
5
5
  get :all, '/templates'
6
6
  get :find, '/templates/:id'
7
- put :save, '/templates/:id'
7
+ patch :save, '/templates/:id'
8
8
  post :create, '/templates'
9
9
  delete :delete, '/templates/:id'
10
10
  get :fields, '/templates/:id/fields'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mifiel
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.1' # x-release-please-version
5
5
  end
data/mifiel.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = ['Genaro Madrid']
12
12
  spec.email = ['genmadrid@gmail.com']
13
13
  spec.summary = 'Ruby SDK for mifiel.com.'
14
- spec.homepage = 'https://www.mifiel.com'
14
+ spec.homepage = 'https://github.com/Mifiel/ruby-api-client'
15
15
  spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
@@ -24,5 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'api-auth', '~> 2.0'
25
25
  spec.add_dependency 'flexirest', '~> 1.6'
26
26
 
27
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
28
+ spec.metadata['homepage_uri'] = 'https://github.com/Mifiel/ruby-api-client'
29
+ spec.metadata['source_code_uri'] = 'https://github.com/Mifiel/ruby-api-client'
30
+ spec.metadata['changelog_uri'] = 'https://github.com/Mifiel/ruby-api-client/blob/main/CHANGELOG.md'
27
31
  spec.metadata['rubygems_mfa_required'] = 'true'
28
32
  end
@@ -0,0 +1,17 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "changelog-path": "CHANGELOG.md",
5
+ "release-type": "ruby",
6
+ "package-name": "mifiel",
7
+ "version-file": "lib/mifiel/version.rb",
8
+ "include-component-in-tag": false,
9
+ "bump-minor-pre-major": false,
10
+ "bump-patch-for-minor-pre-major": false,
11
+ "draft": false,
12
+ "prerelease": false
13
+ }
14
+ },
15
+ "last-release-sha": "a69bffede6f1b7edcf37380cd3dfa1b36ba39037",
16
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
17
+ }
@@ -68,7 +68,7 @@ describe Mifiel::Document do
68
68
  end
69
69
 
70
70
  describe 'working with a document' do
71
- let!(:document) { described_class.all.first }
71
+ let!(:document) { described_class.find('doc-id') }
72
72
 
73
73
  describe '#raw_file' do
74
74
  let(:document_content) { 'some-pdf-formatted-string' }
@@ -26,6 +26,7 @@ describe Mifiel::Template do
26
26
  let!(:template) { described_class.find(template_id) }
27
27
 
28
28
  it_behaves_like 'a valid template'
29
+
29
30
  it { expect(template.id).to eq(template_id) }
30
31
  end
31
32
 
@@ -3,6 +3,9 @@
3
3
  require 'sinatra/base'
4
4
 
5
5
  class FakeMifiel < Sinatra::Base # rubocop:disable Metrics/ClassLength
6
+ # WebMock sends Host: app.mifiel.com. Sinatra's development host check only allows localhost.
7
+ set :host_authorization, { permitted_hosts: ['.mifiel.com'] }
8
+
6
9
  get '/api/v1/keys' do
7
10
  content_type :json
8
11
  status 200
@@ -80,6 +83,12 @@ class FakeMifiel < Sinatra::Base # rubocop:disable Metrics/ClassLength
80
83
  ).to_json
81
84
  end
82
85
 
86
+ get '/api/v1/documents/:id' do
87
+ content_type :json
88
+ status 200
89
+ document(id: params[:id]).to_json
90
+ end
91
+
83
92
  get '/api/v1/documents/:id/file' do
84
93
  status 200
85
94
  'some-pdf-formatted-string'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mifiel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genaro Madrid
@@ -44,14 +44,20 @@ extensions: []
44
44
  extra_rdoc_files: []
45
45
  files:
46
46
  - ".editorconfig"
47
+ - ".github/dependabot.yml"
47
48
  - ".github/workflows/ci.yml"
49
+ - ".github/workflows/pr-title.yml"
50
+ - ".github/workflows/publish.yml"
48
51
  - ".gitignore"
52
+ - ".release-please-manifest.json"
49
53
  - ".rspec"
50
54
  - ".rubocop.yml"
51
55
  - Appraisals
56
+ - CHANGELOG.md
52
57
  - Gemfile
53
58
  - LICENSE.txt
54
59
  - README.md
60
+ - RELEASING.md
55
61
  - Rakefile
56
62
  - gemfiles/rails_7.gemfile
57
63
  - gemfiles/rails_8.gemfile
@@ -68,6 +74,7 @@ files:
68
74
  - mifiel-ruby-api-client.sublime-project
69
75
  - mifiel.gemspec
70
76
  - mise.toml
77
+ - release-please-config.json
71
78
  - spec/fixtures/FIEL_AAA010101AAA.cer
72
79
  - spec/fixtures/FIEL_AAA010101AAA.key
73
80
  - spec/fixtures/example.pdf
@@ -78,10 +85,14 @@ files:
78
85
  - spec/mifiel/user_spec.rb
79
86
  - spec/spec_helper.rb
80
87
  - spec/support/fake_mifiel.rb
81
- homepage: https://www.mifiel.com
88
+ homepage: https://github.com/Mifiel/ruby-api-client
82
89
  licenses:
83
90
  - MIT
84
91
  metadata:
92
+ allowed_push_host: https://rubygems.org
93
+ homepage_uri: https://github.com/Mifiel/ruby-api-client
94
+ source_code_uri: https://github.com/Mifiel/ruby-api-client
95
+ changelog_uri: https://github.com/Mifiel/ruby-api-client/blob/main/CHANGELOG.md
85
96
  rubygems_mfa_required: 'true'
86
97
  rdoc_options: []
87
98
  require_paths:
@@ -97,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
108
  - !ruby/object:Gem::Version
98
109
  version: '0'
99
110
  requirements: []
100
- rubygems_version: 4.0.20
111
+ rubygems_version: 3.6.9
101
112
  specification_version: 4
102
113
  summary: Ruby SDK for mifiel.com.
103
114
  test_files: []