diff --git a/.gitignore b/.gitignore index 48741b8..6386cee 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /pkg/ /spec/reports/ /tmp/ +/faithteams-api/*.env # rspec failure tracking .rspec_status diff --git a/CHANGELOG.md b/CHANGELOG.md index e471e91..1285fe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.6.0] + +### Changed + +1. Relax patch-level dependency pins to minor-level to allow security patch updates. (ISG-92) +1. Remove transitive dependencies (logger, ostruct, rexml, thor) from gemspec; add rexml and thor as Gemfile security floor constraints. (ISG-92) + +## [4.5.0] + +### Added + +1. Add Bruno API Client (to eventually replace ThunderClient). (IN-2728) + ## [4.4.0] ### Changed diff --git a/Gemfile b/Gemfile index c4980cb..64e96d9 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,8 @@ source "https://rubygems.org" # Specify your gem's dependencies in faithteams-api.gemspec gemspec + +# Security floors for transitive dependencies not declared in the gemspec. +# These are not upper-bounded — bundle audit is the ongoing security check. +gem "rexml", ">= 3.4.2" # webmock → crack → rexml +gem "thor", ">= 1.4.0" # guard-rspec → guard → thor diff --git a/Gemfile.lock b/Gemfile.lock index 0e064c9..95c4b10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,18 +1,14 @@ PATH remote: . specs: - faithteams-api (4.4.0) - activesupport (~> 7.2.2) + faithteams-api (4.6.0) + activesupport (~> 7.2) http (~> 5.1) - logger (~> 1.6.1) - ostruct (~> 0.6.0) - rexml (~> 3.3.9) - thor (~> 1.4.0) GEM remote: https://rubygems.org/ specs: - activesupport (7.2.2.1) + activesupport (7.2.3.1) base64 benchmark (>= 0.3) bigdecimal @@ -21,34 +17,36 @@ GEM drb i18n (>= 1.6, < 2) logger (>= 1.4.2) - minitest (>= 5.1) + minitest (>= 5.1, < 6) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.8) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) - crack (1.0.0) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + crack (1.0.1) bigdecimal rexml - diff-lcs (1.5.1) + diff-lcs (1.6.2) docile (1.4.1) domain_name (0.6.20240107) - drb (2.2.1) - ffi (1.17.0) + drb (2.2.3) + ffi (1.17.4) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake - formatador (1.1.0) - guard (2.19.0) + formatador (1.2.3) + reline + guard (2.20.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) + logger (~> 1.6) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) @@ -60,67 +58,70 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - hashdiff (1.1.2) - http (5.2.0) + hashdiff (1.2.1) + http (5.3.1) addressable (~> 2.8) - base64 (~> 0.1) http-cookie (~> 1.0) http-form_data (~> 2.2) llhttp-ffi (~> 0.5.0) - http-cookie (1.0.8) + http-cookie (1.1.0) domain_name (~> 0.5) http-form_data (2.3.0) - i18n (1.14.6) + i18n (1.14.8) concurrent-ruby (~> 1.0) - json (2.13.2) + io-console (0.8.2) + json (2.19.3) language_server-protocol (3.17.0.5) lint_roller (1.1.0) - listen (3.9.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - llhttp-ffi (0.5.0) + llhttp-ffi (0.5.1) ffi-compiler (~> 1.0) rake (~> 13.0) - logger (1.6.3) - lumberjack (1.2.10) + logger (1.7.0) + lumberjack (1.4.2) method_source (1.1.0) - minitest (5.25.4) + minitest (5.27.0) nenv (0.3.0) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - ostruct (0.6.1) parallel (1.27.0) - parser (3.3.9.0) + parser (3.3.11.0) ast (~> 2.4.1) racc - prism (1.4.0) - pry (0.15.0) + prism (1.9.0) + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (6.0.1) + reline (>= 0.6.0) + public_suffix (7.0.5) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - regexp_parser (2.11.2) - rexml (3.3.9) - rspec (3.13.0) + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + rexml (3.4.4) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) + rspec-core (3.13.6) rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.2) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.2) - rubocop (1.73.2) + rspec-support (3.13.7) + rubocop (1.86.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -128,22 +129,22 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.46.0) + rubocop-ast (1.49.1) parser (>= 3.3.7.2) - prism (~> 1.4) - rubocop-performance (1.24.0) + prism (~> 1.7) + rubocop-performance (1.26.1) lint_roller (~> 1.1) - rubocop (>= 1.72.1, < 2.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) rubocop-rake (0.7.1) lint_roller (~> 1.1) rubocop (>= 1.72.1) - rubocop-rspec (3.5.0) + rubocop-rspec (3.9.0) lint_roller (~> 1.1) - rubocop (~> 1.72, >= 1.72.1) + rubocop (~> 1.81) ruby-progressbar (1.13.0) securerandom (0.4.1) shellany (0.0.1) @@ -151,19 +152,19 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.1) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - thor (1.4.0) + thor (1.5.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.5) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - webmock (3.24.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + webmock (3.26.2) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - yard (0.9.37) + yard (0.9.38) PLATFORMS ruby @@ -173,14 +174,16 @@ DEPENDENCIES faithteams-api! guard-rspec (~> 4.7) rake (~> 13.0) + rexml (>= 3.4.2) rspec (~> 3.12) - rubocop (~> 1.73.2) - rubocop-performance (~> 1.24.0) - rubocop-rake (~> 0.7.1) - rubocop-rspec (~> 3.5.0) + rubocop (~> 1.73) + rubocop-performance (~> 1.24) + rubocop-rake (~> 0.7) + rubocop-rspec (~> 3.5) simplecov (~> 0.21) + thor (>= 1.4.0) webmock (~> 3.18) - yard (~> 0.9.36) + yard (~> 0.9) BUNDLED WITH - 2.5.7 + 4.0.9 diff --git a/README.md b/README.md index 05b2d7c..1b5a0e0 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,25 @@ Or install it yourself as: `gem install faithteams` +## VS Code Bruno Extension + +We are now using the [Bruno API Client](https://docs.usebruno.com/introduction/what-is-bruno) for developing and testing 2nd party API requests. You can use a desktop app or VS Code extension to use Bruno. + +### Desktop App + +1. Simply follow these instructions for your desktop app [installation options](https://docs.usebruno.com/get-started/bruno-basics/download). + +### VS Code Extension + +1. If you don't already have it, install the VS Code Bruno Extension. +1. After opening the extension, click the + button to open a "collection". + 1. Find the root level '[second_party]-api' directory. (ie 'faithteams-api') +1. Make a copy of the .env.template file (and make sure to just call it .env) and fill in the necessary values from 1Password. +1. In the left pane, open the ... menu beside faithteams-api and select *settings*. +1. Select your desired environment to use with this collection in the upper right (most likely *FaithTeams*). +1. You should now be ready to make some API calls! +1. See Bruno's [VS Code Extension Documentation](https://docs.usebruno.com/vs-code-extension/overview) for more details. + ## Contributing ### How to Contribute diff --git a/faithteams-api.gemspec b/faithteams-api.gemspec index 8083a5e..919aa50 100644 --- a/faithteams-api.gemspec +++ b/faithteams-api.gemspec @@ -32,22 +32,18 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "activesupport", "~> 7.2.2" + spec.add_dependency "activesupport", "~> 7.2" spec.add_dependency "http", "~> 5.1" - spec.add_dependency "logger", "~> 1.6.1" - spec.add_dependency "ostruct", "~> 0.6.0" - spec.add_dependency "rexml", "~> 3.3.9" # only needs to be specified to address security warning - spec.add_dependency "thor", "~> 1.4.0" spec.add_development_dependency "byebug", "~> 11.1" spec.add_development_dependency "guard-rspec", "~> 4.7" spec.add_development_dependency "simplecov", "~> 0.21" spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rspec", "~> 3.12" - spec.add_development_dependency "rubocop", "~> 1.73.2" - spec.add_development_dependency "rubocop-performance", "~> 1.24.0" - spec.add_development_dependency "rubocop-rake", "~> 0.7.1" - spec.add_development_dependency "rubocop-rspec", "~> 3.5.0" + spec.add_development_dependency "rubocop", "~> 1.73" + spec.add_development_dependency "rubocop-performance", "~> 1.24" + spec.add_development_dependency "rubocop-rake", "~> 0.7" + spec.add_development_dependency "rubocop-rspec", "~> 3.5" spec.add_development_dependency "webmock", "~> 3.18" - spec.add_development_dependency "yard", "~> 0.9.36" + spec.add_development_dependency "yard", "~> 0.9" end diff --git a/faithteams-api/.env.template b/faithteams-api/.env.template new file mode 100644 index 0000000..4d9aef8 --- /dev/null +++ b/faithteams-api/.env.template @@ -0,0 +1,4 @@ +# API V1 & V2 +user_id= +password= +user_credentials=: diff --git a/faithteams-api/Authenticate.bru b/faithteams-api/Authenticate.bru new file mode 100644 index 0000000..73848ae --- /dev/null +++ b/faithteams-api/Authenticate.bru @@ -0,0 +1,25 @@ +meta { + name: Authenticate + type: http + seq: 1 +} + +get { + url: https://api.faithteams.com/api/v1/authenticate + body: none + auth: basic +} + +auth:basic { + username: {{process.env.user_id}} + password: {{process.env.password}} +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("auth_token", body.data.token); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/Batch Create.bru b/faithteams-api/api-v2.faithteams.com/Batch/Batch Create.bru new file mode 100644 index 0000000..86fce9e --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/Batch Create.bru @@ -0,0 +1,23 @@ +meta { + name: Batch Create + type: http + seq: 3 +} + +post { + url: https://api-v2.faithteams.com/batches + body: json + auth: inherit +} + +body:json { + { + "title":"Tithely 2023-07-19 Bank", + "dtm":"2023-07-19 00:00:00", + "status":"O" + } +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/Batch Totals.bru b/faithteams-api/api-v2.faithteams.com/Batch/Batch Totals.bru new file mode 100644 index 0000000..ea83534 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/Batch Totals.bru @@ -0,0 +1,19 @@ +meta { + name: Batch Totals + type: http + seq: 4 +} + +get { + url: https://api-v2.faithteams.com/batches/totals?batchIds={{batch_id}},{{batch_id_2}} + body: none + auth: inherit +} + +params:query { + batchIds: {{batch_id}},{{batch_id_2}} +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/Batch Update.bru b/faithteams-api/api-v2.faithteams.com/Batch/Batch Update.bru new file mode 100644 index 0000000..13bb866 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/Batch Update.bru @@ -0,0 +1,27 @@ +meta { + name: Batch Update + type: http + seq: 5 +} + +put { + url: https://api-v2.faithteams.com/batches/{{batch_id}} + body: json + auth: inherit +} + +body:json { + { + "orgId": {{organization_id}}, + "status": "D", + "title": "Tithely 2023-07-19 Bank", + "dtm": "2023-07-19 00:00:00", + "updatedDtm": "2023-08-28 23:45:44", + "updatedUser": 27985, + "contributions": [] + } +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/Batch.bru b/faithteams-api/api-v2.faithteams.com/Batch/Batch.bru new file mode 100644 index 0000000..9a075bc --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/Batch.bru @@ -0,0 +1,15 @@ +meta { + name: Batch + type: http + seq: 2 +} + +get { + url: https://api-v2.faithteams.com/batches/{{batch_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/Batches.bru b/faithteams-api/api-v2.faithteams.com/Batch/Batches.bru new file mode 100644 index 0000000..99e0719 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/Batches.bru @@ -0,0 +1,32 @@ +meta { + name: Batches + type: http + seq: 1 +} + +get { + url: https://api-v2.faithteams.com/batches?sort=dtm&sortDirection=desc&dtm=2023-08-28 + body: none + auth: inherit +} + +params:query { + sort: dtm + sortDirection: desc + dtm: 2023-08-28 + ~status: O + ~title: 2023-08-28 Central Campus Tithely Card + ~limit: + ~start: + ~batchIds: 200782 +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("batch_id", String(body.data[0].batchId)); + bru.setEnvVar("batch_id_2", String(body.data[1].batchId)); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Batch/folder.bru b/faithteams-api/api-v2.faithteams.com/Batch/folder.bru new file mode 100644 index 0000000..22854f9 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Batch/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Batch + seq: 1 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Type.bru b/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Type.bru new file mode 100644 index 0000000..4b087fd --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Type.bru @@ -0,0 +1,15 @@ +meta { + name: Contribution Type + type: http + seq: 2 +} + +get { + url: https://api-v2.faithteams.com/contributiontypes/{{contribution_type_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Types.bru b/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Types.bru new file mode 100644 index 0000000..9a95e61 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution Type/Contribution Types.bru @@ -0,0 +1,20 @@ +meta { + name: Contribution Types + type: http + seq: 1 +} + +get { + url: https://api-v2.faithteams.com/contributiontypes + body: none + auth: inherit +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("contribution_type_id", String(body.data[0].contributionTypeId)); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution Type/folder.bru b/faithteams-api/api-v2.faithteams.com/Contribution Type/folder.bru new file mode 100644 index 0000000..10c6884 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution Type/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Contribution Type + seq: 4 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution/Contribution Create.bru b/faithteams-api/api-v2.faithteams.com/Contribution/Contribution Create.bru new file mode 100644 index 0000000..d8a8e01 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution/Contribution Create.bru @@ -0,0 +1,40 @@ +meta { + name: Contribution Create + type: http + seq: 3 +} + +post { + url: https://api-v2.faithteams.com/contributions + body: json + auth: inherit +} + +body:json { + [ + { + "recordType":"H", + "personId":779137, + "batchId":195770, + "amount":"100.00", + "fee":"2.00", + "netAmount":"98.00", + "contributionTypeId":24, + "status":"A", + "note":"Date: 2023-07-17, Method: card, Memo: for the animals" + }, + { + "recordType":"D", + "fundId":7894, + "personId":779137, + "batchId":195770, + "amount":"100.00", + "fee":"2.00", + "netAmount":"98.00" + } + ] +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution/Contribution.bru b/faithteams-api/api-v2.faithteams.com/Contribution/Contribution.bru new file mode 100644 index 0000000..bc9107c --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution/Contribution.bru @@ -0,0 +1,15 @@ +meta { + name: Contribution + type: http + seq: 2 +} + +get { + url: https://api-v2.faithteams.com/contributions/{{contribution_parent_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution/Contributions.bru b/faithteams-api/api-v2.faithteams.com/Contribution/Contributions.bru new file mode 100644 index 0000000..334bc99 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution/Contributions.bru @@ -0,0 +1,34 @@ +meta { + name: Contributions + type: http + seq: 1 +} + +get { + url: https://api-v2.faithteams.com/contributions?startDt=1923-01-01&endDt=2033-01-01&resultType=sum&statuses=A + body: none + auth: inherit +} + +params:query { + startDt: 1923-01-01 + endDt: 2033-01-01 + resultType: sum + statuses: A + ~filters: true + ~personIds: 769839 + ~groupBy: personId,fundId + ~limit: 500 + ~sort: dtm + ~sortDirection: asc +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("contribution_id", String(body.data[0].contributionId)); + bru.setEnvVar("contribution_parent_id", String(body.data[0].parentId)); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Contribution/folder.bru b/faithteams-api/api-v2.faithteams.com/Contribution/folder.bru new file mode 100644 index 0000000..f179863 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Contribution/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Contribution + seq: 3 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/api-v2.faithteams.com/Error/Integer Too Big.bru b/faithteams-api/api-v2.faithteams.com/Error/Integer Too Big.bru new file mode 100644 index 0000000..ac05d6b --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Error/Integer Too Big.bru @@ -0,0 +1,15 @@ +meta { + name: Integer Too Big + type: http + seq: 2 +} + +get { + url: https://api-v2.faithteams.com/contributiontypes/9999999999999 + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Error/Not Found.bru b/faithteams-api/api-v2.faithteams.com/Error/Not Found.bru new file mode 100644 index 0000000..9c65422 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Error/Not Found.bru @@ -0,0 +1,15 @@ +meta { + name: Not Found + type: http + seq: 1 +} + +get { + url: https://api-v2.faithteams.com/contributiontypes/9999999 + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Error/folder.bru b/faithteams-api/api-v2.faithteams.com/Error/folder.bru new file mode 100644 index 0000000..9c44036 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Error/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Error + seq: 5 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/api-v2.faithteams.com/Fund/Fund Create.bru b/faithteams-api/api-v2.faithteams.com/Fund/Fund Create.bru new file mode 100644 index 0000000..e1fe4d6 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Fund/Fund Create.bru @@ -0,0 +1,30 @@ +meta { + name: Fund Create + type: http + seq: 3 +} + +post { + url: https://api-v2.faithteams.com/funds + body: json + auth: inherit +} + +body:json { + { + "fundId":-1, + "name":"Cat Fund", + "description":"$$ for kitties", + "status":"A", + "onlineStatus":"I", + "taxDeductible":"Y", + "isDefault":"N", + "sort":1, + "showInternally":true, + "showExternally":false + } +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Fund/Fund Update.bru b/faithteams-api/api-v2.faithteams.com/Fund/Fund Update.bru new file mode 100644 index 0000000..cc33d66 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Fund/Fund Update.bru @@ -0,0 +1,32 @@ +meta { + name: Fund Update + type: http + seq: 4 +} + +put { + url: https://api-v2.faithteams.com/funds/{{fund_id}} + body: json + auth: inherit +} + +body:json { + { + "name": "Doggy Fund", + "description": "$ for the pups", + "status": "A", + "onlineStatus": "I", + "sort": 0, + "taxDeductible": "Y", + "isDefault": "Y", + "createdDtm": "2023-04-17 15:01:26", + "createdUser": 27850, + "updatedDtm": "2023-04-17 15:21:37", + "updatedUser": 27850, + "defaultFund": true + } +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Fund/Fund.bru b/faithteams-api/api-v2.faithteams.com/Fund/Fund.bru new file mode 100644 index 0000000..7eabe4e --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Fund/Fund.bru @@ -0,0 +1,15 @@ +meta { + name: Fund + type: http + seq: 2 +} + +get { + url: https://api-v2.faithteams.com/funds/{{fund_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Fund/Funds.bru b/faithteams-api/api-v2.faithteams.com/Fund/Funds.bru new file mode 100644 index 0000000..817db53 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Fund/Funds.bru @@ -0,0 +1,20 @@ +meta { + name: Funds + type: http + seq: 1 +} + +get { + url: https://api-v2.faithteams.com/funds + body: none + auth: inherit +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("fund_id", String(body.data[0].fundId)); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/api-v2.faithteams.com/Fund/folder.bru b/faithteams-api/api-v2.faithteams.com/Fund/folder.bru new file mode 100644 index 0000000..c382207 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/Fund/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Fund + seq: 2 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/api-v2.faithteams.com/folder.bru b/faithteams-api/api-v2.faithteams.com/folder.bru new file mode 100644 index 0000000..82f25c9 --- /dev/null +++ b/faithteams-api/api-v2.faithteams.com/folder.bru @@ -0,0 +1,13 @@ +meta { + name: api-v2.faithteams.com + seq: 3 +} + +auth { + mode: basic +} + +auth:basic { + username: {{process.env.user_id}} + password: {{process.env.password}} +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Authenticate.bru b/faithteams-api/app.faithteams.com-api-v2/Authenticate.bru new file mode 100644 index 0000000..142895d --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Authenticate.bru @@ -0,0 +1,26 @@ +meta { + name: Authenticate + type: http + seq: 8 +} + +post { + url: https://app.faithteams.com/api/v2/authenticate + body: none + auth: inherit +} + +script:pre-request { + // Require the btoa library + const btoa = require('btoa'); + // Get the username and password from environment variables + const authorization = bru.getEnvVar("user_id") + ":" + bru.getEnvVar("password"); + // Encode the credentials using btoa() + const authorizationBase64 = btoa(authorization); + // Set the Authorization header with the Base64-encoded string + req.setHeader("Authorization", "Basic " + authorizationBase64); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Checkins.bru b/faithteams-api/app.faithteams.com-api-v2/Checkins.bru new file mode 100644 index 0000000..f371c81 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Checkins.bru @@ -0,0 +1,15 @@ +meta { + name: Checkins + type: http + seq: 6 +} + +get { + url: https://app.faithteams.com/api/v2/checkins + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Error/Not Found 2.bru b/faithteams-api/app.faithteams.com-api-v2/Error/Not Found 2.bru new file mode 100644 index 0000000..0c2c74e --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Error/Not Found 2.bru @@ -0,0 +1,15 @@ +meta { + name: Not Found 2 + type: http + seq: 2 +} + +get { + url: https://app.faithteams.com/api/v2/people/memberships/10 + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Error/Not Found.bru b/faithteams-api/app.faithteams.com-api-v2/Error/Not Found.bru new file mode 100644 index 0000000..1f8c23c --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Error/Not Found.bru @@ -0,0 +1,15 @@ +meta { + name: Not Found + type: http + seq: 1 +} + +get { + url: https://app.faithteams.com/api/v2/tags + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Error/folder.bru b/faithteams-api/app.faithteams.com-api-v2/Error/folder.bru new file mode 100644 index 0000000..171b9cf --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Error/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Error + seq: 4 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/Create Person.bru b/faithteams-api/app.faithteams.com-api-v2/People/Create Person.bru new file mode 100644 index 0000000..ce1e90e --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/Create Person.bru @@ -0,0 +1,28 @@ +meta { + name: Create Person + type: http + seq: 3 +} + +post { + url: https://app.faithteams.com/api/v2/people + body: json + auth: inherit +} + +body:json { + { + "firstName": "Bart", + "lastName": "Simpson", + "gender": "M" + } +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("person_id_created", body.data.personId); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/People Memberships.bru b/faithteams-api/app.faithteams.com-api-v2/People/People Memberships.bru new file mode 100644 index 0000000..1e08ded --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/People Memberships.bru @@ -0,0 +1,15 @@ +meta { + name: People Memberships + type: http + seq: 5 +} + +get { + url: https://app.faithteams.com/api/v2/people/memberships + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/People.bru b/faithteams-api/app.faithteams.com-api-v2/People/People.bru new file mode 100644 index 0000000..2fd1dc7 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/People.bru @@ -0,0 +1,27 @@ +meta { + name: People + type: http + seq: 1 +} + +get { + url: https://app.faithteams.com/api/v2/people?status=A + body: none + auth: inherit +} + +params:query { + status: A + ~lastName: Simpson + ~firstName: Homer + ~homeEmail: bart@simpsons.com +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("person_id", body.data[0].personId); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/Person Tags.bru b/faithteams-api/app.faithteams.com-api-v2/People/Person Tags.bru new file mode 100644 index 0000000..96f929c --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/Person Tags.bru @@ -0,0 +1,15 @@ +meta { + name: Person Tags + type: http + seq: 6 +} + +get { + url: https://app.faithteams.com/api/v2/people/{{person_id}}/tags + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/Person.bru b/faithteams-api/app.faithteams.com-api-v2/People/Person.bru new file mode 100644 index 0000000..df60192 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/Person.bru @@ -0,0 +1,15 @@ +meta { + name: Person + type: http + seq: 2 +} + +get { + url: https://app.faithteams.com/api/v2/people/{{person_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/Update Person.bru b/faithteams-api/app.faithteams.com-api-v2/People/Update Person.bru new file mode 100644 index 0000000..dfe6528 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/Update Person.bru @@ -0,0 +1,26 @@ +meta { + name: Update Person + type: http + seq: 4 +} + +put { + url: https://app.faithteams.com/api/v2/people/{{person_id_created}} + body: json + auth: inherit +} + +body:json { + { + "firstName": "Maggie", + "lastName": "Simpson", + "status":"A", + "homeEmail":"bart@the_simpsons.com", + "createdDtm":"2023-04-21 13:08:51", + "createdUser":"27850" + } +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/People/folder.bru b/faithteams-api/app.faithteams.com-api-v2/People/folder.bru new file mode 100644 index 0000000..553269d --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/People/folder.bru @@ -0,0 +1,8 @@ +meta { + name: People + seq: 1 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Rules.bru b/faithteams-api/app.faithteams.com-api-v2/Rules.bru new file mode 100644 index 0000000..75fdafe --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Rules.bru @@ -0,0 +1,15 @@ +meta { + name: Rules + type: http + seq: 5 +} + +get { + url: https://app.faithteams.com/api/v2/rules + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Organization.bru b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Organization.bru new file mode 100644 index 0000000..1236be1 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Organization.bru @@ -0,0 +1,15 @@ +meta { + name: Organization + type: http + seq: 2 +} + +get { + url: https://app.faithteams.com/api/v2/orgs/{{organization_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Teams.bru b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Teams.bru new file mode 100644 index 0000000..6dbb4d2 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/Teams.bru @@ -0,0 +1,21 @@ +meta { + name: Teams + type: http + seq: 1 +} + +get { + url: https://app.faithteams.com/api/v2/teams + body: none + auth: inherit +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("organization_id", body.data[0].orgId); + bru.setEnvVar("team_id", body.data[0].teamId); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Team & Organization/folder.bru b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/folder.bru new file mode 100644 index 0000000..75754da --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Team & Organization/folder.bru @@ -0,0 +1,8 @@ +meta { + name: Team & Organization + seq: 3 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/app.faithteams.com-api-v2/Unsubscribes.bru b/faithteams-api/app.faithteams.com-api-v2/Unsubscribes.bru new file mode 100644 index 0000000..4f8366c --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/Unsubscribes.bru @@ -0,0 +1,19 @@ +meta { + name: Unsubscribes + type: http + seq: 7 +} + +get { + url: https://app.faithteams.com/api/v2/unsubscribes?personId={{person_id}} + body: none + auth: inherit +} + +params:query { + personId: {{person_id}} +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/User/User.bru b/faithteams-api/app.faithteams.com-api-v2/User/User.bru new file mode 100644 index 0000000..af40f42 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/User/User.bru @@ -0,0 +1,15 @@ +meta { + name: User + type: http + seq: 2 +} + +get { + url: https://app.faithteams.com/api/v2/users/{{user_id}} + body: none + auth: inherit +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/User/Users.bru b/faithteams-api/app.faithteams.com-api-v2/User/Users.bru new file mode 100644 index 0000000..38ee3d1 --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/User/Users.bru @@ -0,0 +1,24 @@ +meta { + name: Users + type: http + seq: 1 +} + +get { + url: https://app.faithteams.com/api/v2/users?noloadmask=true + body: none + auth: inherit +} + +params:query { + noloadmask: true +} + +script:post-response { + let body = res.getBody(); + bru.setEnvVar("user_id", String(body.data[0].userId)); +} + +settings { + encodeUrl: true +} diff --git a/faithteams-api/app.faithteams.com-api-v2/User/folder.bru b/faithteams-api/app.faithteams.com-api-v2/User/folder.bru new file mode 100644 index 0000000..513e5ca --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/User/folder.bru @@ -0,0 +1,8 @@ +meta { + name: User + seq: 2 +} + +auth { + mode: inherit +} diff --git a/faithteams-api/app.faithteams.com-api-v2/folder.bru b/faithteams-api/app.faithteams.com-api-v2/folder.bru new file mode 100644 index 0000000..4f5c74e --- /dev/null +++ b/faithteams-api/app.faithteams.com-api-v2/folder.bru @@ -0,0 +1,12 @@ +meta { + name: app.faithteams.com/api/v2 + seq: 2 +} + +headers { + Token: {{auth_token}} +} + +auth { + mode: inherit +} diff --git a/faithteams-api/bruno.json b/faithteams-api/bruno.json new file mode 100644 index 0000000..1b07334 --- /dev/null +++ b/faithteams-api/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "faithteams-api", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} diff --git a/faithteams-api/environments/FaithTeams.bru b/faithteams-api/environments/FaithTeams.bru new file mode 100644 index 0000000..669544e --- /dev/null +++ b/faithteams-api/environments/FaithTeams.bru @@ -0,0 +1,17 @@ +vars { + person_id: 1011272 + person_id_created: 1109570 + organization_id: 3425 + team_id: 7257 + batch_id: 204480 + batch_id_2: 204482 + fund_id: 7895 + contribution_id: 5384950 + contribution_parent_id: 5384949 + contribution_type_id: 8004 +} +vars:secret [ + auth_token, + user_id, + password +] diff --git a/lib/faithteams/version.rb b/lib/faithteams/version.rb index 9f84ac3..12ddcff 100644 --- a/lib/faithteams/version.rb +++ b/lib/faithteams/version.rb @@ -2,5 +2,5 @@ module FaithTeams # Current version number. - VERSION = "4.4.0" + VERSION = "4.6.0" end