ecfr 1.0.14 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e764bf9ef790d05735e7f4110d05dbdac69ec621785e911cfe43c8e1a55cb0e
4
- data.tar.gz: bb06e18019a19805911423655419c50dd622b0f60f34360d1e60e04c7045b73f
3
+ metadata.gz: 72944625e1bcb85c29e2fff986ac16e0d6c207791abfcea2f7f10ac7ab12b298
4
+ data.tar.gz: 7171f1a6e17465201664a6eedd6fe0d8bbf085d9fec531948110f90ef381354c
5
5
  SHA512:
6
- metadata.gz: 319d536cefbf939750cc3b5658075108b78908143b1e7a7812896214eecbb5d81809a14bf00e16dfe1494e7bc5107dc3d8175a281a756a9a544d1da382be6f25
7
- data.tar.gz: a3f85da3ab39ce3ea01ca0c778fa9007da6cae80de7e341e6d0ccac707b2b31b3c1e5d6b7e1dbe0e7c736db99246f6194f894f1365c435d5c9917d8c504d0896
6
+ metadata.gz: 72f8d38d3bcc820235bc816d14fcd761ab522131c887b0e0f4733c3001bbc69ece5cb64d1d280d98df7176a4d90dc59d16d379948437a6666f1d18270e936ead
7
+ data.tar.gz: d3b64de1ab08d60ee5fca9117f35a9d74545117b8f6a3b89aaf18b2eae75a951249d11e0a1249df75b5d8c45e1d5bf5a3d3887e123c238bf928a38871c893f67
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.0] - 2024-06-28
4
+ ### Updates
5
+ - Add classes to versioner service for SGML issue packages (e7743eeb)
6
+ - NOTE: this is an internal only endpoint
7
+
3
8
  ## [1.0.14] - 2024-02-13
4
9
  ### Updates
5
10
  - Update path to admin API endpoints (eb267f08)
data/lib/ecfr/client.rb CHANGED
@@ -87,7 +87,6 @@ module Ecfr
87
87
  faraday.use Faraday::UserAgent::Middleware, Ecfr.config.user_agent
88
88
 
89
89
  if Ecfr.config.log_http_requests
90
- # https://lostisland.github.io/faraday/middleware/instrumentation
91
90
  faraday.request :instrumentation
92
91
 
93
92
  faraday.response :logger, Ecfr.config.logger, Ecfr.config.logger_options
data/lib/ecfr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ecfr
4
- VERSION = "1.0.14"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -7,6 +7,7 @@ module Ecfr
7
7
  # note: structure must be required before ancestors
8
8
  require_relative "structure"
9
9
  require_relative "ancestors"
10
+ require_relative "issue_package"
10
11
  require_relative "title"
11
12
  require_relative "xml_content"
12
13
 
@@ -0,0 +1,48 @@
1
+ module Ecfr
2
+ module VersionerService
3
+ class IssuePackage
4
+ # Represents a single volume of a title from a specific issue. Only
5
+ # volumes that have changes are sent over as part of the issue for
6
+ # publication. These changed volumes are combined to create a final XML
7
+ # file representing the title for that issue date.
8
+ class IssueVolume
9
+ require_relative "sha_comparison"
10
+ require_relative "title_version"
11
+
12
+ include AttributeMethodDefinition
13
+ extend Extensible
14
+
15
+ attribute :id,
16
+ type: :integer,
17
+ desc: "issue package database id"
18
+
19
+ attribute :converted_title_xml,
20
+ type: ShaComparison,
21
+ desc: ""
22
+
23
+ attribute :converted_xml,
24
+ type: ShaComparison,
25
+ desc: "sha after conversion to GPO bulk XML format"
26
+
27
+ attribute :extracted_xml,
28
+ type: ShaComparison,
29
+ desc: "base sha for the volume extracted from the GPO bulk data XML"
30
+
31
+ attribute :title,
32
+ type: :integer,
33
+ desc: "Title number"
34
+
35
+ attribute :title_version,
36
+ type: TitleVersion,
37
+ desc: "the version record for the title associated with this volume"
38
+
39
+ attribute :volume,
40
+ type: :integer,
41
+ desc: "volume number"
42
+
43
+ attribute :volume_file_sha,
44
+ desc: "file sha for this volume"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,19 @@
1
+ module Ecfr
2
+ module VersionerService
3
+ class IssuePackage
4
+ # A wrapper for sha values after various types of processing
5
+ class ShaComparison
6
+ include AttributeMethodDefinition
7
+
8
+ attribute :sha,
9
+ desc: "base file sha"
10
+
11
+ attribute :some_blanks_sha,
12
+ desc: "file sha with some whitespace removed"
13
+
14
+ attribute :no_blanks_sha,
15
+ desc: "file sha with all whitespace removed"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ module Ecfr
2
+ module VersionerService
3
+ class IssuePackage
4
+ # TitleVersion represents the full XML for a specific title for a single
5
+ # issue date.
6
+ class TitleVersion
7
+ include AttributeMethodDefinition
8
+
9
+ attribute :id,
10
+ type: :integer,
11
+ desc: "title version database id"
12
+
13
+ attribute :sgml_sourced_xml_sha,
14
+ desc: "sha of of xml file converted from SGML with tables converted from the GPO table format"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,49 @@
1
+ module Ecfr
2
+ module VersionerService
3
+ # NOTE: IssuePackages are an internal API and are not publicly accessible
4
+ #
5
+ # Issue packages represent the data we receive from our upstream datasource
6
+ # and we then process into XML for ingestion.
7
+ # Various SHAs are calculated to allow for error checking and discrepency
8
+ # identification against the GPO bulk data XML.
9
+ #
10
+ # Each issue package will contain a file for each volume in each title that
11
+ # are changing in that issue.
12
+ class IssuePackage < Base
13
+ require_relative "issue_package/issue_volume"
14
+
15
+ result_key :issue_packages
16
+
17
+ attribute :id,
18
+ type: :integer,
19
+ desc: "issue pacakge database id"
20
+
21
+ attribute :issue_date,
22
+ type: :date,
23
+ desc: "issue date this package represents"
24
+
25
+ attribute :issue_volumes,
26
+ type: Array(IssueVolume),
27
+ desc: "array of the volumes in this issue package"
28
+
29
+ attribute :received_at,
30
+ type: :datetime,
31
+ desc: "when this issue package was received"
32
+
33
+ ISSUE_PACKAGES_PATH = "v1/issue_packages"
34
+
35
+ #
36
+ # Retreives the list of Issue Packages from the last 30 days
37
+ #
38
+ # @return [<IssuePackage>] array of Issue Packages and associated
39
+ # Issue Volumes
40
+ #
41
+ def self.all
42
+ perform(
43
+ :get,
44
+ ISSUE_PACKAGES_PATH
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecfr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peregrinator
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-13 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -349,6 +349,10 @@ files:
349
349
  - lib/ecfr/versioner_service/ancestors/node_summary.rb
350
350
  - lib/ecfr/versioner_service/api_documentation.rb
351
351
  - lib/ecfr/versioner_service/base.rb
352
+ - lib/ecfr/versioner_service/issue_package.rb
353
+ - lib/ecfr/versioner_service/issue_package/issue_volume.rb
354
+ - lib/ecfr/versioner_service/issue_package/sha_comparison.rb
355
+ - lib/ecfr/versioner_service/issue_package/title_version.rb
352
356
  - lib/ecfr/versioner_service/status.rb
353
357
  - lib/ecfr/versioner_service/structure.rb
354
358
  - lib/ecfr/versioner_service/title.rb