extra-life-ts
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -35,4 +35,6 @@ interface Result<T> { | ||
fundraisingGoal: number; | ||
hasActivityTracking: boolean; | ||
isCustomAvatarImage: boolean; | ||
isTeamCaptain: boolean; | ||
isTeamCaptain?: boolean; | ||
isTeamCoCaptain?: boolean; | ||
links: { | ||
@@ -47,2 +49,10 @@ donate: string; | ||
participantID: number; | ||
/** | ||
* So far the strings I've found here are: | ||
* A = CoCaptain | ||
* C = Captain | ||
* I = Individual | ||
* T = Team | ||
*/ | ||
role: string; | ||
streamingChannel?: string; | ||
@@ -54,4 +64,8 @@ streamingPlatform?: string; | ||
sumPledges: number; | ||
teamID?: number; | ||
teamName?: string; | ||
} | ||
interface TeamParticipant extends Participant { | ||
isTeamCaptain: boolean; | ||
isTeamCoCaptain: boolean; | ||
teamID: number; | ||
@@ -152,16 +166,16 @@ teamName: string; | ||
declare const getParticipant: (participantID: string | number) => Promise<Result<Participant>>; | ||
declare const getParticipantActivity: (participantID: string | number, opts?: GetActivityOptions | undefined) => Promise<Result<Activity[]>>; | ||
declare const getParticipantBadges: (participantID: string | number, opts?: GetBadgesOptions | undefined) => Promise<Result<Badge[]>>; | ||
declare const getParticipantDonations: (participantID: string | number, opts?: GetDonationsOptions | undefined) => Promise<Result<Donation[]>>; | ||
declare const getParticipantDonors: (participantID: string | number, opts?: GetDonorsOptions | undefined) => Promise<Result<Donor[]>>; | ||
declare const getParticipantIncentives: (participantID: string | number, opts?: GetIncentivesOptions | undefined) => Promise<Result<Incentive[]>>; | ||
declare const getParticipantMilestones: (participantID: string | number, opts?: GetMilestonesOptions | undefined) => Promise<Result<Milestone[]>>; | ||
declare const getParticipantActivity: (participantID: string | number, opts?: GetActivityOptions) => Promise<Result<Activity[]>>; | ||
declare const getParticipantBadges: (participantID: string | number, opts?: GetBadgesOptions) => Promise<Result<Badge[]>>; | ||
declare const getParticipantDonations: (participantID: string | number, opts?: GetDonationsOptions) => Promise<Result<Donation[]>>; | ||
declare const getParticipantDonors: (participantID: string | number, opts?: GetDonorsOptions) => Promise<Result<Donor[]>>; | ||
declare const getParticipantIncentives: (participantID: string | number, opts?: GetIncentivesOptions) => Promise<Result<Incentive[]>>; | ||
declare const getParticipantMilestones: (participantID: string | number, opts?: GetMilestonesOptions) => Promise<Result<Milestone[]>>; | ||
declare const getTeam: (teamID: string | number) => Promise<Result<Team>>; | ||
declare const getTeamParticipants: (teamId: string | number, opts?: GetTeamParticipantsOptions | undefined) => Promise<Result<TeamParticipant[]>>; | ||
declare const getTeamActivity: (teamID: string | number, opts?: GetActivityOptions | undefined) => Promise<Result<Activity[]>>; | ||
declare const getTeamBadges: (teamID: string | number, opts?: GetBadgesOptions | undefined) => Promise<Result<Badge[]>>; | ||
declare const getTeamDonations: (teamID: string | number, opts?: GetDonationsOptions | undefined) => Promise<Result<Donation[]>>; | ||
declare const getTeamDonors: (teamID: string | number, opts?: GetDonorsOptions | undefined) => Promise<Result<Donor[]>>; | ||
declare const getTeamParticipants: (teamId: string | number, opts?: GetTeamParticipantsOptions) => Promise<Result<TeamParticipant[]>>; | ||
declare const getTeamActivity: (teamID: string | number, opts?: GetActivityOptions) => Promise<Result<Activity[]>>; | ||
declare const getTeamBadges: (teamID: string | number, opts?: GetBadgesOptions) => Promise<Result<Badge[]>>; | ||
declare const getTeamDonations: (teamID: string | number, opts?: GetDonationsOptions) => Promise<Result<Donation[]>>; | ||
declare const getTeamDonors: (teamID: string | number, opts?: GetDonorsOptions) => Promise<Result<Donor[]>>; | ||
export { Activity, ActivityType, AllOptions, Badge, Donation, Donor, GetActivityOptions, GetBadgesOptions, GetDonationsOptions, GetDonorsOptions, GetIncentivesOptions, GetMilestonesOptions, GetTeamParticipantsOptions, Incentive, Milestone, Options, Participant, ResourceTypes, Result, Team, TeamParticipant, WhereArguments, getParticipant, getParticipantActivity, getParticipantBadges, getParticipantDonations, getParticipantDonors, getParticipantIncentives, getParticipantMilestones, getTeam, getTeamActivity, getTeamBadges, getTeamDonations, getTeamDonors, getTeamParticipants }; |
@@ -1,2 +0,2 @@ | ||
var O=Object.create;var o=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var g=(t,e,i)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,d=(t,e)=>{for(var i in e||(e={}))u.call(e,i)&&g(t,i,e[i]);if(c)for(var i of c(e))G.call(e,i)&&g(t,i,e[i]);return t};var y=t=>o(t,"__esModule",{value:!0});var T=(t,e)=>{for(var i in e)o(t,i,{get:e[i],enumerable:!0})},l=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of x(e))!u.call(t,s)&&(i||s!=="default")&&o(t,s,{get:()=>e[s],enumerable:!(n=v(e,s))||n.enumerable});return t},I=(t,e)=>l(y(o(t!=null?O(f(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),A=(t=>(e,i)=>t&&t.get(e)||(i=l(y({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var F={};T(F,{getParticipant:()=>w,getParticipantActivity:()=>R,getParticipantBadges:()=>U,getParticipantDonations:()=>B,getParticipantDonors:()=>h,getParticipantIncentives:()=>C,getParticipantMilestones:()=>k,getTeam:()=>L,getTeamActivity:()=>E,getTeamBadges:()=>M,getTeamDonations:()=>$,getTeamDonors:()=>q,getTeamParticipants:()=>N});var b=I(require("cross-fetch"));function r(t){return new Promise(async(e,i)=>{(0,b.default)(t).then(async n=>{n.status>=400&&i(new Error(`Request failed: ${n.status} - ${n.statusText}`));try{let s=n.headers.get("num-records"),m=await n.json();e(d({data:m},s?{totalRecords:parseInt(s)}:{}))}catch{}})})}var D=require("qss"),P="https://www.extra-life.org/api",a=({type:t,id:e,resource:i,opts:n})=>{let s=`${P}/${t}/${e}`;return i&&(s+=`/${i}`),Object.keys(n!=null?n:{}).length&&(s+=(0,D.encode)({limit:(n==null?void 0:n.limit)?n.limit:100,page:n==null?void 0:n.page,orderBy:n==null?void 0:n.orderBy,where:(n==null?void 0:n.where)&&`${n.where.fieldName} ${n.where.operator} ${n.where.term}`},"?")),s};var w=async t=>await r(a({type:"participants",id:t})),R=async(t,e)=>await r(a({type:"participants",id:t,resource:"activity",opts:e})),U=async(t,e)=>await r(a({type:"participants",id:t,resource:"badges",opts:e})),B=async(t,e)=>await r(a({type:"participants",id:t,resource:"donations",opts:e})),h=async(t,e)=>await r(a({type:"participants",id:t,resource:"donors",opts:e})),C=async(t,e)=>await r(a({type:"participants",id:t,resource:"incentives",opts:e})),k=async(t,e)=>await r(a({type:"participants",id:t,resource:"milestones",opts:e}));var L=async t=>await r(a({id:t,type:"teams"})),N=async(t,e)=>await r(a({id:t,type:"teams",resource:"participants",opts:e})),E=async(t,e)=>await r(a({id:t,type:"teams",resource:"activity",opts:e})),M=async(t,e)=>await r(a({id:t,type:"teams",resource:"badges",opts:e})),$=async(t,e)=>await r(a({id:t,type:"teams",resource:"donations",opts:e})),q=async(t,e)=>await r(a({id:t,type:"teams",resource:"donors",opts:e}));module.exports=A(F);0&&(module.exports={getParticipant,getParticipantActivity,getParticipantBadges,getParticipantDonations,getParticipantDonors,getParticipantIncentives,getParticipantMilestones,getTeam,getTeamActivity,getTeamBadges,getTeamDonations,getTeamDonors,getTeamParticipants}); | ||
"use strict";var d=Object.create;var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var O=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of y(e))!D.call(t,s)&&s!==r&&p(t,s,{get:()=>e[s],enumerable:!(n=l(e,s))||n.enumerable});return t};var v=(t,e,r)=>(r=t!=null?d(b(t)):{},c(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>c(p({},"__esModule",{value:!0}),t);var N={};O(N,{getParticipant:()=>f,getParticipantActivity:()=>G,getParticipantBadges:()=>I,getParticipantDonations:()=>A,getParticipantDonors:()=>P,getParticipantIncentives:()=>w,getParticipantMilestones:()=>C,getTeam:()=>R,getTeamActivity:()=>B,getTeamBadges:()=>h,getTeamDonations:()=>k,getTeamDonors:()=>L,getTeamParticipants:()=>U});module.exports=T(N);var g=v(require("cross-fetch"));function i(t){return new Promise(async(e,r)=>{(0,g.default)(t).then(async n=>{n.status>=400&&r(new Error(`Request failed: ${n.status} - ${n.statusText}`));try{let s=n.headers.get("num-records"),m=await n.json();e({data:m,...s?{totalRecords:parseInt(s)}:{}})}catch{}})})}var u=require("qss"),x="https://www.extra-life.org/api",a=({type:t,id:e,resource:r,opts:n})=>{let s=`${x}/${t}/${e}`;return r&&(s+=`/${r}`),Object.keys(n!=null?n:{}).length&&(s+=(0,u.encode)({limit:n!=null&&n.limit?n.limit:100,page:n==null?void 0:n.page,orderBy:n==null?void 0:n.orderBy,where:(n==null?void 0:n.where)&&`${n.where.fieldName} ${n.where.operator} ${n.where.term}`},"?")),s};var f=async t=>await i(a({type:"participants",id:t})),G=async(t,e)=>await i(a({type:"participants",id:t,resource:"activity",opts:e})),I=async(t,e)=>await i(a({type:"participants",id:t,resource:"badges",opts:e})),A=async(t,e)=>await i(a({type:"participants",id:t,resource:"donations",opts:e})),P=async(t,e)=>await i(a({type:"participants",id:t,resource:"donors",opts:e})),w=async(t,e)=>await i(a({type:"participants",id:t,resource:"incentives",opts:e})),C=async(t,e)=>await i(a({type:"participants",id:t,resource:"milestones",opts:e}));var R=async t=>await i(a({id:t,type:"teams"})),U=async(t,e)=>await i(a({id:t,type:"teams",resource:"participants",opts:e})),B=async(t,e)=>await i(a({id:t,type:"teams",resource:"activity",opts:e})),h=async(t,e)=>await i(a({id:t,type:"teams",resource:"badges",opts:e})),k=async(t,e)=>await i(a({id:t,type:"teams",resource:"donations",opts:e})),L=async(t,e)=>await i(a({id:t,type:"teams",resource:"donors",opts:e}));0&&(module.exports={getParticipant,getParticipantActivity,getParticipantBadges,getParticipantDonations,getParticipantDonors,getParticipantIncentives,getParticipantMilestones,getTeam,getTeamActivity,getTeamBadges,getTeamDonations,getTeamDonors,getTeamParticipants}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "extra-life-ts", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "A typed wrapped for the Extra Life API", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
22640
187