Skip to content

Commit dd8bab7

Browse files
committed
Merge pull request #102 from teamsnap/pre-1.7.0
Release teamsnap.js v1.7.0
2 parents 027e899 + 9dc41a9 commit dd8bab7

File tree

110 files changed

+8159
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+8159
-821
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# TeamSnap JavaScript SDK CHANGELOG
2+
3+
## Jan 4, 2016
4+
5+
## Version 1.7.0
6+
7+
- This CHANGELOG. This is a broad list of recent changes - expect future updates to be more granular and with greater frequency.
8+
- Adds support for the following apiv3 types
9+
- `broadcastAlert`
10+
- `broadcastEmailAttachment`
11+
- `divisionContactEmailAddress`
12+
- `divisionContactPhoneNumber`
13+
- `divisionMemberEmailAddress`
14+
- `divisionMemberPhoneNumber`
15+
- `eventStatistic`
16+
- `statisticAggregate`
17+
- `teamMediaGroup`
18+
- `teamMedium`
19+
- `teamMediumComment`
20+
- `userFacebookPage`
21+
- Various persistence updates related to the newly added types as well as some
22+
old types.
23+
- Added new core method `file` - simliar to `exec` but with progress callback
24+
- Removed duplicate `saveTeamPreferences` method.
25+
- Updated some filenames to properly reflect their collection name.
26+
- Documentation!
27+
- Adds missing `loadSponsors` method.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ For use with node.js:
2121
npm install --save teamsnap.js
2222
```
2323

24-
Check the [Quick start guide](https://github.com/teamsnap/teamsnap-javascript-sdk/wiki/Quick-Start) in the [wiki](https://github.com/teamsnap/teamsnap-javascript-sdk/wiki) for more details.
24+
Check the [Quick start guide](https://github.com/teamsnap/teamsnap-javascript-sdk/wiki/Quick-Start) in the [wiki](https://github.com/teamsnap/teamsnap-javascript-sdk/wiki) for more details or read through the [Collections](./docs/collections.md) documentation for a complete list of SDK methods.

docs/collections.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Collections
2+
3+
An APIv3 endpoint’s name is generally derived from its `Collection+JSON` collection. Below are the available `teamsnap.js` methods by their collection.
4+
5+
---
6+
7+
## Methods By Collection
8+
- [Assignments](./collections/assignments.md)
9+
- [Availabilities](./collections/availabilities.md)
10+
- [Broadcast Alerts](./collections/broadcast_alerts.md)
11+
- [Broadcast Email Attachments](./collections/broadcast_email_attachments.md)
12+
- [Broadcast Emails](./collections/broadcast_emails.md)
13+
- [Contact Email Addresses](./collections/contact_email_addresses.md)
14+
- [Contact Phone Numbers](./collections/contact_phone_numbers.md)
15+
- [Contacts](./collections/contacts.md)
16+
- [Custom Data](./collections/custom_data.md)
17+
- [Custom Fields](./collections/custom_fields.md)
18+
- [Division Locations](./collections/division_locations.md)
19+
- [Division Members](./collections/division_members.md)
20+
- [Division Members Preferences](./collections/division_members_preferences.md)
21+
- [Division Team Standings](./collections/division_team_standings.md)
22+
- [Events](./collections/events.md)
23+
- [Event Statistics](./collections/event_statistics.md)
24+
- [Facebook Pages](./collections/facebook_pages.md)
25+
- [Forum Posts](./collections/forum_posts.md)
26+
- [Forum Subscriptions](./collections/forum_subscriptions.md)
27+
- [Forum Topics](./collections/forum_topics.md)
28+
- [League Custom Data](./collections/league_custom_data.md)
29+
- [League Custom Fields](./collections/league_custom_fields.md)
30+
- [League Registrant Documents](./league_registrant_documents/xxx.md)
31+
- [Locations](./collections/locations.md)
32+
- [Member Balances](./collections/member_balances.md)
33+
- [Member Email Addresses](./collections/member_email_addresses.md)
34+
- [Member Files](./collections/member_files.md)
35+
- [Member Links](./collections/member_links.md)
36+
- [Member Payments](./collections/member_payments.md)
37+
- [Member Phone Numbers](./collections/member_phone_numbers.md)
38+
- [Member Statistics](./collections/member_statistics.md)
39+
- [Members](./collections/members.md)
40+
- [Members Preferences](./collections/members_preferences.md)
41+
- [Opponents](./collections/opponents.md)
42+
- [Opponents Results](./collections/opponents_results.md)
43+
- [Payment Notes](./collections/payment_notes.md)
44+
- [Plans](./collections/plans.md)
45+
- [Sponsors](./collections/sponsors.md)
46+
- [Sports](./collections/sports.md)
47+
- [Statistic Aggregates](./collections/statistic_aggregates.md)
48+
- [Statistic Data](./collections/statistic_data.md)
49+
- [Statistic Groups](./collections/statistic_groups.md)
50+
- [Statistics](./collections/statistics.md)
51+
- [Team Fees](./collections/team_fees.md)
52+
- [Team Media](./collections/team_media.md)
53+
- [Team Media Groups](./collections/team_media_groups.md)
54+
- [Team Medium Comments](./collections/team_medium_comments.md)
55+
- [Team Public Sites](./collections/team_public_sites.md)
56+
- [Team Statistics](./collections/team_statistics.md)
57+
- [Teams](./collections/teams.md)
58+
- [Teams Paypal Preferences](./collections/teams_paypal_preferences.md)
59+
- [Teams Preferences](./collections/teams_preferences.md)
60+
- [Teams Results](./collections/teams_results.md)
61+
- [Tracked Item Statuses](./collections/tracked_item_statuses.md)
62+
- [Tracked Items](./collections/tracked_items.md)
63+
- [Users](./collections/users.md)

docs/collections/assignments.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Assignments
2+
3+
## Methods
4+
5+
- [loadAssignments](#loadAssignments)
6+
- [createAssignment](#createAssignment)
7+
- [saveAssignment](#saveAssignment)
8+
- [deleteAssignment](#deleteAssignment)
9+
- [getAssignmentSort](#getAssignmentSort)
10+
11+
12+
---
13+
<a id="loadAssignments"></a>
14+
## `loadAssignments(params, callback)`
15+
Loads items from the `assignments` collection based on given params.
16+
17+
### Params
18+
* `params`: [int, object] - can be either a `teamId` or an object with query parameters.
19+
* `callback`: [function] - callback to be executed when the operation completes.
20+
21+
To see a list of all available search params you can run:
22+
`teamsnap.collections.assignments.queries.search.params`
23+
24+
### Examples
25+
```javascript
26+
// ~~~~~
27+
// Loads all `assignments` for `teamId: 1`.
28+
teamsnap.loadAssignments(1);
29+
30+
// ~~~~~
31+
// Loads all `assignments` for `memberId: 1`.
32+
teamsnap.loadAssignments({memberId: 1});
33+
```
34+
35+
36+
---
37+
38+
39+
<a id="createAssignment"></a>
40+
## `createAssignment(data)`
41+
Creates a new `assignment` item.
42+
43+
### Params
44+
* `data`: [object, null] - data object to apply to the newly created object.
45+
46+
### Examples
47+
```javascript
48+
// ~~~~~
49+
// Creates a new `assignment` item.
50+
var assignment = teamsnap.createAssignment();
51+
52+
// ~~~~~
53+
// Creates a new `assignment` item with `memberId: 1` and `eventId: 1`.
54+
var assignment = teamsnap.createAssignment({memberId: 1, eventId: 1});
55+
```
56+
57+
58+
---
59+
60+
61+
<a id="saveAssignment"></a>
62+
## `saveAssignment(assignment, callback)`
63+
Saves an `assignment` item.
64+
65+
### Params
66+
* `assignment`: [object] - assignment item to be saved.
67+
* `callback`: [function] - callback to be executed when the operation completes.
68+
69+
### Examples
70+
```javascript
71+
// ~~~~~
72+
// Saves `assignment` item.
73+
teamsnap.saveAssignment(assignment);
74+
75+
// ~~~~~
76+
// Creates a new `assignment` then saves it.
77+
var assignment = teamsnap.createAssignment({
78+
teamId: 1,
79+
memberId: 1,
80+
eventId: 1,
81+
description: 'Example Assignment'
82+
});
83+
84+
teamsnap.saveAssignment(assignment);
85+
```
86+
87+
88+
---
89+
90+
91+
<a id="deleteAssignment"></a>
92+
## `deleteAssignment(assignment, callback)`
93+
Deletes an `assignment` item.
94+
95+
### Params
96+
* `assignment`: [object] - an item to be deleted.
97+
* `callback`: [function] - callback to be executed when the operation completes.
98+
99+
### Examples
100+
```javascript
101+
// ~~~~~
102+
// Deletes an `assignment` item.
103+
teamsnap.deleteAssignment(assignment);
104+
105+
// ~~~~~
106+
// Creates a new `assignment` item, saves, then deletes it.
107+
var assignment = teamsnap.createAssignment({
108+
teamId: 1,
109+
memberId: 1,
110+
eventId: 1,
111+
description: 'Example Assignment'
112+
});
113+
114+
teamsnap.saveAssignment(assignment).then(function(){
115+
// Save complete, now delete.
116+
teamsnap.deleteAssignment(assignment).then(function(){
117+
// Poof! It's gone!
118+
});
119+
});
120+
```
121+
122+
123+
---
124+
125+
126+
<a id="getAssignmentSort"></a>
127+
## `getAssignmentSort(reverse)`
128+
Sorts an array of assignments by member.
129+
130+
### Params
131+
* `reverse`: [bool, null] - reverses the sort order.
132+
133+
### Examples
134+
```javascript
135+
// ~~~~~
136+
// Sorts assignments by member alphabetically
137+
assignmentArray.sort(teamsnap.getAssignmentSort());
138+
```

docs/collections/availabilities.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Availabilities
2+
3+
## Methods
4+
5+
- [loadAvailabilities](#loadAvailabilities)
6+
- [saveAvailability](#saveAvailability)
7+
- [bulkMarkUnsetAvailabilities](#bulkMarkUnsetAvailabilities)
8+
9+
10+
---
11+
<a id="loadAvailabilities"></a>
12+
## `loadAvailabilities(params, callback)`
13+
Loads items from the `availabilities` collection based on given params.
14+
15+
### Params
16+
* `params`: [int, object] - can be either a `teamId` or an object with query parameters.
17+
* `callback`: [function] - callback to be executed when the operation completes.
18+
19+
To see a list of all available search params you can run:
20+
`teamsnap.collections.availabilities.queries.search.params`
21+
22+
### Examples
23+
```javascript
24+
// ~~~~~
25+
// Loads all availabilities for `teamId: 1`.
26+
teamsnap.loadAvailabilities(1);
27+
28+
// ~~~~~
29+
// Loads all availabilities for `memberId: 1`.
30+
teamsnap.loadAvailabilities({memberId: 1});
31+
```
32+
33+
34+
---
35+
36+
37+
<a id="saveAvailability"></a>
38+
## `saveAvailability(availability, callback)`
39+
Saves an `availability` item.
40+
41+
### Params
42+
* `availability`: [object] - broadcastAlert item to be saved.
43+
* `callback`: [function] - callback to be executed when the operation completes.
44+
45+
### Examples
46+
```javascript
47+
// ~~~~~
48+
// Saves broadcastAlert item.
49+
teamsnap.saveAvailability(availability);
50+
```
51+
52+
53+
---
54+
55+
56+
<a id="bulkMarkUnsetAvailabilities"></a>
57+
## `bulkMarkUnsetAvailabilities(memberId, statusCode, callback)`
58+
Sets all previously unset availability statuses to `statusCode`.
59+
Status codes can be found in `teamsnap.AVAILABILITIES`
60+
61+
### Params
62+
* `memberId`: [int] - id of a member you can manage.
63+
* `statusCode`: [int] - status code from `teamsnap.AVAILABILITIES`
64+
* `callback`: [function] - callback to be executed when the operation completes.
65+
66+
### Examples
67+
```javascript
68+
// ~~~~~
69+
// Bulk marks unset availabilities to `YES` for `memberId: 1`.
70+
teamsnap.bulkMarkUnsetAvailabilities(1,1);
71+
```

0 commit comments

Comments
 (0)