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..c408df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ 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.5.0] + +### Added + +1. Add Bruno API Client (to eventually replace ThunderClient). (IN-2728) + ## [4.4.0] ### Changed diff --git a/Gemfile.lock b/Gemfile.lock index 0e064c9..1071155 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - faithteams-api (4.4.0) + faithteams-api (4.5.0) activesupport (~> 7.2.2) http (~> 5.1) logger (~> 1.6.1) 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/.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..b58e227 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.5.0" end