tessitura_rest 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 +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +78 -0
- data/Rakefile +14 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/tessitura/crm/accounts.rb +8 -0
- data/lib/tessitura/crm/actions.rb +36 -0
- data/lib/tessitura/crm/addresses.rb +77 -0
- data/lib/tessitura/crm/attributes.rb +20 -0
- data/lib/tessitura/crm/constituencies.rb +30 -0
- data/lib/tessitura/crm/issues.rb +36 -0
- data/lib/tessitura/crm/web_logins.rb +8 -0
- data/lib/tessitura/custom/local_procedure.rb +13 -0
- data/lib/tessitura/security/security_user_groups.rb +8 -0
- data/lib/tessitura/version.rb +3 -0
- data/lib/tessitura/web/cart.rb +14 -0
- data/lib/tessitura/web/login.rb +8 -0
- data/lib/tessitura/web/session.rb +14 -0
- data/lib/tessitura.rb +28 -0
- data/tessitura.gemspec +30 -0
- metadata +182 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ab87325ff4533860073d1220a218556059761523
|
4
|
+
data.tar.gz: a4e3968109b574bc699f7ca264ffcc90694f10f2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 45018c3d15499f9e1ef40d92578fff6b3e0f708064f1f49b19692168e4b2d5966991fc01666781f77386e5db912c5b6038458df0db4a9c110b7e1ccb4dabc2ce
|
7
|
+
data.tar.gz: 9b5f87b3258bc200e9aa24e8430ae3f55e5ac2ae7ac5b5df291d5eb2caceb365973bd6b51c464e28dd25d9b820011fef877a770463e4f9a959969237012cae01
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at brittany.jill.martin@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 The Pittsburgh Cultural Trust
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Tessitura
|
2
|
+
|
3
|
+
A Ruby gem wrapper for the [Tessitura Network's Rest API](https://www.tessituranetwork.com/) (version 14 and up).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'tessitura'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
```
|
15
|
+
$ bundle
|
16
|
+
```
|
17
|
+
Or install it yourself as:
|
18
|
+
```
|
19
|
+
$ gem install tessitura
|
20
|
+
```
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Create a .env file in the root of your directory. The following fields are required:
|
24
|
+
|
25
|
+
* TESSITURA_URL # the url to your Production Tessitura REST instance
|
26
|
+
* USERNAME # the username to authenticate to your Tessitura REST instance
|
27
|
+
* PASSWORD # the password to authenticate to your Tessitura REST instance
|
28
|
+
|
29
|
+
To run the gem locally, use:
|
30
|
+
```
|
31
|
+
$ rake console
|
32
|
+
```
|
33
|
+
To connect to the Tessitura Rest API, use:
|
34
|
+
```
|
35
|
+
Tessitura.new
|
36
|
+
```
|
37
|
+
followed by the method and arguments you would like to use.
|
38
|
+
|
39
|
+
## Running the Test Suite
|
40
|
+
|
41
|
+
1. You will need to add valid environment variables to the gem to run the test suite.
|
42
|
+
2. Delete all of the pre-recorded cassettes tapes from spec/vcr_cassettes so they can be re-recorded with your instance's settings.
|
43
|
+
3. Create a .env file and set these values:
|
44
|
+
|
45
|
+
* TESSITURA_URL # the url to your Test/Staging Tessitura REST instance
|
46
|
+
* USERNAME # the username to authenticate to your Tessitura REST instance
|
47
|
+
* PASSWORD # the password to authenticate to your Tessitura REST instance
|
48
|
+
* WEB_CART_TEXT # the ID to the pricing rule you have setup for Cart
|
49
|
+
* ORDER_CONFIRM_TEXT # the ID to the pricing rule you have setup for Order Confirmations
|
50
|
+
* SESSION_KEY # an existing session key in your Tessitura instance
|
51
|
+
* EMAIL # an email tied to an existing web login in your Tessitura instance
|
52
|
+
* CONSTITUENT_ID # an active constituent in your Tessitura instance
|
53
|
+
* ATTRIBUTE_ID # an active Attribute in your Tessitura instance
|
54
|
+
* SCALPER_ID # any active constituent in your Tessitura instance
|
55
|
+
* CSI_ID # the id of an open customer service inquiry in your Tessitura instance
|
56
|
+
* PATRON_ID # the patron ID of a user whom submits CSIs
|
57
|
+
* ACTION_ID # the id of an action made against a customer service inquiry in your Tessitura instance
|
58
|
+
* ACTION_TYPE # a valid action type that can be attributed to an action on a customer service inquiry
|
59
|
+
|
60
|
+
To run the tests:
|
61
|
+
```
|
62
|
+
$ rake spec
|
63
|
+
```
|
64
|
+
WARNING: I advise you NOT to run the test suite against your Production Tessitura API since it will make database alterations.
|
65
|
+
|
66
|
+
## Development
|
67
|
+
|
68
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
69
|
+
|
70
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
71
|
+
|
72
|
+
## Contributing
|
73
|
+
|
74
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pgharts/tessitura. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
75
|
+
|
76
|
+
## License
|
77
|
+
|
78
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "tessitura"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
module Accounts
|
2
|
+
|
3
|
+
def get_all_accounts(constituent_id, inactive=false, include_affiliate=false, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/Accounts?constituentId=#{constituent_id}&includeInactive=#{inactive}&includeAffiliates=#{include_affiliate}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Actions
|
2
|
+
|
3
|
+
def get_action(id, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/Actions/#{id}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_actions(constituent_id, issue_id, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("CRM/Actions?constituentId=#{constituent_id}&issueId=#{issue_id}"), options)
|
12
|
+
JSON.parse(response.body)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_action(action_type, constituent_id, issue_id, notes = '', options={})
|
16
|
+
parameters =
|
17
|
+
{
|
18
|
+
'ActionType': {
|
19
|
+
'Id': action_type
|
20
|
+
},
|
21
|
+
'Issue': {
|
22
|
+
'Id': issue_id
|
23
|
+
},
|
24
|
+
'Constituent': {
|
25
|
+
'Id': constituent_id
|
26
|
+
},
|
27
|
+
'Notes': notes,
|
28
|
+
'Resolved': true,
|
29
|
+
}
|
30
|
+
options.merge!({:basic_auth => @auth})
|
31
|
+
options.merge!(:body => parameters)
|
32
|
+
response = self.class.post(base_api_endpoint('CRM/Actions'), options)
|
33
|
+
JSON.parse(response.body)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Addresses
|
2
|
+
|
3
|
+
def get_address(address_id, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/Addresses/#{address_id}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_all_addresses(constituent_id, inactive=false, include_affiliate=false, primary_only=false, include_from_affiliations=false, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("CRM/Addresses?constituentId=#{constituent_id}&
|
12
|
+
includeInactive=#{inactive}&includeAffiliates=#{include_affiliate}
|
13
|
+
&primaryOnly=#{primary_only}&includeFromAffiliations=
|
14
|
+
#{include_from_affiliations}"), options)
|
15
|
+
JSON.parse(response.body)
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_address(id, address_type, constituent_id, label, months, postal_code,
|
19
|
+
street1, state, city, street2=nil, street3=nil, delivery_point=nil, start_date=nil,
|
20
|
+
end_date=nil, alt_salutation_type={}, options={})
|
21
|
+
options.merge!({:basic_auth => @auth})
|
22
|
+
body =
|
23
|
+
{
|
24
|
+
"Id": id,
|
25
|
+
"AffiliatedConstituent": {
|
26
|
+
"Id": id
|
27
|
+
},
|
28
|
+
"AltSalutationType": {
|
29
|
+
"Description": "sample string 1",
|
30
|
+
"Id": id,
|
31
|
+
"Inactive": true
|
32
|
+
},
|
33
|
+
"AddressType": {
|
34
|
+
"Description": address_type[:description],
|
35
|
+
"Id": address_type[:id],
|
36
|
+
"Inactive": address_type[:inactive]
|
37
|
+
},
|
38
|
+
"City": city,
|
39
|
+
"Constituent": {
|
40
|
+
"Id": constituent_id
|
41
|
+
},
|
42
|
+
"DeliveryPoint": "sample string 4",
|
43
|
+
"EndDate": end_date,
|
44
|
+
"GeoArea": 1,
|
45
|
+
"Inactive": true,
|
46
|
+
"Label": label,
|
47
|
+
"Months": months,
|
48
|
+
"NcoaAction": 1,
|
49
|
+
"NcoaSession": 1,
|
50
|
+
"PostalCode": postal_code,
|
51
|
+
"PrimaryIndicator": true,
|
52
|
+
"StartDate": start_date,
|
53
|
+
"State": {
|
54
|
+
"Description": state[:description],
|
55
|
+
"StateCode": state[:state_code],
|
56
|
+
"Id": state[:id],
|
57
|
+
"Inactive": state[:inactive],
|
58
|
+
"Country": {
|
59
|
+
"Description": state[:country][:description],
|
60
|
+
"Id": state[:country][:id],
|
61
|
+
"Inactive": state[:country][:inactive]
|
62
|
+
}
|
63
|
+
},
|
64
|
+
"Street1": street1,
|
65
|
+
"Street2": street2,
|
66
|
+
"Street3": street3,
|
67
|
+
"Country": {
|
68
|
+
"Description": state[:country][:description],
|
69
|
+
"Id": state[:country][:id],
|
70
|
+
"Inactive": state[:country][:inactive]
|
71
|
+
}}
|
72
|
+
# response = self.class.post(base_api_endpoint("CRM/Addresses", options)
|
73
|
+
# JSON.parse(response.body)
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Attributes
|
2
|
+
|
3
|
+
def add_attribute(constituent_id, attribute_id, value, options={})
|
4
|
+
parameters =
|
5
|
+
{
|
6
|
+
'Keyword' => {
|
7
|
+
'Id'=> attribute_id
|
8
|
+
},
|
9
|
+
'Constituent'=> {
|
10
|
+
'Id'=> constituent_id
|
11
|
+
},
|
12
|
+
'Value'=> value,
|
13
|
+
'UpdatedDateTime'=> DateTime.now.to_s
|
14
|
+
}
|
15
|
+
options.merge!({:basic_auth => @auth})
|
16
|
+
options.merge!(:body => parameters)
|
17
|
+
response = self.class.post(base_api_endpoint('CRM/Attributes'), options)
|
18
|
+
JSON.parse(response.body)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Constituencies
|
2
|
+
|
3
|
+
def get_constituencies(id, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/Constituencies?constituentId=#{id}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_constituent_snapshot(id, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("CRM/Constituents/#{id}/Snapshot"), options)
|
12
|
+
JSON.parse(response.body)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_constituencies(constituency, id, options={})
|
16
|
+
parameters =
|
17
|
+
{
|
18
|
+
'ConstituencyType': {
|
19
|
+
'Id': constituency
|
20
|
+
},
|
21
|
+
'Constituent': {
|
22
|
+
'Id': id
|
23
|
+
}
|
24
|
+
}
|
25
|
+
options.merge!({:basic_auth => @auth})
|
26
|
+
options.merge!(:body => parameters)
|
27
|
+
response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
|
28
|
+
JSON.parse(response.body)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Issues
|
2
|
+
|
3
|
+
def get_issue(id, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/Issues/#{id}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_issues(constituent_id, start_date = Date.today, end_date = Date.today + 365, resolved = false, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("CRM/Issues?constituentId=#{constituent_id}"), options)
|
12
|
+
JSON.parse(response.body)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_issue(activity_type, constituent_id, contact_type, notes, options={})
|
16
|
+
parameters =
|
17
|
+
{
|
18
|
+
'ActivityType': {
|
19
|
+
'Id': activity_type
|
20
|
+
},
|
21
|
+
'ContactType': {
|
22
|
+
'Id': contact_type
|
23
|
+
},
|
24
|
+
'Constituent': {
|
25
|
+
'Id': constituent_id
|
26
|
+
},
|
27
|
+
'Notes': notes,
|
28
|
+
'HasReminder': false
|
29
|
+
}
|
30
|
+
options.merge!({:basic_auth => @auth})
|
31
|
+
options.merge!(:body => parameters)
|
32
|
+
response = self.class.post(base_api_endpoint('CRM/Issues'), options)
|
33
|
+
JSON.parse(response.body)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module WebLogins
|
2
|
+
|
3
|
+
def get_web_login(email, login_type, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("CRM/WebLogins/Search?emailAddress=#{email}&loginTypeId=#{login_type}"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module LocalProcedure
|
2
|
+
|
3
|
+
def execute_local_procedure(id, params = "", options={})
|
4
|
+
parameters =
|
5
|
+
{
|
6
|
+
'ProcedureId' => id.to_s,
|
7
|
+
'Parameters' => params
|
8
|
+
}
|
9
|
+
options.merge!({:basic_auth => @auth})
|
10
|
+
options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
|
11
|
+
self.class.post(base_api_endpoint('Custom/Execute'), options)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module SecurityUserGroups
|
2
|
+
|
3
|
+
def security_user_groups(login, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("Security/UserGroups/Default?userName=#{login}"), options)
|
6
|
+
JSON.parse(response.body)["UserGroup"]
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Cart
|
2
|
+
|
3
|
+
def web_cart_text(session_key, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Messages?messageTypes=#{ENV['WEB_CART_TEXT']}&savedCart=false"), options)
|
6
|
+
JSON.parse(response.body).first["Message"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def order_confirm_text(session_key, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=#{ENV['ORDER_CONFIRM_TEXT']}&savedCart=true"), options)
|
12
|
+
!response["Message"].nil? ? JSON.parse(response.body).first["Message"] : ""
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Session
|
2
|
+
|
3
|
+
def create(ip_address, business_unit_id, options={})
|
4
|
+
options.merge!({:basic_auth => @auth})
|
5
|
+
response = self.class.get(base_api_endpoint("Web/Session/"), options)
|
6
|
+
JSON.parse(response.body)
|
7
|
+
end
|
8
|
+
|
9
|
+
def shipping_methods(key, options={})
|
10
|
+
options.merge!({:basic_auth => @auth})
|
11
|
+
response = self.class.get(base_api_endpoint("Web/Session/Shippingmethods/#{key}"), options)
|
12
|
+
JSON.parse(response.body)
|
13
|
+
end
|
14
|
+
end
|
data/lib/tessitura.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'require_all'
|
2
|
+
require_rel 'tessitura'
|
3
|
+
require 'json'
|
4
|
+
require 'httparty'
|
5
|
+
|
6
|
+
class Tessitura
|
7
|
+
include HTTParty
|
8
|
+
include Session
|
9
|
+
include SecurityUserGroups
|
10
|
+
include Accounts
|
11
|
+
include Cart
|
12
|
+
include Addresses
|
13
|
+
include Attributes
|
14
|
+
include Constituencies
|
15
|
+
include WebLogins
|
16
|
+
include Issues
|
17
|
+
include Actions
|
18
|
+
include LocalProcedure
|
19
|
+
|
20
|
+
def initialize(options={})
|
21
|
+
@auth = {:username => ENV['TESSITURA_USERNAME'], :password => ENV['TESSITURA_PASSWORD']}
|
22
|
+
end
|
23
|
+
|
24
|
+
def base_api_endpoint(end_point)
|
25
|
+
"#{ENV['TESSITURA_URL']}#{end_point}"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/tessitura.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tessitura/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tessitura_rest"
|
8
|
+
spec.version = Tessitura::VERSION
|
9
|
+
spec.authors = ["Brittany Martin"]
|
10
|
+
spec.email = ["martin@trustarts.org"]
|
11
|
+
|
12
|
+
spec.summary = "Rest API Endpoint for Tessitura"
|
13
|
+
spec.description = "Tessitura is an enterprise-wide, fully integrated software system for arts & cultural organizations."
|
14
|
+
spec.homepage = "https://github.com/pgharts/tessitura"
|
15
|
+
spec.license = "MIT"
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
+
spec.add_development_dependency "pry"
|
25
|
+
spec.add_development_dependency "dotenv"
|
26
|
+
|
27
|
+
spec.add_dependency "json"
|
28
|
+
spec.add_dependency "httparty"
|
29
|
+
spec.add_dependency "require_all"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tessitura_rest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brittany Martin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dotenv
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: json
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: httparty
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: require_all
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Tessitura is an enterprise-wide, fully integrated software system for
|
126
|
+
arts & cultural organizations.
|
127
|
+
email:
|
128
|
+
- martin@trustarts.org
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".travis.yml"
|
136
|
+
- CODE_OF_CONDUCT.md
|
137
|
+
- Gemfile
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- bin/console
|
142
|
+
- bin/setup
|
143
|
+
- lib/tessitura.rb
|
144
|
+
- lib/tessitura/crm/accounts.rb
|
145
|
+
- lib/tessitura/crm/actions.rb
|
146
|
+
- lib/tessitura/crm/addresses.rb
|
147
|
+
- lib/tessitura/crm/attributes.rb
|
148
|
+
- lib/tessitura/crm/constituencies.rb
|
149
|
+
- lib/tessitura/crm/issues.rb
|
150
|
+
- lib/tessitura/crm/web_logins.rb
|
151
|
+
- lib/tessitura/custom/local_procedure.rb
|
152
|
+
- lib/tessitura/security/security_user_groups.rb
|
153
|
+
- lib/tessitura/version.rb
|
154
|
+
- lib/tessitura/web/cart.rb
|
155
|
+
- lib/tessitura/web/login.rb
|
156
|
+
- lib/tessitura/web/session.rb
|
157
|
+
- tessitura.gemspec
|
158
|
+
homepage: https://github.com/pgharts/tessitura
|
159
|
+
licenses:
|
160
|
+
- MIT
|
161
|
+
metadata: {}
|
162
|
+
post_install_message:
|
163
|
+
rdoc_options: []
|
164
|
+
require_paths:
|
165
|
+
- lib
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
requirements: []
|
177
|
+
rubyforge_project:
|
178
|
+
rubygems_version: 2.6.13
|
179
|
+
signing_key:
|
180
|
+
specification_version: 4
|
181
|
+
summary: Rest API Endpoint for Tessitura
|
182
|
+
test_files: []
|