@@ -465,6 +465,71 @@ exports.bulkMarkUnsetAvailabilities = function(memberId, statusCode, callback) {
465465
466466} ) ;
467467
468+ require . register ( "collections/broadcastEmails" , function ( exports , require , module ) {
469+ exports . loadBroadcastEmails = function ( params , callback ) {
470+ if ( this . isId ( params ) ) {
471+ params = {
472+ id : params
473+ } ;
474+ } else if ( ! ( params && typeof params === 'object' ) ) {
475+ throw new TSArgsError ( 'teamsnap.loadBroadcastEmails' , 'must provide an id or query parameters' ) ;
476+ }
477+ return this . loadItems ( 'broadcastEmail' , params , callback ) ;
478+ } ;
479+
480+ exports . createBroadcastEmail = function ( data ) {
481+ return this . createItem ( data , {
482+ type : 'broadcastEmail'
483+ } ) ;
484+ } ;
485+
486+ exports . saveBroadcastEmail = function ( broadcastEmail , callback ) {
487+ var _ref ;
488+ if ( ! broadcastEmail ) {
489+ throw new TSArgsError ( 'teamsnap.saveBroadcastEmail' , "`broadcastEmail` must be provided" ) ;
490+ }
491+ if ( ! this . isItem ( broadcastEmail , 'broadcastEmail' ) ) {
492+ throw new TSArgsError ( 'teamsnap.saveBroadcastEmail' , "`type` must be 'broadcastEmail'" ) ;
493+ }
494+ if ( ! broadcastEmail . teamId ) {
495+ return this . reject ( 'You must provide a team id.' , 'teamId' , callback ) ;
496+ }
497+ if ( ! broadcastEmail . memberId ) {
498+ return this . reject ( 'You must provide a member id.' , 'memberId' , callback ) ;
499+ }
500+ if ( ! ( ( _ref = broadcastEmail . body ) != null ? _ref . trim ( ) : void 0 ) ) {
501+ return this . reject ( 'You must provide the text alert body.' , 'body' , callback ) ;
502+ }
503+ return this . saveItem ( broadcastEmail , callback ) ;
504+ } ;
505+
506+ exports . deleteBroadcastEmail = function ( broadcastEmail , callback ) {
507+ if ( ! broadcastEmail ) {
508+ throw new TSArgsError ( 'teamsnap.deleteBroadcastEmail' , '`broadcastEmail` must be provided' ) ;
509+ }
510+ return this . deleteItem ( broadcastEmail , callback ) ;
511+ } ;
512+
513+ exports . uploadAttachment = function ( broadcastEmailId , file , callback ) {
514+ var params ;
515+ if ( typeof FormData === 'undefined' ) {
516+ this . reject ( 'Your browser does not support the new file upload APIs.' , 'file' , callback ) ;
517+ }
518+ if ( ! file ) {
519+ throw new TSArgsError ( 'teamsnap.uploadAttachment' , 'file is required' ) ;
520+ }
521+ if ( ! broadcastEmailId ) {
522+ throw new TSArgsError ( 'teamsnap.uploadAttachment' , 'broadcastEmailId is required' ) ;
523+ }
524+ params = {
525+ broadcastEmailId : broadcastEmailId ,
526+ file : file
527+ } ;
528+ return this . collections . broadcastEmails . exec ( 'uploadAttachment' , params ) ;
529+ } ;
530+
531+ } ) ;
532+
468533require . register ( "collections/broadcastSms" , function ( exports , require , module ) {
469534exports . loadBroadcastSmses = function ( params , callback ) {
470535 if ( this . isId ( params ) ) {
@@ -4401,6 +4466,8 @@ add(require('./collections/assignments'));
44014466
44024467add ( require ( './collections/availabilities' ) ) ;
44034468
4469+ add ( require ( './collections/broadcastEmails' ) ) ;
4470+
44044471add ( require ( './collections/broadcastSms' ) ) ;
44054472
44064473add ( require ( './collections/contactEmailAddresses' ) ) ;
@@ -4509,7 +4576,7 @@ _ref = require('./model'), Collection = _ref.Collection, Item = _ref.Item;
45094576require ( './errors' ) ;
45104577
45114578TeamSnap = ( function ( ) {
4512- TeamSnap . prototype . version = '1.2.1 ' ;
4579+ TeamSnap . prototype . version = '1.3.0 ' ;
45134580
45144581 TeamSnap . prototype . promises = promises ;
45154582
@@ -4549,7 +4616,7 @@ var plural, pluralLookup, singularLookup, teamTypes, teamsnap, type, typeLookup,
45494616
45504617teamsnap = exports ;
45514618
4552- types = [ 'user' , 'assignment' , 'availability' , 'broadcastSms' , 'contact' , 'contactEmailAddress' , 'contactPhoneNumber' , 'customDatum' , 'customField' , 'leagueCustomDatum' , 'leagueCustomField' , 'divisionLocation' , 'divisionMember' , 'divisionMemberPreferences' , 'event' , 'forumPost' , 'forumSubscription' , 'forumTopic' , 'leagueRegistrantDocument' , 'location' , 'member' , 'memberEmailAddress' , 'memberFile' , 'memberLink' , 'memberPayment' , 'memberPhoneNumber' , 'memberPreferences' , 'opponent' , 'opponentResults' , 'paymentNote' , 'plan' , 'smsGateway' , 'sponsor' , 'sport' , 'team' , 'teamFee' , 'teamPaypalPreferences' , 'teamPreferences' , 'teamPublicSite' , 'teamResults' , 'timeZone' , 'trackedItem' , 'trackedItemStatus' ] ;
4619+ types = [ 'user' , 'assignment' , 'availability' , 'broadcastEmail' , ' broadcastSms', 'contact' , 'contactEmailAddress' , 'contactPhoneNumber' , 'customDatum' , 'customField' , 'leagueCustomDatum' , 'leagueCustomField' , 'divisionLocation' , 'divisionMember' , 'divisionMemberPreferences' , 'event' , 'forumPost' , 'forumSubscription' , 'forumTopic' , 'leagueRegistrantDocument' , 'location' , 'member' , 'memberEmailAddress' , 'memberFile' , 'memberLink' , 'memberPayment' , 'memberPhoneNumber' , 'memberPreferences' , 'opponent' , 'opponentResults' , 'paymentNote' , 'plan' , 'smsGateway' , 'sponsor' , 'sport' , 'team' , 'teamFee' , 'teamPaypalPreferences' , 'teamPreferences' , 'teamPublicSite' , 'teamResults' , 'timeZone' , 'trackedItem' , 'trackedItemStatus' ] ;
45534620
45544621teamTypes = types . slice ( ) ;
45554622
0 commit comments