From 1c36cdb7d50f34a0a824b29f47588dadfc39d659 Mon Sep 17 00:00:00 2001 From: Chewbaccalakis Date: Sat, 21 Dec 2024 08:18:26 +0000 Subject: [PATCH] partial implementation of v3 api --- .gitignore | 9 +- README.md | 6 + docs/assets/hierarchy.js | 2 +- docs/assets/navigation.js | 2 +- docs/assets/search.js | 2 +- docs/classes/default.html | 37 +- docs/enums/CustomFieldType.html | 4 +- docs/index.html | 4 +- docs/interfaces/AddressInfo.html | 6 + docs/interfaces/Animal.html | 17 + docs/interfaces/CustomField.html | 4 +- docs/interfaces/CustomFieldUpdate.html | 4 +- docs/interfaces/CustomMemberStatus.html | 3 + docs/interfaces/EmailInfo.html | 3 + docs/interfaces/EmergencyContact.html | 5 - docs/interfaces/EmergencyContacts.html | 3 - docs/interfaces/EquipmentLocation.html | 3 + docs/interfaces/GetAnimalsOptions.html | 9 + docs/interfaces/GetGroupsOptions.html | 4 +- docs/interfaces/GetIncidentOptions.html | 16 + docs/interfaces/GetMemberAwardsOptions.html | 9 + docs/interfaces/GetMemberGroupsOptions.html | 8 + docs/interfaces/GetMemberOptions.html | 4 +- docs/interfaces/GetMembersOptions.html | 14 +- docs/interfaces/GetQualificationOptions.html | 8 + docs/interfaces/Group.html | 4 - docs/interfaces/Incident.html | 44 ++- docs/interfaces/IncidentLocation.html | 3 + docs/interfaces/IncidentLocationBookmark.html | 3 + docs/interfaces/IncidentOwner.html | 3 + docs/interfaces/IncidentRoster.html | 4 +- docs/interfaces/IncidentTag.html | 3 + docs/interfaces/Location.html | 3 + docs/interfaces/Member.html | 65 +++- docs/interfaces/MemberAwards.html | 12 + docs/interfaces/MemberLocationBookmark.html | 3 + docs/interfaces/MemberStatus.html | 4 +- docs/interfaces/MemberStatusLabel.html | 4 +- docs/interfaces/MemberUpdate.html | 9 +- docs/interfaces/PhoneInfo.html | 3 + docs/interfaces/PrimaryEmergencyContact.html | 5 + docs/interfaces/Qualification.html | 14 + docs/interfaces/Resource.html | 3 + docs/interfaces/RetiredReason.html | 3 + docs/interfaces/Role.html | 3 + .../interfaces/SecondaryEmergencyContact.html | 5 + docs/interfaces/WeatherInfo.html | 4 + docs/interfaces/memberGroup.html | 10 + docs/modules.html | 2 +- docs/variables/D4H_BASE_URL.html | 1 + lib/index.ts | 13 +- lib/src/api/animalsApi.ts | 71 ++++ lib/src/api/groupsApi.ts | 74 ++++ lib/src/api/membersApi.ts | 97 +++++ lib/src/api/qualificationsApi.ts | 213 +++++++++++ lib/src/d4h.ts | 331 ++++++++++++++---- lib/src/d4hRequest.ts | 54 +-- lib/src/entity.ts | 9 +- lib/src/group.ts | 5 - lib/src/member.ts | 62 ---- lib/src/types/animal.ts | 18 + lib/src/{ => types}/customField.ts | 0 lib/src/{ => types}/emergencyContacts.ts | 0 lib/src/{ => types}/events.ts | 11 - lib/src/types/group.ts | 11 + lib/src/types/incident.ts | 72 ++++ lib/src/types/member.ts | 156 +++++++++ lib/src/types/qualification.ts | 32 ++ test/index.ts | 12 +- 69 files changed, 1387 insertions(+), 257 deletions(-) create mode 100644 docs/interfaces/AddressInfo.html create mode 100644 docs/interfaces/Animal.html create mode 100644 docs/interfaces/CustomMemberStatus.html create mode 100644 docs/interfaces/EmailInfo.html delete mode 100644 docs/interfaces/EmergencyContact.html delete mode 100644 docs/interfaces/EmergencyContacts.html create mode 100644 docs/interfaces/EquipmentLocation.html create mode 100644 docs/interfaces/GetAnimalsOptions.html create mode 100644 docs/interfaces/GetIncidentOptions.html create mode 100644 docs/interfaces/GetMemberAwardsOptions.html create mode 100644 docs/interfaces/GetMemberGroupsOptions.html create mode 100644 docs/interfaces/GetQualificationOptions.html delete mode 100644 docs/interfaces/Group.html create mode 100644 docs/interfaces/IncidentLocation.html create mode 100644 docs/interfaces/IncidentLocationBookmark.html create mode 100644 docs/interfaces/IncidentOwner.html create mode 100644 docs/interfaces/IncidentTag.html create mode 100644 docs/interfaces/Location.html create mode 100644 docs/interfaces/MemberAwards.html create mode 100644 docs/interfaces/MemberLocationBookmark.html create mode 100644 docs/interfaces/PhoneInfo.html create mode 100644 docs/interfaces/PrimaryEmergencyContact.html create mode 100644 docs/interfaces/Qualification.html create mode 100644 docs/interfaces/Resource.html create mode 100644 docs/interfaces/RetiredReason.html create mode 100644 docs/interfaces/Role.html create mode 100644 docs/interfaces/SecondaryEmergencyContact.html create mode 100644 docs/interfaces/WeatherInfo.html create mode 100644 docs/interfaces/memberGroup.html create mode 100644 docs/variables/D4H_BASE_URL.html create mode 100644 lib/src/api/animalsApi.ts create mode 100644 lib/src/api/groupsApi.ts create mode 100644 lib/src/api/membersApi.ts create mode 100644 lib/src/api/qualificationsApi.ts delete mode 100644 lib/src/group.ts delete mode 100644 lib/src/member.ts create mode 100644 lib/src/types/animal.ts rename lib/src/{ => types}/customField.ts (100%) rename lib/src/{ => types}/emergencyContacts.ts (100%) rename lib/src/{ => types}/events.ts (51%) create mode 100644 lib/src/types/group.ts create mode 100644 lib/src/types/incident.ts create mode 100644 lib/src/types/member.ts create mode 100644 lib/src/types/qualification.ts diff --git a/.gitignore b/.gitignore index 0d91023..6637873 100644 --- a/.gitignore +++ b/.gitignore @@ -85,4 +85,11 @@ tests/cases/user/axios-src/axios-src tests/cases/user/prettier/prettier .eslintcache *v8.log -**/*.env \ No newline at end of file +**/*.env + + +getmember.json +getMembers.ts +members.json +getMember.ts +getIncident.ts \ No newline at end of file diff --git a/README.md b/README.md index 4098451..7730e40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # d4h-typescript Typescript library for accessing D4H +## Documentation + +Typedoc Generated Documentation available at: + +```https://chewbaccalakis.github.io/d4h-typescript/modules.html``` + ## How to Consume This library is not in NPM. As a result, you need to add it to your project locally. To do so, you have three options: 1. Add the repository to the consuming repository as a Git submodule. diff --git a/docs/assets/hierarchy.js b/docs/assets/hierarchy.js index fb85f0a..88636f0 100644 --- a/docs/assets/hierarchy.js +++ b/docs/assets/hierarchy.js @@ -1 +1 @@ -window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg==" \ No newline at end of file +window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzwMKVNfWAgCbHgqm" \ No newline at end of file diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 0d67dec..1f7aee5 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "eJyV019LwzAUBfDvcp+LYwNF+jp0CMpguifxIUvuXDD/SG7AMfzuY1ZdU0PSPZ9zfk1a+noAwk+CFuYxkNX3EpV42TuEBhyjHbSAJuowGcRXO9IKGviQRkB7+9X8OQK3LCo677liIWCY/ATpcjrrb3sPOe+lIfRbxjE5RMrMrm/yzNoJRljDulaJvNPo39Hw/dwaYpyy4rB0CRhGiaFELpAW3kYXlo6kNXlxWKqAT6g36CtgUhoF1o6Ytork6TJ55pSUpg+GS4Em/y1/wzHAygZCX2S6SgnrrpxFuqg+fiZGMf9O+4Wx0CPboKpq3606WfgR+4X/0NsRsoKY5w==" \ No newline at end of file +window.navigationData = "eJyV1l1P2zAUBuD/kms0tA4Q4q5A+ZCK2FrQLtCETuNTatUfme0A1cR/n4fX1inOsbl+Xz9xbKfuw5/K4aurTqqz1jotLzgKdrdqsNqrGnALH6Bqpd3fib8snBS+s+SKVSfHb3sbh+EcWuG242sB1qLd/x90R34dxGOHjBm09lrN9XY8Vw7NHGpPRHmXGRwexYziEkRaeI+owdGLJoUoL2TuGwYOc1ho5ckblDM0UweutYQZ1yh0JIGL3gXfpCTxu+WNROXGugbHtUpTuy2KvEQXdsreNv+66Tf90MqQl0a3TU7slDLgtao586+UIXdqGTTs3PAFDMvNNVEtwosWIlEtwovYz4BlEy2c448WBJ/zcAQzcKpL8et9TnrrsAQgP6Td0mfAU62XEsyyCF6XSx5w+6LQkOp7o4SaaOsyVqiUYHfwREo+pxhyI0o2IJzN5PAQ5QeHz5sgQoGC5PZTTjpRnp9P0VlKV/M4ca+V3mhxbwwzTP8R+NDKk8Q9Hhco6PtCK+y9bTcpSRh/45nVSKJ5QlWvzrRyUKd/c3q6FN/5zUuinQZFTdDq1tTpFVuHNOC4QTZBsD1z6TRISoueefiAGjjFWitWuuC9beoRP9E7aHqPRZRTzPnB1ePpcDp6vJ+Mt84zGA4z4Zk47zrfBm+//gKy3ChR" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 40b2e3d..90aecf7 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "eJytnVmP4zYSx7+L+tXpSCRFUf22SHaDAHsAe70YA8Nja3q0Y1sNS54kGMx3X1CHVaUqyiW7nzqxyPrz+FWRLB3zLTpXv9XRy/pb9KU87aMXt4pO22MRvUQ/XeqmOv6lLA77f//xVkSr6HI+RC9Rcboc6x8nV58/N8dDtIp2h21dF3X0EkXfV4PNxF6N/v1y/FicBbaeTkNJYHIVvW3PxalhWseq/bv4vZFoNV25B5R+3jaSEXrad+WWKqnUcvNyVSxPTXH+tN0VSHZ+UmJlrjZLkamnttjNtodEGkjRnExf8G6hw/ZjcRApDSXvlvq6PVyKTd2cy9OrSHFS4TFhueIjUh8vp/1BpnUterfYsfBuvyn2ZbOpfjuJVGmdJfIB3/rP2x76NK/fFXpHPwMGhd7Wt/MBTKCmGBYiC4fxl6L5Wzsn/3hryupUcw2YllkwiKfd4bIvfi6abXmQ237q6+2v9fhOksbf6GMt6WS9uJev5+ry9ivLC2/1qa0xAw1t8fwAg9le0LlhmHdt7U9D7fdpkmTO2daIJ51pyGTWf/HDfGPSURn5nHeBLDjp1Gof+uYnHTc4tDiXDR/jed2h+GJROJh/Phbn1+K0++On6tRsdw0nPy0jH8z2j9TiU1+a7w9paEDyXBy2vsNyWVDjMem3z9VpQXeH4o+Jbg/NZqEwrLJYfA4e1hVJITk+b+fyuD3/Ibf6NNaQdSzoi3Wxq077ZeKwznJ5FOK857KRwF+QD2B42zgaurVh7NqyaDMFjM+FxTnD4Vg42r4RACfm4fh268y/mm1zY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cO4+1Lh523j8ei11Vbwy2Ph/5JkUZmTjv/88/q/FZ3s+Wbhr2Eyvt2Jn1/9VNpnN9JvCg+IrWh+46yF5w6SnbqyzKewHnKi+r8ya8NshIppQvWlMirYt76qvfueZ3KeMuYWSJJ51eAyP2uo5eM6eV/e3sb7rMbem7+NqnvNHZGZSW+OqvzE9uLfmRF/KUEaWZshA6JM8kpFQ5xF+fP538Ez/Paiel6tuaCUJyPE+PlOm1Vf64aRNXRW/zA81St/FtbIkdH+sj5eGxNuJvK3iI0CrXgSZXTYrYnkLZ8bsPZvVyr45TjfX8sSZE89fWRfo85cddpaetiuf6AF5ztRRjymePMo++Kn7z3R8zoTOwr/xVnl+u6y+dpJ2vXnW+enW9iaGb45UUQlIevFOetaoy3/6yPz6CMOiKz8+10pzYPbLO76jS3zcx9roJ7OOMyrTkNpbOLnaI7CkuASsj4q1JeYeIsXDVpyAk/f702vzrX/qEXktTngPlk/G1xeo82uf8cPF6nnmf/qpP176+nev+mZSXPR3Epnbk4g43F6h0hoqyPuH6c55z1/T5z0YpMHwp8upJspdPhrXOl3d2tofTZbc9fZYW+SZIuXp2FsM3K3gbKp1P7mw1utlZerkVd1HKPJQvRfHL4Wt9Cj09NP/rDSk/lChTx4S5S+XtePlwGGUqcWuxuXV4eqjteub4/lkZWRHmZAP5mqPMqG0thpfPualM5wxkPJS/qMEsFQeEn9+9edm/FId9faj65qef//jj/wMyRrXG"; \ No newline at end of file diff --git a/docs/classes/default.html b/docs/classes/default.html index 328c49d..c1548a8 100644 --- a/docs/classes/default.html +++ b/docs/classes/default.html @@ -1,14 +1,25 @@ -default | d4h-typescript

Constructors

Methods

getEmergencyContacts -getGroupAsync -getGroupsAsync -getMemberAsync -getMembersAsync +default | d4h-typescript

Constructors

Methods


  • -

    Parameters

    • id: number

    Returns Promise<Group>


  • -

    Parameters

    Returns Promise<void>

+updateMember +

Constructors

Methods


  • +

    Parameters

    • context: string
    • contextId: number
    • id: number | "me"

    Returns Promise<Animal>

  • Parameters

    • context: string
    • contextId: number
    • id: number

    Returns Promise<Qualification>

  • Parameters

    • context: string
    • contextId: number
    • id: number

    Returns Promise<Qualification>


  • +

    Parameters

    • context: string
    • contextId: number
    • activityId: number

    Returns Promise<Incident>


  • +

    Parameters

    • context: string
    • contextId: number
    • id: number | "me"
    • Optionaloptions: GetMemberOptions

    Returns Promise<Member>


  • +

    Parameters

    • context: string
    • contextId: number
    • groupId: number

    Returns Promise<memberGroup>


  • +

    Parameters

    • context: string
    • contextId: number
    • id: number | "me"

    Returns Promise<Qualification>


  • +

    Parameters

    Returns Promise<void>

  • Parameters

    • context: string
    • contextId: number
    • id: number
    • updates: MemberUpdate

    Returns Promise<void>

diff --git a/docs/enums/CustomFieldType.html b/docs/enums/CustomFieldType.html index 5e2777f..de6a6a1 100644 --- a/docs/enums/CustomFieldType.html +++ b/docs/enums/CustomFieldType.html @@ -1,4 +1,4 @@ -CustomFieldType | d4h-typescript

Enumeration CustomFieldType

Enumeration Members

Date +CustomFieldType | d4h-typescript

Enumeration CustomFieldType

Enumeration Members

Enumeration Members

Date: "date"
Number: "number"
Text: "text"
+

Enumeration Members

Date: "date"
Number: "number"
Text: "text"
diff --git a/docs/index.html b/docs/index.html index e87a3fa..803ef00 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,6 @@ d4h-typescript

d4h-typescript

d4h-typescript

Typescript library for accessing D4H

+

Typedoc Generated Documentation available at:

+

https://chewbaccalakis.github.io/d4h-typescript/modules.html

This library is not in NPM. As a result, you need to add it to your project locally. To do so, you have three options:

  1. Add the repository to the consuming repository as a Git submodule.
  2. @@ -25,4 +27,4 @@

    Build simply builds the test project, while launch both builds and runs it. If you've made changes to lib, be sure to build there first.

    Before launching, you should setup environment variables. sample.env shows you what variables are necessary. Copy the contents to a new file, .env, in the same folder and populate it appropriately.

    -
+
diff --git a/docs/interfaces/AddressInfo.html b/docs/interfaces/AddressInfo.html new file mode 100644 index 0000000..4d9b1ff --- /dev/null +++ b/docs/interfaces/AddressInfo.html @@ -0,0 +1,6 @@ +AddressInfo | d4h-typescript

Interface AddressInfo

interface AddressInfo {
    country: string;
    postCode: string;
    region: string;
    street: string;
    town: string;
}

Properties

country: string
postCode: string
region: string
street: string
town: string
diff --git a/docs/interfaces/Animal.html b/docs/interfaces/Animal.html new file mode 100644 index 0000000..36ad489 --- /dev/null +++ b/docs/interfaces/Animal.html @@ -0,0 +1,17 @@ +Animal | d4h-typescript

Interface Animal

interface Animal {
    bornAt: string;
    breed: string;
    countRollingHours: number;
    createdAt: string;
    custom_fields?: CustomField[];
    entityType: EntityType;
    id: number;
    joinedAt: string;
    leftAt: null | string;
    name: string;
    notes: string;
    ref: string;
    resourceType: string;
    status: string;
    type: string;
    updatedAt: string;
}

Hierarchy

  • Entity
    • Animal

Properties

bornAt: string
breed: string
countRollingHours: number
createdAt: string
custom_fields?: CustomField[]
entityType: EntityType
id: number
joinedAt: string
leftAt: null | string
name: string
notes: string
ref: string
resourceType: string
status: string
type: string
updatedAt: string
diff --git a/docs/interfaces/CustomField.html b/docs/interfaces/CustomField.html index 6907749..34ac78a 100644 --- a/docs/interfaces/CustomField.html +++ b/docs/interfaces/CustomField.html @@ -1,8 +1,8 @@ -CustomField | d4h-typescript

Interface CustomField

interface CustomField {
    bundle: unknown;
    id: number;
    label: string;
    member_edit_own: boolean;
    type: CustomFieldType;
    value: null | string;
    value_string: null | string;
}

Properties

bundle +CustomField | d4h-typescript

Interface CustomField

interface CustomField {
    bundle: unknown;
    id: number;
    label: string;
    member_edit_own: boolean;
    type: CustomFieldType;
    value: null | string;
    value_string: null | string;
}

Properties

bundle: unknown
id: number
label: string
member_edit_own: boolean
value: null | string
value_string: null | string
+

Properties

bundle: unknown
id: number
label: string
member_edit_own: boolean
value: null | string
value_string: null | string
diff --git a/docs/interfaces/CustomFieldUpdate.html b/docs/interfaces/CustomFieldUpdate.html index 53e71cf..282589f 100644 --- a/docs/interfaces/CustomFieldUpdate.html +++ b/docs/interfaces/CustomFieldUpdate.html @@ -1,3 +1,3 @@ -CustomFieldUpdate | d4h-typescript

Interface CustomFieldUpdate

interface CustomFieldUpdate {
    id: number;
    value: null | string;
}

Properties

id +CustomFieldUpdate | d4h-typescript

Interface CustomFieldUpdate

interface CustomFieldUpdate {
    id: number;
    value: null | string;
}

Properties

Properties

id: number
value: null | string
+

Properties

id: number
value: null | string
diff --git a/docs/interfaces/CustomMemberStatus.html b/docs/interfaces/CustomMemberStatus.html new file mode 100644 index 0000000..6c627b6 --- /dev/null +++ b/docs/interfaces/CustomMemberStatus.html @@ -0,0 +1,3 @@ +CustomMemberStatus | d4h-typescript

Interface CustomMemberStatus

interface CustomMemberStatus {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/EmailInfo.html b/docs/interfaces/EmailInfo.html new file mode 100644 index 0000000..b83aaee --- /dev/null +++ b/docs/interfaces/EmailInfo.html @@ -0,0 +1,3 @@ +EmailInfo | d4h-typescript

Interface EmailInfo

interface EmailInfo {
    value: string;
    verified: boolean;
}

Properties

Properties

value: string
verified: boolean
diff --git a/docs/interfaces/EmergencyContact.html b/docs/interfaces/EmergencyContact.html deleted file mode 100644 index 1def9d3..0000000 --- a/docs/interfaces/EmergencyContact.html +++ /dev/null @@ -1,5 +0,0 @@ -EmergencyContact | d4h-typescript

Interface EmergencyContact

interface EmergencyContact {
    alt_phone: null | string;
    name: null | string;
    phone: null | string;
    relation: null | string;
}

Properties

Properties

alt_phone: null | string
name: null | string
phone: null | string
relation: null | string
diff --git a/docs/interfaces/EmergencyContacts.html b/docs/interfaces/EmergencyContacts.html deleted file mode 100644 index a746506..0000000 --- a/docs/interfaces/EmergencyContacts.html +++ /dev/null @@ -1,3 +0,0 @@ -EmergencyContacts | d4h-typescript

Interface EmergencyContacts

interface EmergencyContacts {
    primary: EmergencyContact;
    secondary: EmergencyContact;
}

Properties

Properties

secondary: EmergencyContact
diff --git a/docs/interfaces/EquipmentLocation.html b/docs/interfaces/EquipmentLocation.html new file mode 100644 index 0000000..2f4b45f --- /dev/null +++ b/docs/interfaces/EquipmentLocation.html @@ -0,0 +1,3 @@ +EquipmentLocation | d4h-typescript

Interface EquipmentLocation

interface EquipmentLocation {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/GetAnimalsOptions.html b/docs/interfaces/GetAnimalsOptions.html new file mode 100644 index 0000000..20042fb --- /dev/null +++ b/docs/interfaces/GetAnimalsOptions.html @@ -0,0 +1,9 @@ +GetAnimalsOptions | d4h-typescript

Interface GetAnimalsOptions

interface GetAnimalsOptions {
    handler_member_id?: number | number[];
    id?: number | number[];
    order?: "asc" | "desc";
    page?: number;
    size?: number;
    sort?: string | string[];
    status?: string;
    team_id?: number;
}

Properties

handler_member_id?: number | number[]
id?: number | number[]
order?: "asc" | "desc"
page?: number
size?: number
sort?: string | string[]
status?: string
team_id?: number
diff --git a/docs/interfaces/GetGroupsOptions.html b/docs/interfaces/GetGroupsOptions.html index b50a814..e61f7fc 100644 --- a/docs/interfaces/GetGroupsOptions.html +++ b/docs/interfaces/GetGroupsOptions.html @@ -1,3 +1,3 @@ -GetGroupsOptions | d4h-typescript

Interface GetGroupsOptions

interface GetGroupsOptions {
    memberId?: number;
    title?: string;
}

Properties

memberId? +GetGroupsOptions | d4h-typescript

Interface GetGroupsOptions

interface GetGroupsOptions {
    memberId?: number;
    title?: string;
}

Properties

Properties

memberId?: number
title?: string
+

Properties

memberId?: number
title?: string
diff --git a/docs/interfaces/GetIncidentOptions.html b/docs/interfaces/GetIncidentOptions.html new file mode 100644 index 0000000..c338fcd --- /dev/null +++ b/docs/interfaces/GetIncidentOptions.html @@ -0,0 +1,16 @@ +GetIncidentOptions | d4h-typescript

Interface GetIncidentOptions

interface GetIncidentOptions {
    after?: string;
    before?: string;
    deleted?: boolean;
    ends_before?: string;
    id?: number | number[];
    order?: "asc" | "desc";
    page?: number;
    published?: boolean;
    reference?: string;
    size?: number;
    sort?: string | string[];
    starts_after?: string;
    tag_bundle_id?: number;
    tag_id?: number;
    team_id?: number;
}

Properties

after?: string
before?: string
deleted?: boolean
ends_before?: string
id?: number | number[]
order?: "asc" | "desc"
page?: number
published?: boolean
reference?: string
size?: number
sort?: string | string[]
starts_after?: string
tag_bundle_id?: number
tag_id?: number
team_id?: number
diff --git a/docs/interfaces/GetMemberAwardsOptions.html b/docs/interfaces/GetMemberAwardsOptions.html new file mode 100644 index 0000000..2d2eebb --- /dev/null +++ b/docs/interfaces/GetMemberAwardsOptions.html @@ -0,0 +1,9 @@ +GetMemberAwardsOptions | d4h-typescript

Interface GetMemberAwardsOptions

interface GetMemberAwardsOptions {
    exclude_org_data?: boolean;
    exclude_teams_data?: boolean;
    member_id: number | "me";
    order?: "asc" | "desc";
    page?: number;
    qualification_id?: number;
    size?: number;
    sort?: string | string[];
}

Properties

exclude_org_data?: boolean
exclude_teams_data?: boolean
member_id: number | "me"
order?: "asc" | "desc"
page?: number
qualification_id?: number
size?: number
sort?: string | string[]
diff --git a/docs/interfaces/GetMemberGroupsOptions.html b/docs/interfaces/GetMemberGroupsOptions.html new file mode 100644 index 0000000..0753baa --- /dev/null +++ b/docs/interfaces/GetMemberGroupsOptions.html @@ -0,0 +1,8 @@ +GetMemberGroupsOptions | d4h-typescript

Interface GetMemberGroupsOptions

interface GetMemberGroupsOptions {
    id: number;
    order?: "asc" | "desc";
    page?: number;
    size?: number;
    sort?: string | string[];
    team_id?: number | number[];
    title?: string;
}

Properties

id: number
order?: "asc" | "desc"
page?: number
size?: number
sort?: string | string[]
team_id?: number | number[]
title?: string
diff --git a/docs/interfaces/GetMemberOptions.html b/docs/interfaces/GetMemberOptions.html index 6ca22f0..df6281e 100644 --- a/docs/interfaces/GetMemberOptions.html +++ b/docs/interfaces/GetMemberOptions.html @@ -1,2 +1,2 @@ -GetMemberOptions | d4h-typescript

Interface GetMemberOptions

interface GetMemberOptions {
    includeDetails?: boolean;
}

Properties

Properties

includeDetails?: boolean
+GetMemberOptions | d4h-typescript

Interface GetMemberOptions

interface GetMemberOptions {
    includeDetails?: boolean;
}

Properties

Properties

includeDetails?: boolean
diff --git a/docs/interfaces/GetMembersOptions.html b/docs/interfaces/GetMembersOptions.html index 554fda6..6c63741 100644 --- a/docs/interfaces/GetMembersOptions.html +++ b/docs/interfaces/GetMembersOptions.html @@ -1,4 +1,10 @@ -GetMembersOptions | d4h-typescript

Interface GetMembersOptions

interface GetMembersOptions {
    groupId?: number;
    includeCustomFields?: boolean;
    includeDetails?: boolean;
}

Properties

groupId?: number
includeCustomFields?: boolean
includeDetails?: boolean
+GetMembersOptions | d4h-typescript

Interface GetMembersOptions

interface GetMembersOptions {
    deleted?: boolean;
    id_tag?: string;
    name?: string;
    order?: "asc" | "desc";
    page?: number;
    size?: number;
    sort?: string | string[];
    statuses?: (null | number)[];
    team_id?: number;
}

Properties

deleted?: boolean
id_tag?: string
name?: string
order?: "asc" | "desc"
page?: number
size?: number
sort?: string | string[]
statuses?: (null | number)[]
team_id?: number
diff --git a/docs/interfaces/GetQualificationOptions.html b/docs/interfaces/GetQualificationOptions.html new file mode 100644 index 0000000..de26b10 --- /dev/null +++ b/docs/interfaces/GetQualificationOptions.html @@ -0,0 +1,8 @@ +GetQualificationOptions | d4h-typescript

Interface GetQualificationOptions

interface GetQualificationOptions {
    exclude_org_data?: boolean;
    exclude_teams_data?: boolean;
    order?: "asc" | "desc";
    page?: number;
    size?: number;
    sort?: string | string[];
    title?: string;
}

Properties

exclude_org_data?: boolean
exclude_teams_data?: boolean
order?: "asc" | "desc"
page?: number
size?: number
sort?: string | string[]
title?: string
diff --git a/docs/interfaces/Group.html b/docs/interfaces/Group.html deleted file mode 100644 index cb2ab40..0000000 --- a/docs/interfaces/Group.html +++ /dev/null @@ -1,4 +0,0 @@ -Group | d4h-typescript

Interface Group

interface Group {
    bundle: string;
    id: number;
    title: string;
}

Properties

Properties

bundle: string
id: number
title: string
diff --git a/docs/interfaces/Incident.html b/docs/interfaces/Incident.html index b71d3a4..3919947 100644 --- a/docs/interfaces/Incident.html +++ b/docs/interfaces/Incident.html @@ -1,9 +1,37 @@ -Incident | d4h-typescript

Interface Incident

interface Incident {
    date: string;
    description?: string;
    enddate?: string;
    id: number;
    lat?: number;
    lng?: number;
    ref_desc: string;
    tags?: string[];
}

Properties

date -description? -enddate? +Incident | d4h-typescript

Interface Incident

interface Incident {
    address: AddressInfo;
    approved: boolean;
    bearing: number;
    coordinator: null | string;
    countAttendance: number;
    countGuests: number;
    createdAt: string;
    createdOrPublishedAt: string;
    custom_fields?: CustomField[];
    description: string;
    descriptionDeprecated: string;
    distance: number;
    endsAt: string;
    entityType: EntityType;
    fullTeam: boolean;
    id: number;
    location: IncidentLocation;
    locationBookmark: IncidentLocationBookmark;
    night: boolean;
    owner: IncidentOwner;
    percAttendance: number;
    plan: null | string;
    planDeprecated: null | string;
    published: boolean;
    reference: string;
    referenceDescription: string;
    resourceType: string;
    selfCoordinator: boolean;
    shared: boolean;
    startsAt: string;
    tags: IncidentTag[];
    trackingNumber: null | string;
    updatedAt: string;
    weather: WeatherInfo;
    weatherCloudCover: null | number;
    weatherPressure: null | number;
}

Hierarchy

  • Entity
    • Incident

Properties

date: string
description?: string
enddate?: string
id: number
lat?: number
lng?: number
ref_desc: string
tags?: string[]
+location +locationBookmark +night +owner +percAttendance +plan +planDeprecated +published +reference +referenceDescription +resourceType +selfCoordinator +shared +startsAt +tags +trackingNumber +updatedAt +weather +weatherCloudCover +weatherPressure +

Properties

address: AddressInfo
approved: boolean
bearing: number
coordinator: null | string
countAttendance: number
countGuests: number
createdAt: string
createdOrPublishedAt: string
custom_fields?: CustomField[]
description: string
descriptionDeprecated: string
distance: number
endsAt: string
entityType: EntityType
fullTeam: boolean
id: number
locationBookmark: IncidentLocationBookmark
night: boolean
percAttendance: number
plan: null | string
planDeprecated: null | string
published: boolean
reference: string
referenceDescription: string
resourceType: string
selfCoordinator: boolean
shared: boolean
startsAt: string
tags: IncidentTag[]
trackingNumber: null | string
updatedAt: string
weather: WeatherInfo
weatherCloudCover: null | number
weatherPressure: null | number
diff --git a/docs/interfaces/IncidentLocation.html b/docs/interfaces/IncidentLocation.html new file mode 100644 index 0000000..6d61e25 --- /dev/null +++ b/docs/interfaces/IncidentLocation.html @@ -0,0 +1,3 @@ +IncidentLocation | d4h-typescript

Interface IncidentLocation

interface IncidentLocation {
    coordinates: [number, number];
    type: string;
}

Properties

Properties

coordinates: [number, number]
type: string
diff --git a/docs/interfaces/IncidentLocationBookmark.html b/docs/interfaces/IncidentLocationBookmark.html new file mode 100644 index 0000000..d84799f --- /dev/null +++ b/docs/interfaces/IncidentLocationBookmark.html @@ -0,0 +1,3 @@ +IncidentLocationBookmark | d4h-typescript

Interface IncidentLocationBookmark

interface IncidentLocationBookmark {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/IncidentOwner.html b/docs/interfaces/IncidentOwner.html new file mode 100644 index 0000000..c7429d0 --- /dev/null +++ b/docs/interfaces/IncidentOwner.html @@ -0,0 +1,3 @@ +IncidentOwner | d4h-typescript

Interface IncidentOwner

interface IncidentOwner {
    id: number;
    resourceType: string;
}

Properties

Properties

id: number
resourceType: string
diff --git a/docs/interfaces/IncidentRoster.html b/docs/interfaces/IncidentRoster.html index 825aef9..2f4878f 100644 --- a/docs/interfaces/IncidentRoster.html +++ b/docs/interfaces/IncidentRoster.html @@ -1,7 +1,7 @@ -IncidentRoster | d4h-typescript

Interface IncidentRoster

interface IncidentRoster {
    date: string;
    enddate: string;
    id: number;
    member: { id: number; name: string };
    role: { bundle: string; id: number; title: string };
    status: string;
}

Properties

date +IncidentRoster | d4h-typescript

Interface IncidentRoster

interface IncidentRoster {
    date: string;
    enddate: string;
    id: number;
    member: { id: number; name: string };
    role: { bundle: string; id: number; title: string };
    status: string;
}

Properties

date: string
enddate: string
id: number
member: { id: number; name: string }
role: { bundle: string; id: number; title: string }
status: string
+

Properties

date: string
enddate: string
id: number
member: { id: number; name: string }
role: { bundle: string; id: number; title: string }
status: string
diff --git a/docs/interfaces/IncidentTag.html b/docs/interfaces/IncidentTag.html new file mode 100644 index 0000000..ae95809 --- /dev/null +++ b/docs/interfaces/IncidentTag.html @@ -0,0 +1,3 @@ +IncidentTag | d4h-typescript

Interface IncidentTag

interface IncidentTag {
    id: number;
    resourceType: string;
}

Properties

Properties

id: number
resourceType: string
diff --git a/docs/interfaces/Location.html b/docs/interfaces/Location.html new file mode 100644 index 0000000..d9d471c --- /dev/null +++ b/docs/interfaces/Location.html @@ -0,0 +1,3 @@ +Location | d4h-typescript

Interface Location

interface Location {
    coordinates: [number, number];
    type: string;
}

Properties

Properties

coordinates: [number, number]
type: string
diff --git a/docs/interfaces/Member.html b/docs/interfaces/Member.html index 7e6d261..903f0fa 100644 --- a/docs/interfaces/Member.html +++ b/docs/interfaces/Member.html @@ -1,17 +1,62 @@ -Member | d4h-typescript

Interface Member

interface Member {
    address: string;
    custom_fields?: CustomField[];
    email: null | string;
    emergency_contacts: EmergencyContact[];
    group_ids: null | number[];
    homephone: string;
    id: number;
    joined_at: string;
    mobilephone: string;
    name: string;
    notes: null | string;
    position: string;
    ref: string;
    status: MemberStatus;
    type: EntityType;
    workphone: string;
}

Hierarchy

  • Entity
    • Member

Properties

address +Member | d4h-typescript

Interface Member

interface Member {
    alertActivityApproval: boolean;
    alertAllQualifications: boolean;
    alertGear: boolean;
    alertQualifications: boolean;
    chatAutosubscribe: boolean;
    chatDailyDigest: boolean;
    contactUpdateMail: boolean;
    costPerHour: null | number;
    costPerUse: null | number;
    countReportingEvent: number;
    countReportingExercise: number;
    countReportingHours: number;
    countReportingIncident: number;
    countRollingHours: number;
    countRollingHoursEvent: number;
    countRollingHoursExercise: number;
    countRollingHoursIncident: number;
    createdAt: string;
    credits: number;
    custom_fields?: CustomField[];
    customStatus: CustomMemberStatus;
    defaultDuty: string;
    defaultEquipmentLocation: EquipmentLocation;
    deprecatedAddress: null | string;
    email: EmailInfo;
    endsAt: null | string;
    entityType: EntityType;
    home: PhoneInfo;
    icalSecret: null | string;
    id: number;
    lastLogin: null | string;
    location: Location;
    locationBookmark: MemberLocationBookmark;
    mobile: PhoneInfo;
    name: string;
    notes: null | string;
    pager: PhoneInfo;
    percReportingEvent: number;
    percReportingExercise: number;
    percReportingIncident: number;
    percRollingEvent: number;
    percRollingExercise: number;
    percRollingIncident: number;
    permission: number;
    position: string;
    primaryEmergencyContact: PrimaryEmergencyContact;
    ref: string;
    retiredReason: RetiredReason;
    role: Role;
    secondaryEmergencyContact: SecondaryEmergencyContact;
    signedTandC: null | string;
    startsAt: null | string;
    status: string;
    teamAgreementSigned: null | string;
    updatedAt: string;
    weeklyDayOfWeek: number;
    weeklyDayOfWeekUtc: number;
    weeklyHourOfDay: number;
    weeklyHourOfDayUtc: number;
    weeklyMail: boolean;
    work: PhoneInfo;
}

Hierarchy

  • Entity
    • Member

Properties

address: string
custom_fields?: CustomField[]
email: null | string
emergency_contacts: EmergencyContact[]
group_ids: null | number[]
homephone: string
id: number
joined_at: string
mobilephone: string
name: string
notes: null | string
position: string
ref: string
status: MemberStatus
type: EntityType
workphone: string
+teamAgreementSigned +updatedAt +weeklyDayOfWeek +weeklyDayOfWeekUtc +weeklyHourOfDay +weeklyHourOfDayUtc +weeklyMail +work +

Properties

alertActivityApproval: boolean
alertAllQualifications: boolean
alertGear: boolean
alertQualifications: boolean
chatAutosubscribe: boolean
chatDailyDigest: boolean
contactUpdateMail: boolean
costPerHour: null | number
costPerUse: null | number
countReportingEvent: number
countReportingExercise: number
countReportingHours: number
countReportingIncident: number
countRollingHours: number
countRollingHoursEvent: number
countRollingHoursExercise: number
countRollingHoursIncident: number
createdAt: string
credits: number
custom_fields?: CustomField[]
customStatus: CustomMemberStatus
defaultDuty: string
defaultEquipmentLocation: EquipmentLocation
deprecatedAddress: null | string
email: EmailInfo
endsAt: null | string
entityType: EntityType
home: PhoneInfo
icalSecret: null | string
id: number
lastLogin: null | string
location: Location
locationBookmark: MemberLocationBookmark
mobile: PhoneInfo
name: string
notes: null | string
pager: PhoneInfo
percReportingEvent: number
percReportingExercise: number
percReportingIncident: number
percRollingEvent: number
percRollingExercise: number
percRollingIncident: number
permission: number
position: string
primaryEmergencyContact: PrimaryEmergencyContact
ref: string
retiredReason: RetiredReason
role: Role
secondaryEmergencyContact: SecondaryEmergencyContact
signedTandC: null | string
startsAt: null | string
status: string
teamAgreementSigned: null | string
updatedAt: string
weeklyDayOfWeek: number
weeklyDayOfWeekUtc: number
weeklyHourOfDay: number
weeklyHourOfDayUtc: number
weeklyMail: boolean
work: PhoneInfo
diff --git a/docs/interfaces/MemberAwards.html b/docs/interfaces/MemberAwards.html new file mode 100644 index 0000000..9a9d090 --- /dev/null +++ b/docs/interfaces/MemberAwards.html @@ -0,0 +1,12 @@ +MemberAwards | d4h-typescript

Interface MemberAwards

interface MemberAwards {
    createdAt: string;
    custom_fields?: CustomField[];
    endsAt: null | string;
    entityType: EntityType;
    id: number;
    member: Resource;
    owner: Resource;
    qualification: Resource;
    resourceType: string;
    startsAt: null | string;
    updatedAt: string;
}

Hierarchy

  • Entity
    • MemberAwards

Properties

createdAt: string
custom_fields?: CustomField[]
endsAt: null | string
entityType: EntityType
id: number
member: Resource
owner: Resource
qualification: Resource
resourceType: string
startsAt: null | string
updatedAt: string
diff --git a/docs/interfaces/MemberLocationBookmark.html b/docs/interfaces/MemberLocationBookmark.html new file mode 100644 index 0000000..41ce1ac --- /dev/null +++ b/docs/interfaces/MemberLocationBookmark.html @@ -0,0 +1,3 @@ +MemberLocationBookmark | d4h-typescript

Interface MemberLocationBookmark

interface MemberLocationBookmark {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/MemberStatus.html b/docs/interfaces/MemberStatus.html index ff84e5a..4946e1e 100644 --- a/docs/interfaces/MemberStatus.html +++ b/docs/interfaces/MemberStatus.html @@ -1,5 +1,5 @@ -MemberStatus | d4h-typescript

Interface MemberStatus

interface MemberStatus {
    id: number;
    label: null | MemberStatusLabel;
    type: string;
    value: string;
}

Properties

id +MemberStatus | d4h-typescript

Interface MemberStatus

interface MemberStatus {
    id: number;
    label: null | MemberStatusLabel;
    type: string;
    value: string;
}

Properties

Properties

id: number
label: null | MemberStatusLabel
type: string
value: string
+

Properties

id: number
label: null | MemberStatusLabel
type: string
value: string
diff --git a/docs/interfaces/MemberStatusLabel.html b/docs/interfaces/MemberStatusLabel.html index d17d4fa..be09a93 100644 --- a/docs/interfaces/MemberStatusLabel.html +++ b/docs/interfaces/MemberStatusLabel.html @@ -1,3 +1,3 @@ -MemberStatusLabel | d4h-typescript

Interface MemberStatusLabel

interface MemberStatusLabel {
    id: number;
    value: string;
}

Properties

id +MemberStatusLabel | d4h-typescript

Interface MemberStatusLabel

interface MemberStatusLabel {
    id: number;
    value: string;
}

Properties

Properties

id: number
value: string
+

Properties

id: number
value: string
diff --git a/docs/interfaces/MemberUpdate.html b/docs/interfaces/MemberUpdate.html index afa3505..a0b5325 100644 --- a/docs/interfaces/MemberUpdate.html +++ b/docs/interfaces/MemberUpdate.html @@ -1,9 +1,4 @@ -MemberUpdate | d4h-typescript

Interface MemberUpdate

interface MemberUpdate {
    address?: null | string;
    address_city?: null | string;
    address_country?: null | string;
    address_postcode?: null | string;
    address_region?: null | string;
    address_street?: null | string;
    cost_per_hour?: number;
    cost_per_use?: number;
    date_join?: Date;
    date_leave?: Date;
    email?: null | string;
    gridref?: null | string;
    id_tag?: null | string;
    lat?: number;
    lng?: number;
    location_bookmark_id?: number;
    name?: null | string;
    notes?: null | string;
    pager?: null | string;
    pager_email?: null | string;
    phone_home?: null | string;
    phone_mobile?: null | string;
    phone_work?: null | string;
    position?: null | string;
    ref?: null | string;
    retired_reason_id?: number;
    role_id?: number;
    status_custom_id?: number;
    status_id?: number;
}

Properties

address? -address_city? -address_country? -address_postcode? -address_region? -address_street? +MemberUpdate | d4h-typescript

Interface MemberUpdate

interface MemberUpdate {
    address?: null | string;
    cost_per_hour?: number;
    cost_per_use?: number;
    date_join?: Date;
    date_leave?: Date;
    email?: null | string;
    gridref?: null | string;
    id_tag?: null | string;
    lat?: number;
    lng?: number;
    location_bookmark_id?: number;
    name?: null | string;
    notes?: null | string;
    pager?: null | string;
    pager_email?: null | string;
    phone_home?: null | string;
    phone_mobile?: null | string;
    phone_work?: null | string;
    position?: null | string;
    ref?: null | string;
    retired_reason_id?: number;
    role_id?: number;
    status_custom_id?: number;
    status_id?: number;
}

Properties

address?: null | string
address_city?: null | string
address_country?: null | string
address_postcode?: null | string
address_region?: null | string
address_street?: null | string
cost_per_hour?: number
cost_per_use?: number
date_join?: Date
date_leave?: Date
email?: null | string
gridref?: null | string
id_tag?: null | string
lat?: number
lng?: number
location_bookmark_id?: number
name?: null | string
notes?: null | string
pager?: null | string
pager_email?: null | string
phone_home?: null | string
phone_mobile?: null | string
phone_work?: null | string
position?: null | string
ref?: null | string
retired_reason_id?: number
role_id?: number
status_custom_id?: number
status_id?: number
+

Properties

address?: null | string
cost_per_hour?: number
cost_per_use?: number
date_join?: Date
date_leave?: Date
email?: null | string
gridref?: null | string
id_tag?: null | string
lat?: number
lng?: number
location_bookmark_id?: number
name?: null | string
notes?: null | string
pager?: null | string
pager_email?: null | string
phone_home?: null | string
phone_mobile?: null | string
phone_work?: null | string
position?: null | string
ref?: null | string
retired_reason_id?: number
role_id?: number
status_custom_id?: number
status_id?: number
diff --git a/docs/interfaces/PhoneInfo.html b/docs/interfaces/PhoneInfo.html new file mode 100644 index 0000000..28f275a --- /dev/null +++ b/docs/interfaces/PhoneInfo.html @@ -0,0 +1,3 @@ +PhoneInfo | d4h-typescript

Interface PhoneInfo

interface PhoneInfo {
    phone: string;
    verified?: boolean;
}

Properties

Properties

phone: string
verified?: boolean
diff --git a/docs/interfaces/PrimaryEmergencyContact.html b/docs/interfaces/PrimaryEmergencyContact.html new file mode 100644 index 0000000..3c716b2 --- /dev/null +++ b/docs/interfaces/PrimaryEmergencyContact.html @@ -0,0 +1,5 @@ +PrimaryEmergencyContact | d4h-typescript

Interface PrimaryEmergencyContact

interface PrimaryEmergencyContact {
    name: string;
    primaryPhone: string;
    relation: string;
    secondaryPhone: string;
}

Properties

name: string
primaryPhone: string
relation: string
secondaryPhone: string
diff --git a/docs/interfaces/Qualification.html b/docs/interfaces/Qualification.html new file mode 100644 index 0000000..be3459e --- /dev/null +++ b/docs/interfaces/Qualification.html @@ -0,0 +1,14 @@ +Qualification | d4h-typescript

Interface Qualification

interface Qualification {
    cost: null | number;
    createdAt: string;
    custom_fields?: CustomField[];
    deprecatedBundle: string;
    description: string;
    entityType: EntityType;
    expiredCost: null;
    expiresMonthsDefault: null | number;
    id: number;
    reminderDays: number;
    resourceType: string;
    title: string;
    updatedAt: string;
}

Hierarchy

  • Entity
    • Qualification

Properties

cost: null | number
createdAt: string
custom_fields?: CustomField[]
deprecatedBundle: string
description: string
entityType: EntityType
expiredCost: null
expiresMonthsDefault: null | number
id: number
reminderDays: number
resourceType: string
title: string
updatedAt: string
diff --git a/docs/interfaces/Resource.html b/docs/interfaces/Resource.html new file mode 100644 index 0000000..cc936c2 --- /dev/null +++ b/docs/interfaces/Resource.html @@ -0,0 +1,3 @@ +Resource | d4h-typescript

Interface Resource

interface Resource {
    id: number;
    resourceType: string;
}

Properties

Properties

id: number
resourceType: string
diff --git a/docs/interfaces/RetiredReason.html b/docs/interfaces/RetiredReason.html new file mode 100644 index 0000000..2ee012e --- /dev/null +++ b/docs/interfaces/RetiredReason.html @@ -0,0 +1,3 @@ +RetiredReason | d4h-typescript

Interface RetiredReason

interface RetiredReason {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/Role.html b/docs/interfaces/Role.html new file mode 100644 index 0000000..4d6e8ce --- /dev/null +++ b/docs/interfaces/Role.html @@ -0,0 +1,3 @@ +Role | d4h-typescript

Interface Role

interface Role {
    id: null | number;
    resourceType: string;
}

Properties

Properties

id: null | number
resourceType: string
diff --git a/docs/interfaces/SecondaryEmergencyContact.html b/docs/interfaces/SecondaryEmergencyContact.html new file mode 100644 index 0000000..f321ef5 --- /dev/null +++ b/docs/interfaces/SecondaryEmergencyContact.html @@ -0,0 +1,5 @@ +SecondaryEmergencyContact | d4h-typescript

Interface SecondaryEmergencyContact

interface SecondaryEmergencyContact {
    name: string;
    primaryPhone: string;
    relation: string;
    secondaryPhone: string;
}

Properties

name: string
primaryPhone: string
relation: string
secondaryPhone: string
diff --git a/docs/interfaces/WeatherInfo.html b/docs/interfaces/WeatherInfo.html new file mode 100644 index 0000000..f103be3 --- /dev/null +++ b/docs/interfaces/WeatherInfo.html @@ -0,0 +1,4 @@ +WeatherInfo | d4h-typescript

Interface WeatherInfo

interface WeatherInfo {
    symbol: null | string;
    symbolDate: null | string;
    temperature: null | number;
}

Properties

symbol: null | string
symbolDate: null | string
temperature: null | number
diff --git a/docs/interfaces/memberGroup.html b/docs/interfaces/memberGroup.html new file mode 100644 index 0000000..574dafc --- /dev/null +++ b/docs/interfaces/memberGroup.html @@ -0,0 +1,10 @@ +memberGroup | d4h-typescript

Interface memberGroup

interface memberGroup {
    createdAt: string;
    custom_fields?: CustomField[];
    deprecatedBundle: string;
    entityType: EntityType;
    id: number;
    membershipResourceType: string;
    resourceType: string;
    title: string;
    updatedAt: string;
}

Hierarchy

  • Entity
    • memberGroup

Properties

createdAt: string
custom_fields?: CustomField[]
deprecatedBundle: string
entityType: EntityType
id: number
membershipResourceType: string
resourceType: string
title: string
updatedAt: string
diff --git a/docs/modules.html b/docs/modules.html index 45b98e1..94f72e8 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -d4h-typescript
+d4h-typescript
diff --git a/docs/variables/D4H_BASE_URL.html b/docs/variables/D4H_BASE_URL.html new file mode 100644 index 0000000..3219b71 --- /dev/null +++ b/docs/variables/D4H_BASE_URL.html @@ -0,0 +1 @@ +D4H_BASE_URL | d4h-typescript

Variable D4H_BASE_URLConst

D4H_BASE_URL: "https://api.team-manager.us.d4h.com/v3" = 'https://api.team-manager.us.d4h.com/v3'
diff --git a/lib/index.ts b/lib/index.ts index 651def7..f84ef64 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,9 +1,12 @@ import D4H from './src/d4h' export default D4H -export * from './src/customField' +export * from './src/types/customField' export * from './src/d4h' -export * from './src/emergencyContacts' -export * from './src/group' -export * from './src/member' -export * from './src/events' +export * from './src/types/group' +export * from './src/types/member' +export * from './src/types/qualification' +export * from './src/types/incident' +export * from './src/types/animal' +export * from './src/types/events' + diff --git a/lib/src/api/animalsApi.ts b/lib/src/api/animalsApi.ts new file mode 100644 index 0000000..a6b5969 --- /dev/null +++ b/lib/src/api/animalsApi.ts @@ -0,0 +1,71 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Animal } from '../types/animal' +import { GetAnimalsOptions, D4H_BASE_URL } from '../d4h' + +export class animalsApi { + + + static async getAnimal(request: D4HRequest, context: string, contextId: number, animalId: number | 'me'): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animals/${animalId}`) + + const animal = await request.getAsync(url) + + if (!animal) { + throw new Error('Animal data not found or improperly formatted.') + } + animal.entityType = EntityType.Animal + + return animal + } + + static async getAnimals(request: D4HRequest, context: string, contextId: number, options?: GetAnimalsOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animals`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.handler_member_id !== undefined) { + optionsList.append('handler_member_id', options.handler_member_id.toString()) + } + + if (options.id !== undefined) { + optionsList.append('id', options.id.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.status !== undefined) { + optionsList.append('status', options.status) + } + + if (options.team_id !== undefined) { + optionsList.append('team_id', options.team_id.toString()) + } + + } + + const animals = await request.getManyAsync(url) + animals.forEach(m => m.entityType = EntityType.Animal) + + return animals + } + +} \ No newline at end of file diff --git a/lib/src/api/groupsApi.ts b/lib/src/api/groupsApi.ts new file mode 100644 index 0000000..c954cca --- /dev/null +++ b/lib/src/api/groupsApi.ts @@ -0,0 +1,74 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { memberGroup } from '../types/group' +import { GetMemberGroupsOptions, D4H_BASE_URL } from '../d4h' + +export class groupsApi { + static async getMemberGroup( + request: D4HRequest, + context: string, + contextId: number, + groupId: number, + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-groups/${groupId}`) + + const group = await request.getAsync(url) + + if (!group) { + throw new Error('Group data not found or improperly formatted.') + } + group.entityType = EntityType.memberGroup + + return group + } + + static async getMemberGroups( + request: D4HRequest, + context: string, + contextId: number, + options?: GetMemberGroupsOptions + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-groups`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.id !== undefined) { + optionsList.append('id_tag', options.id.toString()) + } + + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach((sortField) => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.team_id !== undefined) { + optionsList.append('team_id', options.team_id.toString()) + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + const groups = await request.getManyAsync(url) + groups.forEach((m) => (m.entityType = EntityType.memberGroup)) + + return groups + } +} diff --git a/lib/src/api/membersApi.ts b/lib/src/api/membersApi.ts new file mode 100644 index 0000000..3ee036c --- /dev/null +++ b/lib/src/api/membersApi.ts @@ -0,0 +1,97 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Member } from '../types/member' +import { GetMemberOptions, GetMembersOptions, D4H_BASE_URL } from '../d4h' + +export class membersApi { + static async getMember( + request: D4HRequest, + context: string, + contextId: number, + id: number | 'me', + options?: GetMemberOptions + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/members/${id}`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.includeDetails !== undefined) { + optionsList.append('include_details', 'true') + } + } + + const member = await request.getAsync(url) + + if (!member) { + throw new Error('Member data not found or improperly formatted.') + } + member.entityType = EntityType.Member + + return member + } + + static async getMembers( + request: D4HRequest, + context: string, + contextId: number, + options?: GetMembersOptions + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/members`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.deleted !== undefined) { + optionsList.append('deleted', options.deleted.toString()) + } + + if (options.id_tag !== undefined) { + optionsList.append('id_tag', options.id_tag) + } + + if (options.name !== undefined) { + optionsList.append('name', options.name) + } + + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach((sortField) => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.statuses !== undefined) { + options.statuses.forEach((status) => { + if (status !== null) { + optionsList.append('statuses', status.toString()) + } else { + optionsList.append('statuses', 'null') + } + }) + } + + if (options.team_id !== undefined) { + optionsList.append('team_id', options.team_id.toString()) + } + } + + const members = await request.getManyAsync(url) + members.forEach((m) => (m.entityType = EntityType.Member)) + + return members + } +} diff --git a/lib/src/api/qualificationsApi.ts b/lib/src/api/qualificationsApi.ts new file mode 100644 index 0000000..58a528d --- /dev/null +++ b/lib/src/api/qualificationsApi.ts @@ -0,0 +1,213 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Qualification, MemberAwards } from '../types/qualification' +import { D4H_BASE_URL, GetQualificationOptions, GetMemberAwardsOptions } from '../d4h' + + + +export class qualificationsApi { + + static async getMemberQualification(request: D4HRequest, context: string, contextId: number, qualificationId: number | 'me'): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-qualifications/${qualificationId}`) + + const qualification = await request.getAsync(url) + + if (!qualification) { + throw new Error('Qualification data not found or improperly formatted.') + } + qualification.entityType = EntityType.Incident + + return qualification + } + + static async getMemberQualifications(request: D4HRequest, context: string, contextId: number, options?: GetQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-qualifications`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.exclude_org_data !== undefined) { + optionsList.append('exclude_org_data', options.exclude_org_data.toString()) + } + + if (options.exclude_teams_data !== undefined) { + optionsList.append('exclude_teams_data', options.exclude_teams_data.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + return request.getManyAsync(url) + } + + + static async getAnimalQualification(request: D4HRequest, context: string, contextId: number, qualificationId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animal-qualifications/${qualificationId}`) + + const qualification = await request.getAsync(url) + + if (!qualification) { + throw new Error('Qualification data not found or improperly formatted.') + } + qualification.entityType = EntityType.Qualification + + return qualification + } + + static async getAnimalQualifications(request: D4HRequest, context: string, contextId: number, options?: GetQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animal-qualifications`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.exclude_org_data !== undefined) { + optionsList.append('exclude_org_data', options.exclude_org_data.toString()) + } + + if (options.exclude_teams_data !== undefined) { + optionsList.append('exclude_teams_data', options.exclude_teams_data.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + return request.getManyAsync(url) + } + + static async getHandlerQualification(request: D4HRequest, context: string, contextId: number, qualificationId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/handler-qualifications/${qualificationId}`) + + const qualification = await request.getAsync(url) + + if (!qualification) { + throw new Error('Qualification data not found or improperly formatted.') + } + qualification.entityType = EntityType.Qualification + + return qualification + } + + + static async getHandlerQualifications(request: D4HRequest, context: string, contextId: number, options?: GetQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/handler-qualifications`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.exclude_org_data !== undefined) { + optionsList.append('exclude_org_data', options.exclude_org_data.toString()) + } + + if (options.exclude_teams_data !== undefined) { + optionsList.append('exclude_teams_data', options.exclude_teams_data.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + return request.getManyAsync(url) + } + + static async getMemberAwards(request: D4HRequest, context: string, contextId: number, options?: GetMemberAwardsOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-qualification-awards`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.exclude_org_data !== undefined) { + optionsList.append('exclude_org_data', options.exclude_org_data.toString()) + } + + if (options.exclude_teams_data !== undefined) { + optionsList.append('exclude_teams_data', options.exclude_teams_data.toString()) + } + + if (options.member_id !== undefined) { + optionsList.append('member_id', options.member_id.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + + if (options.qualification_id !== undefined) { + optionsList.append('qualification_id', options.qualification_id.toString()) + } + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + } + + const awards = await request.getManyAsync(url) + awards.forEach((m) => (m.entityType = EntityType.Award)) + + return awards + } +} \ No newline at end of file diff --git a/lib/src/d4h.ts b/lib/src/d4h.ts index 4ffc4da..49e4364 100644 --- a/lib/src/d4h.ts +++ b/lib/src/d4h.ts @@ -1,21 +1,46 @@ -import { CustomFieldUpdate } from './customField' +import { CustomFieldUpdate } from './types/customField' import D4HRequest from './d4hRequest' -import { EmergencyContacts } from './emergencyContacts' import { Entity, EntityType } from './entity' -import type { Group } from './group' -import type { Member, MemberUpdate } from './member' +import type { memberGroup } from './types/group' +import type { Member, MemberUpdate } from './types/member' +import type { Qualification, MemberAwards } from './types/qualification' +import type { Incident } from './types/incident' +import type { Animal } from './types/animal' +import { membersApi } from './api/membersApi' +import { animalsApi } from './api/animalsApi' +import { qualificationsApi } from './api/qualificationsApi' +import { groupsApi } from './api/groupsApi' const D4H_FETCH_LIMIT = 250 -const D4H_BASE_URL = 'https://api.d4h.org/v2' +const D4H_BASE_URL = 'https://api.team-manager.us.d4h.com/v3' // Multiple API endpoints now, probably should handle multiple + +export { D4H_BASE_URL } export interface GetMemberOptions { includeDetails?: boolean; } export interface GetMembersOptions { - groupId?: number; - includeCustomFields?: boolean; - includeDetails?: boolean; + deleted?: boolean; // default: false + id_tag?: string; + name?: string; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: string | string[]; // default: 'id' + statuses?: (number | null)[]; // list of ids or null + team_id?: number; // the numeric identifier for a team resource +} + +export interface GetAnimalsOptions { + handler_member_id?: number | number[]; + id?: number | number[]; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: string | string[]; // default: 'id' + status?: string; // list of ids or null + team_id?: number; // the numeric identifier for a team resource } export interface GetGroupsOptions { @@ -23,6 +48,55 @@ export interface GetGroupsOptions { title?: string; } +export interface GetIncidentOptions { + after?: string; + before?: string; + deleted?: boolean; // default: 'false' + ends_before?: string; + id?: number | number[]; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + published?: boolean; + reference?: string; + size?: number; + sort?: string | string[]; // default: 'id' + starts_after?: string; + tag_bundle_id?: number; + tag_id?: number; + team_id?: number; +} + +export interface GetQualificationOptions { + exclude_org_data?: boolean; // default: false + exclude_teams_data?: boolean; // default: false + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: string | string[]; // default: 'id' + title?: string; +} + +export interface GetMemberAwardsOptions { + exclude_org_data?: boolean; // default: false + exclude_teams_data?: boolean; // default: false + member_id?: number | 'me'; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + qualification_id?: number; + size?: number; + sort?: string | string[]; // default: 'id' +} + +export interface GetMemberGroupsOptions { + id: number; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: string | string[]; // default: 'id' + team_id?: number | number[]; + title?: string; +} + export default class D4H { private readonly _request: D4HRequest @@ -34,110 +108,229 @@ export default class D4H { /**************** MEMBERS *******************/ /********************************************/ - async getMemberAsync(id: number, options?: GetMemberOptions): Promise { - const url = new URL(`${D4H_BASE_URL}/team/members/${id}`) - - if (options !== undefined) { - const optionsList = url.searchParams - - if (options.includeDetails !== undefined) { - optionsList.append('include_details', 'true') - } - } - - const member = await this._request.getAsync(url) - member.type = EntityType.Member - - return member + async getMember( + context: string, + contextId: number, + id: number | 'me', + options?: GetMemberOptions + ): Promise { + return membersApi.getMember(this._request, context, contextId, id, options) } - async getMembersAsync(options?: GetMembersOptions): Promise { - const url = new URL(`${D4H_BASE_URL}/team/members`) - - if (options !== undefined) { - const optionsList = url.searchParams - - if (options.groupId !== undefined) { - optionsList.append('group_id', options.groupId.toString()) - } - - if (options.includeDetails !== undefined) { - optionsList.append('include_details', 'true') - } - - if (options.includeCustomFields !== undefined) { - optionsList.append('include_custom_fields', 'true') - } - } - - const members = await this._request.getManyAsync(url) - members.forEach(m => m.type = EntityType.Member) - - return members + async getMembers( + context: string, + contextId: number, + options?: GetMembersOptions + ): Promise { + return membersApi.getMembers(this._request, context, contextId, options) } - updateMemberAsync(id: number, updates: MemberUpdate): Promise { + updateMember(context: string, contextId: number, id: number, updates: MemberUpdate): Promise { // If no updates, no need to actually make a request. Exit early. if (Object.getOwnPropertyNames(updates).length === 0) { return Promise.resolve() } - const url = new URL(`${D4H_BASE_URL}/team/members/${id}`) + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/members/${id}`) return this._request.putAsync(url, updates) } + /********************************************/ + /**************** ANIMALS *******************/ + /********************************************/ + + async getAnimal( + context: string, + contextId: number, + id: number | 'me', + ): Promise { + return animalsApi.getAnimal(this._request, context, contextId, id) + } + + async getAnimals( + context: string, + contextId: number, + options?: GetAnimalsOptions + ): Promise { + return animalsApi.getAnimals(this._request, context, contextId, options) + } + /********************************************/ /*********** EMERGENCY CONTACTS *************/ /********************************************/ - getEmergencyContacts(memberId: number): Promise { - const url = new URL(`${D4H_BASE_URL}/team/members/${memberId}/emergency`) - return this._request.getAsync(url) - } - - updateEmergencyContacts(memberId: number, emergencyContacts: EmergencyContacts): Promise { - const url = new URL(`${D4H_BASE_URL}/team/members/${memberId}/emergency`) - return this._request.putAsync(url, emergencyContacts) - } + // Emergency Contacts no longer have specific endpoint /********************************************/ /***************** GROUPS *******************/ /********************************************/ - getGroupAsync(id: number): Promise { - const url = new URL(`${D4H_BASE_URL}/team/groups/${id}`) - return this._request.getAsync(url) + async getMemberGroup( + context: string, + contextId: number, + groupId: number, + ): Promise { + return groupsApi.getMemberGroup(this._request, context, contextId, groupId) } - getGroupsAsync(options?: GetGroupsOptions): Promise { - const url = new URL(`${D4H_BASE_URL}/team/groups`) + async getMemberGroups( + context: string, + contextId: number, + options?: GetMemberGroupsOptions + ): Promise { + return groupsApi.getMemberGroups(this._request, context, contextId, options) + } + + /********************************************/ + /**************** INCIDENTS *****************/ + /********************************************/ + + async getIncident(context: string, contextId: number, activityId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/incidents/${activityId}`) + + const incident = await this._request.getAsync(url) + + if (!incident) { + throw new Error('Incident data not found or improperly formatted.') + } + incident.entityType = EntityType.Incident + + return incident + } + + async getIncidents(context: string, contextId: number, options?: GetIncidentOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/incidents`) if (options !== undefined) { const optionsList = url.searchParams - if (options.memberId !== undefined) { - optionsList.append('member_id', options.memberId.toString()) + if (options.after !== undefined) { + optionsList.append('after', options.after) } - - if (options.title !== undefined) { - optionsList.append('title', options.title) + if (options.before !== undefined) { + optionsList.append('before', options.before) + } + if (options.deleted !== undefined) { + optionsList.append('order', options.deleted.toString()) + } + if (options.ends_before !== undefined) { + optionsList.append('ends_before', options.ends_before) + } + if (options.id !== undefined) { + optionsList.append('id', options.id.toString()) + } + if (options.order !== undefined) { + optionsList.append('order', options.order) + } + if (options.page !== undefined) { + optionsList.append('page', options.page.toString()) + } + if (options.published !== undefined) { + optionsList.append('published', options.published.toString()) + } + if (options.reference !== undefined) { + optionsList.append('reference', options.reference) + } + if (options.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => optionsList.append('sort', sortField)) + } else { + optionsList.append('sort', options.sort) + } + } + if (options.starts_after !== undefined) { + optionsList.append('starts_after', options.starts_after) + } + if (options.tag_bundle_id !== undefined) { + optionsList.append('tag_bundle_id', options.tag_bundle_id.toString()) + } + if (options.tag_id !== undefined) { + optionsList.append('tag_id', options.tag_id.toString()) + } + if (options.team_id !== undefined) { + optionsList.append('team_id', options.team_id.toString()) } } return this._request.getManyAsync(url) } + /********************************************/ + /************* QUALIFICATIONS ***************/ + /********************************************/ + + async getMemberQualification( + context: string, + contextId: number, + id: number | 'me', + ): Promise { + return qualificationsApi.getMemberQualification(this._request, context, contextId, id) + } + + async getMemberQualifications( + context: string, + contextId: number, + options?: GetQualificationOptions + ): Promise { + return qualificationsApi.getMemberQualifications(this._request, context, contextId, options) + } + + async getAnimalQualification( + context: string, + contextId: number, + id: number, + ): Promise { + return qualificationsApi.getAnimalQualification(this._request, context, contextId, id) + } + + async getAnimalQualifications( + context: string, + contextId: number, + options?: GetQualificationOptions + ): Promise { + return qualificationsApi.getAnimalQualifications(this._request, context, contextId, options) + } + + async getHandlerQualification( + context: string, + contextId: number, + id: number, + ): Promise { + return qualificationsApi.getHandlerQualification(this._request, context, contextId, id) + } + + async getHandlerQualifications( + context: string, + contextId: number, + options?: GetQualificationOptions + ): Promise { + return qualificationsApi.getHandlerQualifications(this._request, context, contextId, options) + } + + async getMemberAwards( + context: string, + contextId: number, + options?: GetMemberAwardsOptions + ): Promise { + return qualificationsApi.getMemberAwards(this._request, context, contextId, options) + } + /********************************************/ /************** CUSTOM FIELDS ***************/ /********************************************/ + + updateCustomFields(entity: Entity, updates: CustomFieldUpdate[], onlyMemberEditOwn: boolean): Promise { // If no updates, no need to actually make a request. Exit early. if (updates.length === 0) { return Promise.resolve() } - const url = new URL(`${D4H_BASE_URL}/team/custom-fields/${entity.type}/${entity.id}`) + const url = new URL(`${D4H_BASE_URL}/team/custom-fields/${entity.entityType}/${entity.id}`) // From the documentation: // https://api.d4h.org/v2/documentation#operation/putTeamCustomfieldsEntity_typeEntity_id @@ -187,4 +380,4 @@ export default class D4H { return this._request.putAsync(url, { fields: updates }) } -} \ No newline at end of file +} diff --git a/lib/src/d4hRequest.ts b/lib/src/d4hRequest.ts index e700b1e..b030934 100644 --- a/lib/src/d4hRequest.ts +++ b/lib/src/d4hRequest.ts @@ -1,12 +1,12 @@ interface D4HResponse { - statusCode: number - data: DataType + status: number + data?: DataType } interface D4HError { error: string - message: string - statusCode: number + statusText: string + status: number } enum HttpMethod { @@ -46,39 +46,45 @@ export default class D4HRequest { const rawResponse = await fetch(url.toString(), options) const response = await rawResponse.json() as D4HResponse & D4HError - - if (response.statusCode !== 200) { - const d4hError = response as D4HError - throw new Error(`${d4hError.statusCode}: ${d4hError.error}: ${d4hError.message}`) + if (rawResponse.status !== 200) { // error handling may need to be updated + console.log(rawResponse) + throw new Error(`${rawResponse.status} : ${rawResponse.statusText}`) } - return response.data + return response as TResponse } async getAsync(url: URL): Promise { return this.requestAsync(url, HttpMethod.Get) } - async getManyAsync(url: URL): Promise { + async getManyAsync(url: URL, paginate: boolean = false): Promise { let results: DataType[] = [] - let offset = 0 - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, no-constant-condition - while (true) { - const urlWithOffset = new URL(url) - urlWithOffset.searchParams.append('offset', offset.toString()) - urlWithOffset.searchParams.append('limit', this._fetchLimit.toString()) - - const newResults = await this.getAsync(urlWithOffset) - results = results.concat(newResults) - offset += this._fetchLimit - - if (newResults.length < this._fetchLimit) { - break + if (paginate) { + let offset = 0 + + // Pagination loop + while (true) { + const urlWithOffset = new URL(url) + urlWithOffset.searchParams.append('offset', offset.toString()) + urlWithOffset.searchParams.append('limit', this._fetchLimit.toString()) + + const newResults = await this.getAsync(urlWithOffset) + results = results.concat(newResults) + offset += this._fetchLimit + + if (newResults.length < this._fetchLimit) { + break + } } + } else { + // Fetch without pagination + const newResults = await this.getAsync(url) + results = results.concat(newResults) } - + return results } diff --git a/lib/src/entity.ts b/lib/src/entity.ts index d9bf41f..d5a3e9d 100644 --- a/lib/src/entity.ts +++ b/lib/src/entity.ts @@ -1,9 +1,9 @@ -import { CustomField } from './customField' +import { CustomField } from './types/customField' export interface Entity { custom_fields?: CustomField[]; id: number; - type: EntityType; + entityType: EntityType; } // EntityType must be one of: @@ -13,4 +13,9 @@ export interface Entity { // Only the ones actively in use are implemented. export enum EntityType { Member = 'member', + memberGroup = 'membergroup', + Incident = 'incident', + Qualification = 'qualification', + Award = 'award', + Animal = 'animal' } diff --git a/lib/src/group.ts b/lib/src/group.ts deleted file mode 100644 index 8b87f58..0000000 --- a/lib/src/group.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Group { - bundle: string - id: number - title: string -} \ No newline at end of file diff --git a/lib/src/member.ts b/lib/src/member.ts deleted file mode 100644 index 92de8ca..0000000 --- a/lib/src/member.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { EmergencyContact } from './emergencyContacts' -import { Entity } from './entity' - -export interface MemberStatus { - id: number - type: string - value: string - label: MemberStatusLabel | null -} - -export interface MemberStatusLabel { - id: number - value: string -} - -export interface Member extends Entity { - address: string - email: string | null - emergency_contacts: EmergencyContact[] - group_ids: number[] | null - homephone: string - joined_at: string - mobilephone: string - name: string - notes: string | null - position: string - ref: string - status: MemberStatus - workphone: string -} - -export interface MemberUpdate { - name?: string | null - ref?: string | null - id_tag?: string | null - status_id?: number - status_custom_id?: number - retired_reason_id?: number - date_leave?: Date - date_join?: Date - position?: string | null - role_id?: number - cost_per_hour?: number - cost_per_use?: number - address_street?: string | null - address_city?: string | null - address_region?: string | null - address_postcode?: string | null - address_country?: string | null - lat?: number - lng?: number - gridref?: string | null - location_bookmark_id?: number - email?: string | null - phone_mobile?: string | null - phone_home?: string | null - phone_work?: string | null - pager?: string | null - pager_email?: string | null - address?: string | null - notes?: string | null -} \ No newline at end of file diff --git a/lib/src/types/animal.ts b/lib/src/types/animal.ts new file mode 100644 index 0000000..c00e292 --- /dev/null +++ b/lib/src/types/animal.ts @@ -0,0 +1,18 @@ +import { Entity } from '../entity' + +export interface Animal extends Entity { + id: number; + name: string; + breed: string; + type: string; + countRollingHours: number; + ref: string; + notes: string; + status: string; + resourceType: string; + bornAt: string; + joinedAt: string; + leftAt: string | null; + createdAt: string; + updatedAt: string; +} \ No newline at end of file diff --git a/lib/src/customField.ts b/lib/src/types/customField.ts similarity index 100% rename from lib/src/customField.ts rename to lib/src/types/customField.ts diff --git a/lib/src/emergencyContacts.ts b/lib/src/types/emergencyContacts.ts similarity index 100% rename from lib/src/emergencyContacts.ts rename to lib/src/types/emergencyContacts.ts diff --git a/lib/src/events.ts b/lib/src/types/events.ts similarity index 51% rename from lib/src/events.ts rename to lib/src/types/events.ts index c793bd3..de96c41 100644 --- a/lib/src/events.ts +++ b/lib/src/types/events.ts @@ -1,14 +1,3 @@ -export interface Incident { - id: number, - ref_desc: string, - date: string, - enddate?: string, - description?: string, - lat?: number, - lng?: number, - tags?: string[], -} - export interface IncidentRoster { id: number, status: string, diff --git a/lib/src/types/group.ts b/lib/src/types/group.ts new file mode 100644 index 0000000..b625bce --- /dev/null +++ b/lib/src/types/group.ts @@ -0,0 +1,11 @@ +import { Entity } from '../entity' + +export interface memberGroup extends Entity{ + id: number; + title: string; + deprecatedBundle: string; + membershipResourceType: string; + resourceType: string; + createdAt: string; + updatedAt: string; +} \ No newline at end of file diff --git a/lib/src/types/incident.ts b/lib/src/types/incident.ts new file mode 100644 index 0000000..e8741ac --- /dev/null +++ b/lib/src/types/incident.ts @@ -0,0 +1,72 @@ +import { Entity } from '../entity' + +export interface IncidentOwner { + resourceType: string; + id: number; +} + +export interface IncidentLocation { + type: string; + coordinates: [number, number]; +} + +export interface WeatherInfo { + symbol: string | null; + symbolDate: string | null; + temperature: number | null; +} + +export interface AddressInfo { + postCode: string; + region: string; + street: string; + town: string; + country: string; +} + +export interface IncidentLocationBookmark { + id: number | null; + resourceType: string; +} + +export interface IncidentTag { + id: number; + resourceType: string; +} + +export interface Incident extends Entity{ + id: number; + owner: IncidentOwner; + resourceType: string; + reference: string; + referenceDescription: string; + bearing: number; + coordinator: string | null; + countAttendance: number; + countGuests: number; + createdAt: string; + createdOrPublishedAt: string; + description: string; + descriptionDeprecated: string; + distance: number; + night: boolean; + percAttendance: number; + plan: string | null; + planDeprecated: string | null; + published: boolean; + approved: boolean; + shared: boolean; + trackingNumber: string | null; + updatedAt: string; + startsAt: string; + endsAt: string; + weather: WeatherInfo; + weatherPressure: number | null; + weatherCloudCover: number | null; + address: AddressInfo; + location: IncidentLocation; + locationBookmark: IncidentLocationBookmark; + fullTeam: boolean; + selfCoordinator: boolean; + tags: IncidentTag[]; +} diff --git a/lib/src/types/member.ts b/lib/src/types/member.ts new file mode 100644 index 0000000..9071cb3 --- /dev/null +++ b/lib/src/types/member.ts @@ -0,0 +1,156 @@ +import { Entity } from '../entity' + +export interface MemberStatus { + id: number + type: string + value: string + label: MemberStatusLabel | null +} + +export interface MemberStatusLabel { + id: number + value: string +} + +export interface CustomMemberStatus { + id: number | null + resourceType: string +} + +export interface EquipmentLocation { + id: number | null + resourceType: string +} + +export interface EmailInfo { + value: string + verified: boolean +} + +export interface PhoneInfo { + phone: string + verified?: boolean +} + +export interface PrimaryEmergencyContact { + name: string + primaryPhone: string + secondaryPhone: string + relation: string +} + +export interface SecondaryEmergencyContact { + name: string + primaryPhone: string + secondaryPhone: string + relation: string +} + +export interface RetiredReason { + id: number | null + resourceType: string +} + +export interface Role { + id: number | null + resourceType: string +} + +export interface MemberLocationBookmark { + id: number | null + resourceType: string +} + +export interface Location { + type: string + coordinates: [number, number] +} + +export interface Member extends Entity { + id: number + name: string + ref: string + status: string + position: string + createdAt: string + updatedAt: string + startsAt: string | null + endsAt: string | null + lastLogin: string | null + weeklyDayOfWeek: number + weeklyDayOfWeekUtc: number + weeklyHourOfDay: number + weeklyHourOfDayUtc: number + email: EmailInfo + home: PhoneInfo + mobile: PhoneInfo + work: PhoneInfo + pager: PhoneInfo + notes: string | null + permission: number + credits: number + defaultDuty: string + defaultEquipmentLocation: EquipmentLocation + customStatus: CustomMemberStatus + location: Location + locationBookmark: MemberLocationBookmark + retiredReason: RetiredReason + role: Role + primaryEmergencyContact: PrimaryEmergencyContact + secondaryEmergencyContact: SecondaryEmergencyContact + alertActivityApproval: boolean + alertAllQualifications: boolean + alertGear: boolean + alertQualifications: boolean + chatAutosubscribe: boolean + chatDailyDigest: boolean + contactUpdateMail: boolean + weeklyMail: boolean + deprecatedAddress: string | null + icalSecret: string | null + costPerHour: number | null + costPerUse: number | null + countReportingEvent: number + countReportingExercise: number + countReportingHours: number + countReportingIncident: number + countRollingHours: number + countRollingHoursEvent: number + countRollingHoursExercise: number + countRollingHoursIncident: number + percReportingEvent: number + percReportingExercise: number + percReportingIncident: number + percRollingEvent: number + percRollingExercise: number + percRollingIncident: number + signedTandC: string | null + teamAgreementSigned: string | null +} + +export interface MemberUpdate { + name?: string | null + ref?: string | null + id_tag?: string | null + status_id?: number + status_custom_id?: number + retired_reason_id?: number + date_leave?: Date + date_join?: Date + position?: string | null + role_id?: number + cost_per_hour?: number + cost_per_use?: number + lat?: number + lng?: number + gridref?: string | null + location_bookmark_id?: number + email?: string | null + phone_mobile?: string | null + phone_home?: string | null + phone_work?: string | null + pager?: string | null + pager_email?: string | null + address?: string | null + notes?: string | null +} \ No newline at end of file diff --git a/lib/src/types/qualification.ts b/lib/src/types/qualification.ts new file mode 100644 index 0000000..0c7602a --- /dev/null +++ b/lib/src/types/qualification.ts @@ -0,0 +1,32 @@ +import { Entity } from '../entity' + +export interface Resource { + resourceType: string; + id: number; +} + +export interface Qualification extends Entity { + id: number, + cost: number | null, + createdAt: string, + description: string, + expiredCost: null, + reminderDays: number, + title: string, + updatedAt: string, + resourceType: string, + deprecatedBundle: string, + expiresMonthsDefault: number | null, +} + +export interface MemberAwards extends Entity { + id: number; + createdAt: string; + updatedAt: string; + resourceType: string; + startsAt: string | null; + endsAt: string | null; + owner: Resource; + member: Resource; + qualification: Resource; +} \ No newline at end of file diff --git a/test/index.ts b/test/index.ts index 66dd21e..4ebc58e 100644 --- a/test/index.ts +++ b/test/index.ts @@ -31,7 +31,9 @@ let main = async function() { if (testGetMembers) { try { - const members = await api.getMembersAsync(getMembersOptions) + const context = 'team' + const contextId = 1234 + const members = await api.getMembersAsync(context, contextId, getMembersOptions) console.log(`Retrieved ${members.length} members.`) } catch (err) { console.log(JSON.stringify(err)) @@ -41,7 +43,9 @@ let main = async function() { if (testGetGroups) { try { - const groups = await api.getGroupsAsync() + const context = 'team' + const contextId = 1234 + const groups = await api.getGroupsAsync(context, contextId) console.log(`Retrieved ${groups.length} groups.`) } catch (err) { console.log(JSON.stringify(err)) @@ -51,8 +55,10 @@ let main = async function() { if (testGetMember) { try { + const context = 'team' + const contextId = 1234 const memberId = 103636 - const member = await api.getMemberAsync(memberId, { includeDetails: true }) + const member = await api.getMemberAsync(context, contextId, memberId, { includeDetails: true }) console.log(`Retrieved single member: ${member.name}`) // Only execute update code on an instance where that's OK.