diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js index 1f7aee5..b33704d 100644 --- a/docs/assets/navigation.js +++ b/docs/assets/navigation.js @@ -1 +1 @@ -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 +window.navigationData = "eJyN1F1PwjAUBuC/QnZNRDGShTtC1JBgjESuCCGlK+zEfixtpxjDf7eu7AvpGbc973l2tp1t9RNZdrDROJpJYwnnIPdRP8qITd1ZomgumLRmUFdvUiu4i3yATKJxfB/Ho9v42K+cpXGhnk1Zbw5bTfT3Ja4IbVxocwp1qY8HIjLOzCWsrHUZUyWthm1uA/fYrHdZ7pgdakSoJHcTDIrjdu+wH9EUeKKZjMarCphQqnJ31dqgnBhTGWW9jd0Nm0NMqIVPsMAQpUygjgRBeBjxZUyY5sYq8QSMJ0GmmcGshO1Izm2IOZUx4VmrPAvO4atY/0xSSBjycqoAprwwsWU6aJzKmPCq90SCIRaUDDqtEKa95YTDDijOtVOYt1A8vHhFEet+Z0QEu4ti98bW7SAt0ztCz3b27Et8GF1eWcRppDBs/7dTpzeaQoaAZ0kMLbcM0crINcxCGdd9BeaDGDlXfj8QrIxgjH8MCOID3cTki+jmjycA+RjGiSJX/CEQrZHqnm2ZJcSyztl8DONaXybitXL/wfVx/Qu4KLXE" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 90aecf7..1c4a16f 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "eJytfVGX2zaS9X+xX70eoUCRUt488ezMnDOzky/J7D7k5OjQErtbG7XUoSg73pz8948ESalQuCCLVD8lbgF1QeCiANQtkL+/KU9fzm+++en3N7/sj7s336zevTnmz8Wbb958ezlXp+f/3BeH3Y9fX4o3795cykP99+J4eT7/Sfz6/ql6PtRFtof8fC5qg2/e/PGut2nSq9H/ujx/KkqFrbfHviQz+e7NS14Wxwq0DqL9WPxWabCqttwdSB/zStNDb3dtualItEzRuFwR98eqKB/ybeHBDg/KgpKrzb3K1FtXbLTtMZCKs2gIpis4G+iQfyoOKqS+5Gyoz/nhUmzOVbk/PqoQRYX7gPWI90B9uhx3Bx3WtehssOeimfabYrevNqcvRxVqWGcKfGRu/ftlx+c0xm8LveI8YwaVs61r5x004ZhqsgSwlm7OMPnb5s8ffvjL5t/f/+OK/Tkv9/mnQw3Nfx7sOj4yfy2qf7ph/tdLtT8dz+iZZJkJ43LcHi674mNR5fuD3vbbrt7uWg/3W9D4kWc8ax7yPPkpd8WhqApIQWz17a3GyIOdwycTxN9UOfSQEeRrhTuB3X/0sF3xO0FP5Y5tcsZR+/J3wr7kj1OetSt+J+h5/39TQLvi94KeymoKaFv8XtAqry5N/QnAtyp3gldF/rzBy0cE+1ZjOrTwSh+O++f8MOKV/EJ6r/SUN3uGctOt4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/rDSk/lChTx4S5S+XtePlwGGUqcWuxuXV4eqjteub4/lkZWRHmZAP5mqPMqG0thpfPualM5wxkPJS/qMEsFQeEn9+9edm/FId9faj65qef//jj/wMyRrXG"; \ No newline at end of file +window.searchData = "eJy1XVuT47ax/iup8etkowbv+7bZ9UlclRw7TnzOw5ZLxZE4MzyWxDFF7XrK5f9+CICkGo2m2BQ1T3sR+kLg6wbQH0D+fldXX4937z//fvdLedjevU+DNI1X6f3dId8Xd+/vvjscm3y3Kw9Pd/d3p3rX/te22pz2xaE5/uX847vnZr9rW2x2+fFYtArv7v64H9P507GV+FPzXPzpH+VDndevjGrTZt22WXdtZln49rd8/7JrW/mK+59m6ftYHZq6fDg1fD/gny/qVYPG9p/Fb4OqfbU9tT79xfzvRQ2gzl79p8j350fsmnc6zG+Mpvu7l7xunR5cOKuO4OzepmqHtj5tmqqeNPCN2/iCMSuE+2MVnh/nqWj079P22oaNbTjHFu657+un/FAe86ZsXR8x6LR5y570Dc3oUfdJxnsWt5P70QpWruA1vuCe/9cp35WP5eZi17uN3rLvGUszOp88zHjv/7PYPxS103yGQ62CvVHwK1HwVr7NGJcR54638u7DodznuwU9lxsFb9JzjG8ze45x7mY99/f8sN0tAt2z1fAmfcd5N7PzOPdu1ns2Kj58zevtVdGQ95JXeYMzpvVkzInu17fMkdjEjOTY+z3VxxKrQ7feyKakN89Gp4ZxwurpZZs3hfxhbfsrnxcj57vDptzqBeqI1eH3t0SPa2QGfs7ej49m30ZmuxUozwK3si3rXWx8Ck+cdTyuf6ur08uYWfvjW44osjBjODunpyLTNBMYHoLzqRO4lW1BvxLjU8M5x3oX0M/lFX7sHdlZHmF02VXNmPnu17fEFzYxA2C931PrNYnVYWl2I5uS3jwbnRo+3yoev4+nY1Pt/6ssdqMrF9zkLUfSszNjOJ3HuDizXvPA3SS7Mf//2Ite4Q/u+R8rXHJyPTC/vWVfnw3M6GTr8S32rcj8VdtV6omTkTab6jQ+0fY/v2lOwjbmJKXe9ZE+/vpcfd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ewmHXLIv+VmdRFzTXhzjmhcuMQdMo++aUH2XTb13stXi9zV/J+hMneWH9ZvhYGK4e4+AQbmRGV4soj/QngWFgoIaQyYbVjGwSrYtGU0XrusiP7SaH7G1w1RqEFZJOo1XoZGg8RMI1nP2aHopjHC+rYfciC0OtzHtCDMYZetyyMq5uyMLtWLRZajuVtZwwliomnyLHuQvnfuFhrONzXtMUiI+0CavIx/LpUGybdh7ZuAsADArh4ZFjk9cNpX7x4nso9/XBIKSE/PMomJNMh+zX6VfCYxxW7bo7CUQB6FTk5/jpacIrICHdbD8fj2tAOGUJiSpdh8+f6qLQ/2sH2nUMB60wL2mdjmdoPpItZ5tnJ3PgUJLJlw05NIJUxP3mLJHBv6nzzS/tIvhwovUZwFUqJSRs6eSAOfiog2nSo1S4n7BVhdEzXsiC8Ew/+u4x6kQ0jv16pz+hAcPxtyHUoI9g4W2c7tS5z3U6dxJkqo70fsRcBH3Jdyd3mFA2EVJLRsf62NDLGpgrEK4svhZ5GxMEfLjkK6RtOz2bXXXabqovVCOu1AipnU6jrpQdT7W7WsQFJSWsvX0til92r+2yrnrUf3XSCAJCJvXO0XZqnBkMcwmZbP1gFepjt9Vjq9bRhsZDyAARbdQ91H2ZDPhWoVfxWeEsLoXKc5XvSyePoBAQzlFWSb5zj86gdYNw1qT7abw6l+wYfr6/eylfil15aEU+//zHH/8PpK2ZwQ=="; \ No newline at end of file diff --git a/docs/classes/default.html b/docs/classes/default.html deleted file mode 100644 index 2d0e988..0000000 --- a/docs/classes/default.html +++ /dev/null @@ -1,25 +0,0 @@ -default | d4h-typescript

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/classes/index.Accounts.html b/docs/classes/index.Accounts.html new file mode 100644 index 0000000..82a741f --- /dev/null +++ b/docs/classes/index.Accounts.html @@ -0,0 +1,12 @@ +Accounts | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +

    Returns Promise<WhoAmIType>

      +
    • Access details of credentials for a specific context
    • +
    +
  • Returns Promise<WhoAmIType>

      +
    • Access details of credentials for all available contexts
    • +
    +
diff --git a/docs/classes/index.Activities.html b/docs/classes/index.Activities.html new file mode 100644 index 0000000..6959555 --- /dev/null +++ b/docs/classes/index.Activities.html @@ -0,0 +1,27 @@ +Activities | d4h-typescript

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • attendanceId: number

      The numeric identifier for a resource

      +

    Returns Promise<Activity>

      +
    • An animal item
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          activity_id?: number | number[];
          activity_resource_type?: string;
          deleted?: boolean;
          ends_after?: string;
          ends_before?: string;
          id?: number | number[];
          member_id?: number | number[];
          order?: "asc" | "desc";
          page?: number;
          role_id?: number | number[];
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          starts_after?: string;
          starts_before?: string;
          status?: string;
      }
      • Optionalactivity_id?: number | number[]

        One or more activity resource identifiers

        +
      • Optionalactivity_resource_type?: string

        One or more attendance statuses

        +
      • Optionaldeleted?: boolean

        Return only attendances from deleted activities

        +
      • Optionalends_after?: string

        Return only resources ending after this datetime

        +
      • Optionalends_before?: string

        Return only resources ending before this datetime

        +
      • Optionalid?: number | number[]

        A list of ids

        +
      • Optionalmember_id?: number | number[]

        One or more member resource identifiers

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalrole_id?: number | number[]

        One or more role resource identifiers

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionalstarts_after?: string

        Return only resources starting after this datetime

        +
      • Optionalstarts_before?: string

        Return only resources starting before this datetime

        +
      • Optionalstatus?: string

        One or more attendance statuses

        +

    Returns Promise<Activity[]>

diff --git a/docs/classes/index.Animals.html b/docs/classes/index.Animals.html new file mode 100644 index 0000000..1245c55 --- /dev/null +++ b/docs/classes/index.Animals.html @@ -0,0 +1,23 @@ +Animals | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • animalId: number | "me"

      An animal id

      +

    Returns Promise<Animal>

      +
    • An animal item
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          handler_member_id?: number | number[];
          id?: number | number[];
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          status?: "NON_OPERATIONAL" | "OPERATIONAL";
          team_id?: number;
      }
      • Optionalhandler_member_id?: number | number[]

        The member id or ids of the animal's handler(s)

        +
      • Optionalid?: number | number[]

        A list of ids

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionalstatus?: "NON_OPERATIONAL" | "OPERATIONAL"

        The status of the animal

        +
      • Optionalteam_id?: number

        The numeric identifier for a resource

        +

    Returns Promise<Animal[]>

      +
    • A list of animals
    • +
    +
diff --git a/docs/classes/index.CustomFields.html b/docs/classes/index.CustomFields.html new file mode 100644 index 0000000..06ba17c --- /dev/null +++ b/docs/classes/index.CustomFields.html @@ -0,0 +1,3 @@ +CustomFields | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • entity: Entity
    • updates: { id: number; value: null | string }[]
    • onlyMemberEditOwn: boolean

    Returns Promise<void>

diff --git a/docs/classes/index.Groups.html b/docs/classes/index.Groups.html new file mode 100644 index 0000000..43f642d --- /dev/null +++ b/docs/classes/index.Groups.html @@ -0,0 +1,33 @@ +Groups | d4h-typescript

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • groupId: number

      A group identifier

      +

    Returns Promise<memberGroup>

      +
    • A member group
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          group_id?: number | number[];
          id?: number | number[];
          member_id?: number | number[];
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          team_id?: number | number[];
      }
      • Optionalgroup_id?: number | number[]

        One or more group identifiers

        +
      • Optionalid?: number | number[]

        A list of ids

        +
      • Optionalmember_id?: number | number[]

        One or more member identifiers

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionalteam_id?: number | number[]

        One or more team identifiers

        +

    Returns Promise<groupMembership[]>

      +
    • A list of member group memberships
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          id?: number;
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          team_id?: number | number[];
          title?: string;
      }
      • Optionalid?: number

        A list of ids

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionalteam_id?: number | number[]

        One or more team identifiers

        +
      • Optionaltitle?: string

        A simple text search term, compared against the title

        +

    Returns Promise<memberGroup[]>

diff --git a/docs/classes/index.Incidents.html b/docs/classes/index.Incidents.html new file mode 100644 index 0000000..b068744 --- /dev/null +++ b/docs/classes/index.Incidents.html @@ -0,0 +1,30 @@ +Incidents | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • activityId: number

      An activity identifier

      +

    Returns Promise<Incident>

      +
    • An incident
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          after?: string;
          before?: string;
          deleted?: boolean;
          ends_before?: string;
          id?: number | number[];
          order?: "asc" | "desc";
          page?: number;
          published?: boolean;
          reference?: string;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          starts_after?: string;
          tag_bundle_id?: number;
          tag_id?: number;
          team_id?: number;
      }
      • Optionalafter?: string

        Return only activities ending after this datetime

        +
      • Optionalbefore?: string

        Return only activities starting before this datetime

        +
      • Optionaldeleted?: boolean

        Return only deleted activities

        +
      • Optionalends_before?: string

        Return only activities ending before this datetime

        +
      • Optionalid?: number | number[]

        A list of ids

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalpublished?: boolean

        Return only published activities

        +
      • Optionalreference?: string

        A simple text search term, compared against the reference and reference description

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionalstarts_after?: string

        Return only activities starting after this datetime

        +
      • Optionaltag_bundle_id?: number

        Return only activities with this tag bundle id

        +
      • Optionaltag_id?: number

        Return only activities with this tag id

        +
      • Optionalteam_id?: number

        Return only activities with this team id

        +

    Returns Promise<Incident[]>

      +
    • A list of incidents
    • +
    +
diff --git a/docs/classes/index.Members.html b/docs/classes/index.Members.html new file mode 100644 index 0000000..8969b1b --- /dev/null +++ b/docs/classes/index.Members.html @@ -0,0 +1,24 @@ +Members | d4h-typescript

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • id: number | "me"

      Member the resource belongs to. Either an id or "me"

      +
    • Optionaloptions: { includeDetails?: boolean }

    Returns Promise<Member>

      +
    • A member
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          deleted?: boolean;
          id?: number | number[];
          id_tag?: string;
          name?: string;
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          statuses?: (null | number)[];
          team_id?: number;
      }
      • Optionaldeleted?: boolean

        Return only deleted members

        +
      • Optionalid?: number | number[]

        A list of ids

        +
      • Optionalid_tag?: string

        RFID tag or barcode

        +
      • Optionalname?: string

        The member's name

        +
      • Optionalorder?: "asc" | "desc"
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"
      • Optionalstatuses?: (null | number)[]

        One or more member statuses. Some statuses require extra permissions.

        +
      • Optionalteam_id?: number

        The numeric identifier for a resource

        +

    Returns Promise<Member[]>

      +
    • A list of members
    • +
    +
  • Parameters

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

    Returns Promise<void>

diff --git a/docs/classes/index.Organisations.html b/docs/classes/index.Organisations.html new file mode 100644 index 0000000..a5a6080 --- /dev/null +++ b/docs/classes/index.Organisations.html @@ -0,0 +1,9 @@ +Organisations | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • organisationId: number

      An organisation's id

      +

    Returns Promise<
        {
            country: string;
            createdAt: string;
            custom_fields?: CustomField[];
            entityType: EntityType;
            id: number;
            resourceType: string;
            timezone: string;
            title: string;
            updatedAt: string;
        },
    >

      +
    • A organisation
    • +
    +
diff --git a/docs/classes/index.Qualifications.html b/docs/classes/index.Qualifications.html new file mode 100644 index 0000000..6d02d56 --- /dev/null +++ b/docs/classes/index.Qualifications.html @@ -0,0 +1,82 @@ +Qualifications | d4h-typescript

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • qualificationId: number

      The qualification's id

      +
    • Optionaloptions: { exclude_org_data?: boolean; exclude_teams_data?: boolean }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +

    Returns Promise<Qualification>

      +
    • An animal qualification
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          exclude_org_data?: boolean;
          exclude_teams_data?: boolean;
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          title?: string;
      }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionaltitle?: string

        The title of a resource

        +

    Returns Promise<Qualification[]>

      +
    • A list of animal qualifications
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • qualificationId: number

      The qualification's id

      +
    • Optionaloptions: { exclude_org_data?: boolean; exclude_teams_data?: boolean }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +

    Returns Promise<Qualification>

      +
    • An animal qualification
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          exclude_org_data?: boolean;
          exclude_teams_data?: boolean;
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          title?: string;
      }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionaltitle?: string

        The title of a resource

        +

    Returns Promise<Qualification[]>

      +
    • A list of animal qualifications
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          exclude_org_data?: boolean;
          exclude_teams_data?: boolean;
          member_id?: number | "me";
          order?: "asc" | "desc";
          page?: number;
          qualification_id?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
      }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +
      • Optionalmember_id?: number | "me"

        Qualified member. Either an id or "me"

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalqualification_id?: number

        The qualification's id

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +

    Returns Promise<MemberAwards[]>

      +
    • A list of member qualification awards
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • qualificationId: number | "me"

      The qualification's id

      +
    • Optionaloptions: { exclude_org_data?: boolean; exclude_teams_data?: boolean }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +

    Returns Promise<Qualification>

      +
    • A member qualification
    • +
    +
  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • Optionaloptions: {
          exclude_org_data?: boolean;
          exclude_teams_data?: boolean;
          order?: "asc" | "desc";
          page?: number;
          size?: number;
          sort?: "createdAt" | "id" | "updatedAt";
          title?: string;
      }
      • Optionalexclude_org_data?: boolean

        Team context: Exclude entities inherited from the team's org

        +
      • Optionalexclude_teams_data?: boolean

        Organisation context: Exclude entities belonging to accessible teams

        +
      • Optionalorder?: "asc" | "desc"

        Default: "asc"

        +
      • Optionalpage?: number

        Page number

        +
      • Optionalsize?: number

        Items per page

        +
      • Optionalsort?: "createdAt" | "id" | "updatedAt"

        Default: "id"

        +
      • Optionaltitle?: string

        The title of a resource

        +

    Returns Promise<Qualification[]>

      +
    • A list of member qualifications
    • +
    +
diff --git a/docs/classes/index.Roles.html b/docs/classes/index.Roles.html new file mode 100644 index 0000000..1758061 --- /dev/null +++ b/docs/classes/index.Roles.html @@ -0,0 +1,9 @@ +Roles | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • roleId: number | "me"

      A role id

      +

    Returns Promise<Role>

      +
    • A role
    • +
    +
diff --git a/docs/classes/index.Teams.html b/docs/classes/index.Teams.html new file mode 100644 index 0000000..53b292b --- /dev/null +++ b/docs/classes/index.Teams.html @@ -0,0 +1,9 @@ +Teams | d4h-typescript

Constructors

Methods

Constructors

Methods

  • Parameters

    • context: "team" | "organisation" | "admin"

      The point of view from where the request takes place

      +
    • contextId: number

      Either a team, organisation or admin's id

      +
    • teamId: number

      A team's id

      +

    Returns Promise<
        {
            country: string;
            createdAt: string;
            custom_fields?: CustomField[];
            deletedAt: null;
            entityType: EntityType;
            id: number;
            location: { coordinates: [number, number]; type: string };
            memberCounts: { operational: number; total: number };
            overview: string;
            owner: { id: null | number; resourceType: null | string };
            resourceType: string;
            subdomain: string;
            timezone: string;
            title: string;
            updatedAt: string;
        },
    >

      +
    • A team
    • +
    +
diff --git a/docs/classes/index.default.html b/docs/classes/index.default.html new file mode 100644 index 0000000..9bf2c4a --- /dev/null +++ b/docs/classes/index.default.html @@ -0,0 +1,3 @@ +default | d4h-typescript

Constructors

Accessors

Constructors

Accessors

  • get request(): D4HRequest
  • Returns D4HRequest

diff --git a/docs/documents/Contributing.html b/docs/documents/Contributing.html new file mode 100644 index 0000000..f212df5 --- /dev/null +++ b/docs/documents/Contributing.html @@ -0,0 +1,8 @@ +Contributing | d4h-typescript

Contributing

Documentation is setup to be hosted on github pages, it is generated using typedoc.

+

Typedoc documentation can be found here: https://typedoc.org/

+

The files for the guides are located in the documentation folder, they are written in markdown

+

To update the typedoc generated documentation for the module, run the following commands in the root of the repo:

+
npm install # Install only needs to be run first time.
+npm run docs
+
+
diff --git a/docs/documents/Examples.html b/docs/documents/Examples.html new file mode 100644 index 0000000..e2842ea --- /dev/null +++ b/docs/documents/Examples.html @@ -0,0 +1 @@ +Examples | d4h-typescript

Examples

diff --git a/docs/documents/Installing.html b/docs/documents/Installing.html new file mode 100644 index 0000000..8d41c28 --- /dev/null +++ b/docs/documents/Installing.html @@ -0,0 +1,17 @@ +Installing | d4h-typescript

Installing

This library is not in NPM. As a result, you need to add it to your project and build it locally.

+

To do so, you have three options:

+
    +
  • Add the repository to the consuming repository as a Git submodule.
  • +
  • Clone the repository locally.
  • +
  • Copy the files locally, without maintaining a Git repository.
  • +
+

Regardless of which option you choose, the following steps all apply.

+

Enter the lib directory for the library and run the following commands:

+
npm install
+npm run build
+
+

In your project directory, run the following:

+
npm i /path/to/package/d4h-typescript/lib
+
+

Using a relative path will also work without issue.

+
diff --git a/docs/documents/Using_the_Library.html b/docs/documents/Using_the_Library.html new file mode 100644 index 0000000..0c51f9d --- /dev/null +++ b/docs/documents/Using_the_Library.html @@ -0,0 +1 @@ +Using the Library | d4h-typescript

Using the Library

diff --git a/docs/enums/CustomFieldType.html b/docs/enums/CustomFieldType.html deleted file mode 100644 index 2885f42..0000000 --- a/docs/enums/CustomFieldType.html +++ /dev/null @@ -1,4 +0,0 @@ -CustomFieldType | d4h-typescript

Enumeration CustomFieldType

Enumeration Members

Enumeration Members

Date: "date"
Number: "number"
Text: "text"
diff --git a/docs/index.html b/docs/index.html index 24c4f64..82383f5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,7 +27,7 @@

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.

-

To update typedoc docs after changes to code, run in the root of the repo:

+

To update typedoc docs after changes to code, run in the root of the repo:

npm install

npm run docs

-
+
diff --git a/docs/interfaces/AddressInfo.html b/docs/interfaces/AddressInfo.html deleted file mode 100644 index a59221c..0000000 --- a/docs/interfaces/AddressInfo.html +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index c171767..0000000 --- a/docs/interfaces/Animal.html +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 8eaaad5..0000000 --- a/docs/interfaces/CustomField.html +++ /dev/null @@ -1,8 +0,0 @@ -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
diff --git a/docs/interfaces/CustomFieldUpdate.html b/docs/interfaces/CustomFieldUpdate.html deleted file mode 100644 index b61d418..0000000 --- a/docs/interfaces/CustomFieldUpdate.html +++ /dev/null @@ -1,3 +0,0 @@ -CustomFieldUpdate | d4h-typescript

Interface CustomFieldUpdate

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

Properties

Properties

id: number
value: null | string
diff --git a/docs/interfaces/CustomMemberStatus.html b/docs/interfaces/CustomMemberStatus.html deleted file mode 100644 index 582d62c..0000000 --- a/docs/interfaces/CustomMemberStatus.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 1e2a3fc..0000000 --- a/docs/interfaces/EmailInfo.html +++ /dev/null @@ -1,3 +0,0 @@ -EmailInfo | d4h-typescript

Interface EmailInfo

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

Properties

Properties

value: string
verified: boolean
diff --git a/docs/interfaces/EquipmentLocation.html b/docs/interfaces/EquipmentLocation.html deleted file mode 100644 index 07ab1d6..0000000 --- a/docs/interfaces/EquipmentLocation.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 171566c..0000000 --- a/docs/interfaces/GetAnimalsOptions.html +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 271d861..0000000 --- a/docs/interfaces/GetGroupsOptions.html +++ /dev/null @@ -1,3 +0,0 @@ -GetGroupsOptions | d4h-typescript

Interface GetGroupsOptions

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

Properties

Properties

memberId?: number
title?: string
diff --git a/docs/interfaces/GetIncidentOptions.html b/docs/interfaces/GetIncidentOptions.html deleted file mode 100644 index 3293690..0000000 --- a/docs/interfaces/GetIncidentOptions.html +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 7eb9ae0..0000000 --- a/docs/interfaces/GetMemberAwardsOptions.html +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 0506d96..0000000 --- a/docs/interfaces/GetMemberGroupsOptions.html +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 44c4aa7..0000000 --- a/docs/interfaces/GetMemberOptions.html +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 05be6a4..0000000 --- a/docs/interfaces/GetMembersOptions.html +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 82ea3f8..0000000 --- a/docs/interfaces/GetQualificationOptions.html +++ /dev/null @@ -1,8 +0,0 @@ -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/Incident.html b/docs/interfaces/Incident.html deleted file mode 100644 index 0c19d61..0000000 --- a/docs/interfaces/Incident.html +++ /dev/null @@ -1,37 +0,0 @@ -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

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 deleted file mode 100644 index 0cfedb8..0000000 --- a/docs/interfaces/IncidentLocation.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 6991e32..0000000 --- a/docs/interfaces/IncidentLocationBookmark.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 28976b1..0000000 --- a/docs/interfaces/IncidentOwner.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index e24ab09..0000000 --- a/docs/interfaces/IncidentRoster.html +++ /dev/null @@ -1,7 +0,0 @@ -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

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 deleted file mode 100644 index 7b4ef9a..0000000 --- a/docs/interfaces/IncidentTag.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 2428a72..0000000 --- a/docs/interfaces/Location.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index da79936..0000000 --- a/docs/interfaces/Member.html +++ /dev/null @@ -1,62 +0,0 @@ -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

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 deleted file mode 100644 index 7185bdf..0000000 --- a/docs/interfaces/MemberAwards.html +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index a409118..0000000 --- a/docs/interfaces/MemberLocationBookmark.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 558a414..0000000 --- a/docs/interfaces/MemberStatus.html +++ /dev/null @@ -1,5 +0,0 @@ -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
diff --git a/docs/interfaces/MemberStatusLabel.html b/docs/interfaces/MemberStatusLabel.html deleted file mode 100644 index 446b7b8..0000000 --- a/docs/interfaces/MemberStatusLabel.html +++ /dev/null @@ -1,3 +0,0 @@ -MemberStatusLabel | d4h-typescript

Interface MemberStatusLabel

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

Properties

Properties

id: number
value: string
diff --git a/docs/interfaces/MemberUpdate.html b/docs/interfaces/MemberUpdate.html deleted file mode 100644 index 5422fe0..0000000 --- a/docs/interfaces/MemberUpdate.html +++ /dev/null @@ -1,25 +0,0 @@ -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
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 deleted file mode 100644 index ca29557..0000000 --- a/docs/interfaces/PhoneInfo.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 03c8f5f..0000000 --- a/docs/interfaces/PrimaryEmergencyContact.html +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index ba8773e..0000000 --- a/docs/interfaces/Qualification.html +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index f653f7f..0000000 --- a/docs/interfaces/Resource.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 31f12f8..0000000 --- a/docs/interfaces/RetiredReason.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ea68613..0000000 --- a/docs/interfaces/Role.html +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 3d32437..0000000 --- a/docs/interfaces/SecondaryEmergencyContact.html +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 439809b..0000000 --- a/docs/interfaces/WeatherInfo.html +++ /dev/null @@ -1,4 +0,0 @@ -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/index.Animal.html b/docs/interfaces/index.Animal.html new file mode 100644 index 0000000..01efb1d --- /dev/null +++ b/docs/interfaces/index.Animal.html @@ -0,0 +1,17 @@ +Animal | d4h-typescript
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/index.CustomField.html b/docs/interfaces/index.CustomField.html new file mode 100644 index 0000000..9f06596 --- /dev/null +++ b/docs/interfaces/index.CustomField.html @@ -0,0 +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: unknown
id: number
label: string
member_edit_own: boolean
type: CustomFieldType
value: null | string
value_string: null | string
diff --git a/docs/interfaces/index.Incident.html b/docs/interfaces/index.Incident.html new file mode 100644 index 0000000..5ffad19 --- /dev/null +++ b/docs/interfaces/index.Incident.html @@ -0,0 +1,37 @@ +Incident | d4h-typescript

Interface Incident

interface Incident {
    address: {
        country: string;
        postCode: string;
        region: string;
        street: string;
        town: string;
    };
    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: { coordinates: [number, number]; type: string };
    locationBookmark: { id: null | number; resourceType: null | string };
    night: boolean;
    owner: { id: null | number; resourceType: null | string };
    percAttendance: number;
    plan: null | string;
    planDeprecated: null | string;
    published: boolean;
    reference: string;
    referenceDescription: string;
    resourceType: string;
    selfCoordinator: boolean;
    shared: boolean;
    startsAt: string;
    tags: { id: null | number; resourceType: null | string }[];
    trackingNumber: null | string;
    updatedAt: string;
    weather: {
        symbol: null | string;
        symbolDate: null | string;
        temperature: null | number;
    };
    weatherCloudCover: null
    | number;
    weatherPressure: null | number;
}

Hierarchy

  • Entity
    • Incident

Properties

address: {
    country: string;
    postCode: string;
    region: string;
    street: string;
    town: string;
}
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: { coordinates: [number, number]; type: string }
locationBookmark: { id: null | number; resourceType: null | string }
night: boolean
owner: { id: null | number; resourceType: null | string }
percAttendance: number
plan: null | string
planDeprecated: null | string
published: boolean
reference: string
referenceDescription: string
resourceType: string
selfCoordinator: boolean
shared: boolean
startsAt: string
tags: { id: null | number; resourceType: null | string }[]
trackingNumber: null | string
updatedAt: string
weather: {
    symbol: null | string;
    symbolDate: null | string;
    temperature: null | number;
}
weatherCloudCover: null | number
weatherPressure: null | number
diff --git a/docs/interfaces/index.IncidentRoster.html b/docs/interfaces/index.IncidentRoster.html new file mode 100644 index 0000000..509e728 --- /dev/null +++ b/docs/interfaces/index.IncidentRoster.html @@ -0,0 +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

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/index.Location.html b/docs/interfaces/index.Location.html new file mode 100644 index 0000000..936606c --- /dev/null +++ b/docs/interfaces/index.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/index.Member.html b/docs/interfaces/index.Member.html new file mode 100644 index 0000000..f544c3a --- /dev/null +++ b/docs/interfaces/index.Member.html @@ -0,0 +1,62 @@ +Member | d4h-typescript
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: { id: null | number; resourceType: null | string };
    defaultDuty: string;
    defaultEquipmentLocation: {
        id: null | number;
        resourceType: null | string;
    };
    deprecatedAddress: null
    | string;
    email: { value: string; verified: boolean };
    endsAt: null | string;
    entityType: EntityType;
    home: { phone: string; verified?: boolean };
    icalSecret: null | string;
    id: number;
    lastLogin: null | string;
    location: { coordinates: [number, number]; type: string };
    locationBookmark: { id: null | number; resourceType: null | string };
    mobile: { phone: string; verified?: boolean };
    name: string;
    notes: null | string;
    pager: { phone: string; verified?: boolean };
    percReportingEvent: number;
    percReportingExercise: number;
    percReportingIncident: number;
    percRollingEvent: number;
    percRollingExercise: number;
    percRollingIncident: number;
    permission: number;
    position: string;
    primaryEmergencyContact: {
        name: string;
        primaryPhone: string;
        relation: string;
        secondaryPhone: string;
    };
    ref: string;
    retiredReason: { id: null
    | number; resourceType: null | string };
    role: { id: null | number; resourceType: null | string };
    secondaryEmergencyContact: {
        name: string;
        primaryPhone: string;
        relation: string;
        secondaryPhone: string;
    };
    signedTandC: null
    | string;
    startsAt: null | string;
    status: string;
    teamAgreementSigned: null | string;
    updatedAt: string;
    weeklyDayOfWeek: number;
    weeklyDayOfWeekUtc: number;
    weeklyHourOfDay: number;
    weeklyHourOfDayUtc: number;
    weeklyMail: boolean;
    work: { phone: string; verified?: boolean };
}

Hierarchy

  • Entity
    • Member

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: { id: null | number; resourceType: null | string }
defaultDuty: string
defaultEquipmentLocation: { id: null | number; resourceType: null | string }
deprecatedAddress: null | string
email: { value: string; verified: boolean }
endsAt: null | string
entityType: EntityType
home: { phone: string; verified?: boolean }
icalSecret: null | string
id: number
lastLogin: null | string
location: { coordinates: [number, number]; type: string }
locationBookmark: { id: null | number; resourceType: null | string }
mobile: { phone: string; verified?: boolean }
name: string
notes: null | string
pager: { phone: string; verified?: boolean }
percReportingEvent: number
percReportingExercise: number
percReportingIncident: number
percRollingEvent: number
percRollingExercise: number
percRollingIncident: number
permission: number
position: string
primaryEmergencyContact: {
    name: string;
    primaryPhone: string;
    relation: string;
    secondaryPhone: string;
}
ref: string
retiredReason: { id: null | number; resourceType: null | string }
role: { id: null | number; resourceType: null | string }
secondaryEmergencyContact: {
    name: string;
    primaryPhone: string;
    relation: string;
    secondaryPhone: string;
}
signedTandC: null | string
startsAt: null | string
status: string
teamAgreementSigned: null | string
updatedAt: string
weeklyDayOfWeek: number
weeklyDayOfWeekUtc: number
weeklyHourOfDay: number
weeklyHourOfDayUtc: number
weeklyMail: boolean
work: { phone: string; verified?: boolean }
diff --git a/docs/interfaces/index.MemberAwards.html b/docs/interfaces/index.MemberAwards.html new file mode 100644 index 0000000..8f942c1 --- /dev/null +++ b/docs/interfaces/index.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: { id: null | number; resourceType: null | string };
    owner: { id: null | number; resourceType: null | string };
    qualification: { id: null | number; resourceType: null | string };
    resourceType: string;
    startsAt: null | string;
    updatedAt: string;
}

Hierarchy

  • Entity
    • MemberAwards

Properties

createdAt: string
custom_fields?: CustomField[]
endsAt: null | string
entityType: EntityType
id: number
member: { id: null | number; resourceType: null | string }
owner: { id: null | number; resourceType: null | string }
qualification: { id: null | number; resourceType: null | string }
resourceType: string
startsAt: null | string
updatedAt: string
diff --git a/docs/interfaces/index.MemberUpdate.html b/docs/interfaces/index.MemberUpdate.html new file mode 100644 index 0000000..ce95fa3 --- /dev/null +++ b/docs/interfaces/index.MemberUpdate.html @@ -0,0 +1,25 @@ +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
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/index.Qualification.html b/docs/interfaces/index.Qualification.html new file mode 100644 index 0000000..4a27740 --- /dev/null +++ b/docs/interfaces/index.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/index.groupMembership.html b/docs/interfaces/index.groupMembership.html new file mode 100644 index 0000000..c994d1e --- /dev/null +++ b/docs/interfaces/index.groupMembership.html @@ -0,0 +1,8 @@ +groupMembership | d4h-typescript

Interface groupMembership


+
interface groupMembership {
    custom_fields?: CustomField[];
    entityType: EntityType;
    group: { id: null | number; resourceType: null | string };
    id: number;
    member: { id: null | number; resourceType: null | string };
    owner: { id: null | number; resourceType: null | string };
}

Hierarchy

  • Entity
    • groupMembership

Properties

custom_fields?: CustomField[]
entityType: EntityType
group: { id: null | number; resourceType: null | string }
id: number
member: { id: null | number; resourceType: null | string }
owner: { id: null | number; resourceType: null | string }
diff --git a/docs/interfaces/index.memberGroup.html b/docs/interfaces/index.memberGroup.html new file mode 100644 index 0000000..a451b3a --- /dev/null +++ b/docs/interfaces/index.memberGroup.html @@ -0,0 +1,11 @@ +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/interfaces/memberGroup.html b/docs/interfaces/memberGroup.html deleted file mode 100644 index a98b2e1..0000000 --- a/docs/interfaces/memberGroup.html +++ /dev/null @@ -1,10 +0,0 @@ -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 94f72e8..e7a5ffc 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1 +1 @@ -d4h-typescript

d4h-typescript

Enumerations

CustomFieldType

Classes

default

Interfaces

AddressInfo
Animal
CustomField
CustomFieldUpdate
CustomMemberStatus
EmailInfo
EquipmentLocation
GetAnimalsOptions
GetGroupsOptions
GetIncidentOptions
GetMemberAwardsOptions
GetMemberGroupsOptions
GetMemberOptions
GetMembersOptions
GetQualificationOptions
Incident
IncidentLocation
IncidentLocationBookmark
IncidentOwner
IncidentRoster
IncidentTag
Location
Member
MemberAwards
memberGroup
MemberLocationBookmark
MemberStatus
MemberStatusLabel
MemberUpdate
PhoneInfo
PrimaryEmergencyContact
Qualification
Resource
RetiredReason
Role
SecondaryEmergencyContact
WeatherInfo

Variables

D4H_BASE_URL
+d4h-typescript

d4h-typescript

Modules

index

Contributing

Contributing

Examples

Examples

Installing

Installing

Using

Using the Library
diff --git a/docs/modules/index.html b/docs/modules/index.html new file mode 100644 index 0000000..48423d8 --- /dev/null +++ b/docs/modules/index.html @@ -0,0 +1 @@ +index | d4h-typescript

Classes

Accounts
Activities
Animals
CustomFields
default
Groups
Incidents
Members
Organisations
Qualifications
Roles
Teams

Interfaces

Animal
CustomField
groupMembership
Incident
IncidentRoster
Location
Member
MemberAwards
memberGroup
MemberUpdate
Qualification
diff --git a/docs/variables/D4H_BASE_URL.html b/docs/variables/D4H_BASE_URL.html deleted file mode 100644 index 5c7e437..0000000 --- a/docs/variables/D4H_BASE_URL.html +++ /dev/null @@ -1 +0,0 @@ -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/documents/contributing.md b/documents/contributing.md new file mode 100644 index 0000000..fb27c55 --- /dev/null +++ b/documents/contributing.md @@ -0,0 +1,23 @@ +--- +title: Contributing +group: Contributing +--- + +# Contributing + +## Updating Documentation + +Documentation is setup to be hosted on github pages, it is generated using typedoc. + +Typedoc documentation can be found here: + +### Guides + +The files for the guides are located in the documentation folder, they are written in markdown + +### Module Documentation + +To update the typedoc generated documentation for the module, run the following commands in the root of the repo: + + npm install # Install only needs to be run first time. + npm run docs \ No newline at end of file diff --git a/documents/examples.md b/documents/examples.md new file mode 100644 index 0000000..d2e4048 --- /dev/null +++ b/documents/examples.md @@ -0,0 +1,6 @@ +--- +title: Examples +group: Examples +--- + +# Examples \ No newline at end of file diff --git a/documents/install.md b/documents/install.md new file mode 100644 index 0000000..fd43018 --- /dev/null +++ b/documents/install.md @@ -0,0 +1,33 @@ +--- +title: Installing +group: Installing +--- + +# Installing + +This library is not in NPM. As a result, you need to add it to your project and build it locally. + +## Adding library source to project + +To do so, you have three options: + +- Add the repository to the consuming repository as a Git submodule. +- Clone the repository locally. +- Copy the files locally, without maintaining a Git repository. + +Regardless of which option you choose, the following steps all apply. + +## Building the library + +Enter the lib directory for the library and run the following commands: + + npm install + npm run build + +## Installing the Library to Project + +In your project directory, run the following: + + npm i /path/to/package/d4h-typescript/lib + +Using a relative path will also work without issue. \ No newline at end of file diff --git a/documents/using.md b/documents/using.md new file mode 100644 index 0000000..18a9c10 --- /dev/null +++ b/documents/using.md @@ -0,0 +1,6 @@ +--- +title: Using the Library +group: Using +--- + +# Using the Library \ No newline at end of file diff --git a/lib/.eslintrc.json b/lib/.eslintrc.json index 3a19d7f..bc89c40 100644 --- a/lib/.eslintrc.json +++ b/lib/.eslintrc.json @@ -20,6 +20,7 @@ "plugins": [ "@typescript-eslint" ], + "ignorePatterns": ["d4hWebClient.ts"], "rules": { "indent": [ "error", diff --git a/lib/index.ts b/lib/index.ts index f84ef64..cfb743d 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,6 +1,17 @@ + import D4H from './src/d4h' export default D4H - +export { Teams, Organisations } from './src/d4h' +export { Qualifications } from './src/api/qualifications' +export { Members } from './src/api/members' +export { Incidents } from './src/api/incidents' +export { Groups } from './src/api/groups' +export { Animals } from './src/api/animals' +export { CustomFields } from './src/api/custom_fields' +export { Roles } from './src/api/roles' +export { Accounts } from './src/api/accounts' +export { Activities } from './src/api/activity' + export * from './src/types/customField' export * from './src/d4h' export * from './src/types/group' diff --git a/lib/src/api/accounts.ts b/lib/src/api/accounts.ts new file mode 100644 index 0000000..ebd0322 --- /dev/null +++ b/lib/src/api/accounts.ts @@ -0,0 +1,42 @@ +import D4HRequest from '../d4hRequest' +import D4H, { D4H_BASE_URL } from '../d4h' +import { WhoAmIType } from '../types/accounts' + +export class Accounts { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @returns - Access details of credentials for a specific context + */ + async whoAmI(context: 'admin' | 'organisation' | 'team', contextId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/whoami`) + + try { + const whoami = await this._request.getAsync(url) + return whoami + } catch (error) { + throw new Error('Data not found or improperly formatted.') + } + } + + /** + * @returns - Access details of credentials for all available contexts + */ + async whoAmIAll(): Promise { + const url = new URL(`${D4H_BASE_URL}/v3/whoami`) + + try { + const whoami = await this._request.getAsync(url) + return whoami + } catch (error) { + throw new Error('Data not found or improperly formatted.') + } + } +} \ No newline at end of file diff --git a/lib/src/api/activity.ts b/lib/src/api/activity.ts new file mode 100644 index 0000000..ec39d9a --- /dev/null +++ b/lib/src/api/activity.ts @@ -0,0 +1,143 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import D4H, { D4H_BASE_URL } from '../d4h' +import { Activity } from '../types/activity'; + + +/** @ignore @inline */ +export interface GetActivityAttendOptions { + activity_id?: number | number[]; + activity_resource_type?: string; + deleted?: boolean; + ends_after?: string; + ends_before?: string; + id?: number | number[]; + member_id?: number | number[]; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + role_id?: number | number[]; + size?: number; + sort?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + starts_after?: string; + starts_before?: string; + status?: string; // list of ids or null +} + +export class Activities { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param attendanceId - The numeric identifier for a resource + * @returns - An animal item + */ + async getActivityAttendance(context: 'admin' | 'organisation' | 'team', contextId: number, attendanceId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/attendance/${attendanceId}`) + + try { + const activity = await this._request.getAsync(url) + activity.entityType = EntityType.Activity + return activity + } catch (error) { + throw new Error('Attendance data not found or improperly formatted.') + } + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.activity_id - One or more activity resource identifiers + * @param options.activity_resource_type - One or more attendance statuses + * @param options.deleted - Return only attendances from deleted activities + * @param options.ends_after - Return only resources ending after this datetime + * @param options.ends_before - Return only resources ending before this datetime + * @param options.id - A list of ids + * @param options.member_id - One or more member resource identifiers + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.role_id - One or more role resource identifiers + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.starts_after - Return only resources starting after this datetime + * @param options.starts_before - Return only resources starting before this datetime + * @param options.status - One or more attendance statuses + */ + async getActivityAttendances(context: 'admin' | 'organisation' | 'team', contextId: number, options?: GetActivityAttendOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/attendance`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.activity_id !== undefined) { + optionsList.append('activity_id', options.activity_id.toString()) + } + if (options.activity_resource_type !== undefined) { + optionsList.append('activity_resource_type', options.activity_resource_type.toString()) + } + if (options.ends_after !== undefined) { + optionsList.append('ends_after', options.ends_after.toString()) + } + if (options.ends_before !== undefined) { + optionsList.append('ends_before', options.ends_before.toString()) + } + if (options.id !== undefined) { + optionsList.append('id', options.id.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.role_id !== undefined) { + optionsList.append('role_id', options.role_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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + + if (options.starts_before !== undefined) { + optionsList.append('starts_before', options.starts_before.toString()) + } + if (options.starts_after !== undefined) { + optionsList.append('starts_after', options.starts_after.toString()) + } + if (options.status !== undefined) { + optionsList.append('status', options.status) + } + } + + const activity = await this._request.getManyAsync(url) + activity.forEach(m => m.entityType = EntityType.Activity) + + return activity + } + +} \ No newline at end of file diff --git a/lib/src/api/animals.ts b/lib/src/api/animals.ts new file mode 100644 index 0000000..d0e4868 --- /dev/null +++ b/lib/src/api/animals.ts @@ -0,0 +1,116 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Animal } from '../types/animal' +import D4H, { D4H_BASE_URL } from '../d4h' + + +/** @ignore @inline */ +export interface GetAnimalsOptions { + handler_member_id?: number | number[]; + id?: number | number[]; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + status?: 'NON_OPERATIONAL' | 'OPERATIONAL'; // list of ids or null + team_id?: number; // the numeric identifier for a team resource +} + +export class Animals { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param animalId - An animal id + * @returns - An animal item + */ + async getAnimal(context: 'admin' | 'organisation' | 'team', contextId: number, animalId: number | 'me'): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animals/${animalId}`) + + try { + const animal = await this._request.getAsync(url) + animal.entityType = EntityType.Animal + return animal + } catch (error) { + throw new Error('Animal data not found or improperly formatted.') + } + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.handler_member_id - The member id or ids of the animal's handler(s) + * @param options.id - A list of ids + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.status - The status of the animal + * @param options.team_id - The numeric identifier for a resource + * @returns - A list of animals + */ + async getAnimals(context: 'admin' | 'organisation' | 'team', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof 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 this._request.getManyAsync(url) + animals.forEach(m => m.entityType = EntityType.Animal) + + return animals + } + +} \ No newline at end of file diff --git a/lib/src/api/animalsApi.ts b/lib/src/api/animalsApi.ts deleted file mode 100644 index a6b5969..0000000 --- a/lib/src/api/animalsApi.ts +++ /dev/null @@ -1,71 +0,0 @@ -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/custom_fields.ts b/lib/src/api/custom_fields.ts new file mode 100644 index 0000000..3b7d080 --- /dev/null +++ b/lib/src/api/custom_fields.ts @@ -0,0 +1,72 @@ +import { CustomFieldUpdate } from '../types/customField' +import { Entity } from '../entity' +import D4H, { D4H_BASE_URL } from '../d4h' +import D4HRequest from '../d4hRequest' + +class CustomFields { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + 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.entityType}/${entity.id}`) + + // From the documentation: + // https://api.d4h.org/v2/documentation#operation/putTeamCustomfieldsEntity_typeEntity_id + // The PUT action for fields is distinguished by Bundle. If you include one field's value + // from a bundle (or an unbundled field's value) you must include values for all fields + // of that bundle (or all unbundled fields) + // ---------------------------------------------------------------------------------------- + // To ensure a mistake doesn't occur, let's ensure that *all* unbundled custom fields from the original + // entity are in the list of updates. + // + // At this time we don't actively use any custom fields in a bundle. To save on the additional complexity, + // bundled custom fields are not supported and will result in an error if attempting to update them. + + // At this time all entities we're working with have custom fields. As a result, throw an + // error if none are found. This most likely indicates the original request was made without + // including custom fields. + const originalCustomFields = entity.custom_fields + if (!originalCustomFields) { + throw new Error('Cannot update custom fields for an entity with no custom fields. Ensure your original request included custom fields.') + + } + + // For any fields not being changed, back fill from the original entity to ensure + // they retain the same value. + for (const field of originalCustomFields) { + const update = updates.find((u) => u.id == field.id) + if (update) { + if (onlyMemberEditOwn && !field.member_edit_own) { + throw new Error('onlyMemberEditOwn specified, but attempting to update non-memberEditOwn field.') + } else if (field.bundle) { + throw new Error('One or more custom fields being updated are part of a bundle. Updating fields in a bundle is not supported.') + } + } else { + let include = true + if (field.bundle || (onlyMemberEditOwn && !field.member_edit_own)) { + include = false + } + + if (include) { + updates.push({ + id: field.id, + value: field.value + }) + } + } + } + + return this._request.putAsync(url, { fields: updates }) + } + +} + +export { CustomFields } \ No newline at end of file diff --git a/lib/src/api/groups.ts b/lib/src/api/groups.ts new file mode 100644 index 0000000..c706f92 --- /dev/null +++ b/lib/src/api/groups.ts @@ -0,0 +1,205 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import D4H, { D4H_BASE_URL } from '../d4h' +import type { groupMembership, memberGroup } from '../types/group' + +/** @ignore @inline */ +export interface GetMemberGroupsOptions { + id?: number; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + team_id?: number | number[]; + title?: string; +} + +/** @ignore @inline */ +export interface GetMemberGroupMembershipOptions { + group_id?: number | number[]; + id?: number | number[]; + member_id?: number | number[]; + order?: 'asc' | 'desc'; // default: 'asc' + page?: number; + size?: number; + sort?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + team_id?: number | number[]; +} + + +export class Groups { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param groupId - A group identifier + * @returns - A member group + */ + async getMemberGroup( + context: 'admin' | 'organisation' | 'team', + contextId: number, + groupId: number, + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-groups/${groupId}`) + + try { + const group = await this._request.getAsync(url) + group.entityType = EntityType.memberGroup + return group + } catch (error) { + throw new Error('Group data not found or improperly formatted.') + } + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.id - A list of ids + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.team_id - One or more team identifiers + * @param options.title - A simple text search term, compared against the title + * @returns + */ + async getMemberGroups( + context: 'admin' | 'organisation' | 'team', + 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', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof 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 this._request.getManyAsync(url) + groups.forEach((m) => (m.entityType = EntityType.memberGroup)) + + return groups + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.group_id - One or more group identifiers + * @param options.id - A list of ids + * @param options.member_id - One or more member identifiers + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.team_id - One or more team identifiers + * @returns - A list of member group memberships + */ + async getMemberGroupMemberships( + context: 'admin' | 'organisation' | 'team', + contextId: number, + options?: GetMemberGroupMembershipOptions + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-group-memberships`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.group_id !== undefined) { + optionsList.append('group_id', options.group_id.toString()) + } + + if (options.id !== undefined) { + optionsList.append('id_tag', options.id.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.size !== undefined) { + optionsList.append('size', options.size.toString()) + } + + if (options.sort !== undefined) { + if (Array.isArray(options.sort)) { + options.sort.forEach(sortField => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + + if (options.team_id !== undefined) { + optionsList.append('team_id', options.team_id.toString()) + } + } + + const groups = await this._request.getManyAsync(url) + groups.forEach((m) => (m.entityType = EntityType.groupMembership)) + + return groups + } +} \ No newline at end of file diff --git a/lib/src/api/groupsApi.ts b/lib/src/api/groupsApi.ts deleted file mode 100644 index c954cca..0000000 --- a/lib/src/api/groupsApi.ts +++ /dev/null @@ -1,74 +0,0 @@ -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/incidents.ts b/lib/src/api/incidents.ts new file mode 100644 index 0000000..979eaac --- /dev/null +++ b/lib/src/api/incidents.ts @@ -0,0 +1,140 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import D4H, { D4H_BASE_URL } from '../d4h' +import type { Incident } from '../types/incident' + +/** @ignore @inline */ +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?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + starts_after?: string; + tag_bundle_id?: number; + tag_id?: number; + team_id?: number; +} + +export class Incidents { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param activityId - An activity identifier + * @returns - An incident + */ + async getIncident(context: 'admin' | 'organisation' | 'team', contextId: number, activityId: number): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/incidents/${activityId}`) + + + try { + const incident = await this._request.getAsync(url) + incident.entityType = EntityType.Incident + return incident + } catch (error) { + throw new Error('Incident data not found or improperly formatted.') + } + } + + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.after - Return only activities ending after this datetime + * @param options.before - Return only activities starting before this datetime + * @param options.deleted - Return only deleted activities + * @param options.ends_before - Return only activities ending before this datetime + * @param options.id - A list of ids + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.published - Return only published activities + * @param options.reference - A simple text search term, compared against the reference and reference description + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.starts_after - Return only activities starting after this datetime + * @param options.tag_bundle_id - Return only activities with this tag bundle id + * @param options.tag_id - Return only activities with this tag id + * @param options.team_id - Return only activities with this team id + * @returns - A list of incidents + */ + async getIncidents(context: 'admin' | 'organisation' | 'team', contextId: number, options?: GetIncidentOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/incidents`) + + if (options !== undefined) { + const optionsList = url.searchParams + + if (options.after !== undefined) { + optionsList.append('after', options.after) + } + if (options.before !== undefined) { + optionsList.append('before', options.before) + } + if (options.deleted !== undefined) { + optionsList.append('deleted', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof 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) + } +} \ No newline at end of file diff --git a/lib/src/api/members.ts b/lib/src/api/members.ts new file mode 100644 index 0000000..be166e6 --- /dev/null +++ b/lib/src/api/members.ts @@ -0,0 +1,178 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Member } from '../types/member' +import D4H, { D4H_BASE_URL } from '../d4h' +import type { MemberUpdate } from '../types/member' + + +/** @ignore @inline */ +export interface GetMemberOptions { + includeDetails?: boolean; +} + +/** @inline */ +export interface GetMembersOptions { + deleted?: boolean; // default: false + id?: number | number[] + id_tag?: string; + name?: string; + order?: 'asc' | 'desc'; /** @defaultValue asc */ + page?: number; + size?: number; + sort?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + statuses?: (number | null)[]; // list of ids or null + team_id?: number; // the numeric identifier for a team resource +} + +export class Members { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param id - Member the resource belongs to. Either an id or "me" + * @returns - A member + */ + async getMember( + context: 'admin' | 'organisation' | 'team', + 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') + } + } + + try { + const member = await this._request.getAsync(url) + member.entityType = EntityType.Member + return member + } catch (error) { + throw new Error('Member data not found or improperly formatted.') + } + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.deleted - Return only deleted members + * @param options.id - A list of ids + * @param options.id_tag - RFID tag or barcode + * @param options.name - The member's name + * @param options.order - + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - + * @param options.statuses - One or more member statuses. Some statuses require extra permissions. + * @param options.team_id - The numeric identifier for a resource + * @returns - A list of members + */ + async getMembers( + context: 'admin' | 'organisation' | 'team', + 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 !== undefined) { + optionsList.append('id', options.id.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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof 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 this._request.getManyAsync(url) + members.forEach((m) => (m.entityType = EntityType.Member)) + + return members + } + + + /** + * + * @param context + * @param contextId + * @param id + * @param updates + * @returns + */ + 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}/${context}/${contextId}/members/${id}`) + return this._request.putAsync(url, updates) + } + +} diff --git a/lib/src/api/membersApi.ts b/lib/src/api/membersApi.ts deleted file mode 100644 index 3ee036c..0000000 --- a/lib/src/api/membersApi.ts +++ /dev/null @@ -1,97 +0,0 @@ -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/qualifications.ts b/lib/src/api/qualifications.ts new file mode 100644 index 0000000..e3d11b1 --- /dev/null +++ b/lib/src/api/qualifications.ts @@ -0,0 +1,401 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import type { Qualification, MemberAwards } from '../types/qualification' +import D4H, { D4H_BASE_URL, D4H_FETCH_LIMIT } from '../d4h' + +console.log(D4H_FETCH_LIMIT) + +/** @ignore @inline */ +export interface GetOneQualificationOptions { + exclude_org_data?: boolean; + exclude_teams_data?: boolean; +} + +/** @ignore @inline */ +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?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' + title?: string; +} + +/** @ignore @inline */ +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?: 'createdAt' | 'id' | 'updatedAt'; // default: 'id' +} + + +export class Qualifications { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param qualificationId - The qualification's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @returns - A member qualification + */ + async getMemberQualification(context: 'admin' | 'organisation' | 'team', contextId: number, qualificationId: number | 'me', options?: GetOneQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/member-qualifications/${qualificationId}`) + + 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()) + } + } + + try { + const qualification = await this._request.getAsync(url) + qualification.entityType = EntityType.Incident + return qualification + } catch (error) { + throw new Error('Qualification data not found or improperly formatted.') + } + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.title - The title of a resource + * @returns - A list of member qualifications + */ + async getMemberQualifications(context: 'admin' | 'organisation' | 'team', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + return this._request.getManyAsync(url) + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param qualificationId - The qualification's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @returns - An animal qualification + */ + async getAnimalQualification(context: 'admin' | 'organisation' | 'team', contextId: number, qualificationId: number, options?: GetOneQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/animal-qualifications/${qualificationId}`) + + 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()) + } + } + + try { + const qualification = await this._request.getAsync(url) + qualification.entityType = EntityType.Qualification + return qualification + } catch (error) { + throw new Error('Qualification data not found or improperly formatted.') + } + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.title - The title of a resource + * @returns - A list of animal qualifications + */ + async getAnimalQualifications(context: 'admin' | 'organisation' | 'team', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + const qualifications = await this._request.getManyAsync(url) + qualifications.forEach((m) => (m.entityType = EntityType.Qualification)) + + return qualifications + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param qualificationId - The qualification's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @returns - An animal qualification + */ + async getHandlerQualification(context: 'admin' | 'organisation' | 'team', contextId: number, qualificationId: number, options?: GetOneQualificationOptions): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/handler-qualifications/${qualificationId}`) + + 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()) + } + } + + try { + const qualification = await this._request.getAsync(url) + qualification.entityType = EntityType.Qualification + return qualification + } catch (error) { + throw new Error('Qualification data not found or improperly formatted.') + } + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @param options.title - The title of a resource + * @returns - A list of animal qualifications + */ + async getHandlerQualifications(context: 'admin' | 'organisation' | 'team', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + + if (options.title !== undefined) { + optionsList.append('title', options.title) + } + } + + const qualifications = await this._request.getManyAsync(url) + qualifications.forEach((m) => (m.entityType = EntityType.Qualification)) + + return qualifications + } + + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param options.exclude_org_data - Team context: Exclude entities inherited from the team's org + * @param options.exclude_teams_data - Organisation context: Exclude entities belonging to accessible teams + * @param options.member_id - Qualified member. Either an id or "me" + * @param options.order - Default: "asc" + * @param options.page - Page number + * @param options.qualification_id - The qualification's id + * @param options.size - Items per page + * @param options.sort - Default: "id" + * @returns - A list of member qualification awards + */ + async getMemberAwards(context: 'admin' | 'organisation' | 'team', 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 => { + if (typeof sortField === 'string') { + optionsList.append('sort', sortField) + } else { + console.warn('Skipping invalid sort field: ', sortField) + } + }) + } else if (typeof options.sort === 'string') { + optionsList.append('sort', options.sort) + } else { + console.warn('Invalid sort field type:', typeof options.sort) + } + } + } + + const awards = await this._request.getManyAsync(url) + awards.forEach((m) => (m.entityType = EntityType.Award)) + + return awards + } +} \ No newline at end of file diff --git a/lib/src/api/qualificationsApi.ts b/lib/src/api/qualificationsApi.ts deleted file mode 100644 index 58a528d..0000000 --- a/lib/src/api/qualificationsApi.ts +++ /dev/null @@ -1,213 +0,0 @@ -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/api/roles.ts b/lib/src/api/roles.ts new file mode 100644 index 0000000..ad35729 --- /dev/null +++ b/lib/src/api/roles.ts @@ -0,0 +1,34 @@ +import D4HRequest from '../d4hRequest' +import { EntityType } from '../entity' +import D4H, { D4H_BASE_URL, D4H_FETCH_LIMIT } from '../d4h' +import { Role } from '../types/role' + +console.log(D4H_FETCH_LIMIT) + + +export class Roles { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + /** + * + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param roleId - A role id + * @returns - A role + */ + async getMemberQualification(context: 'admin' | 'organisation' | 'team', contextId: number, roleId: number | 'me'): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/roles/${roleId}`) + + try { + const role = await this._request.getAsync(url) + role.entityType = EntityType.Role + return role + } catch (error) { + throw new Error('Role data not found or improperly formatted.') + } + } +} \ No newline at end of file diff --git a/lib/src/d4h.ts b/lib/src/d4h.ts index 49e4364..f66b2c5 100644 --- a/lib/src/d4h.ts +++ b/lib/src/d4h.ts @@ -1,383 +1,94 @@ -import { CustomFieldUpdate } from './types/customField' import D4HRequest from './d4hRequest' -import { Entity, EntityType } from './entity' -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' +import { Team } from './types/team' +import { Organisation } from './types/organisation' +import { EntityType } from './entity' + +/** @ignore */ const D4H_FETCH_LIMIT = 250 + +/** @ignore */ 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 { D4H_BASE_URL, D4H_FETCH_LIMIT } -export interface GetMemberOptions { - includeDetails?: boolean; -} - -export interface GetMembersOptions { - 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 { - memberId?: number; - 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 { +class D4H { private readonly _request: D4HRequest constructor(token: string) { this._request = new D4HRequest(token, D4H_FETCH_LIMIT) } - /********************************************/ - /**************** MEMBERS *******************/ - /********************************************/ - - async getMember( - context: string, - contextId: number, - id: number | 'me', - options?: GetMemberOptions - ): Promise { - return membersApi.getMember(this._request, context, contextId, id, options) + + get request(): D4HRequest { + return this._request } - async getMembers( - context: string, - contextId: number, - options?: GetMembersOptions - ): Promise { - return membersApi.getMembers(this._request, context, contextId, options) + +} + +class Teams { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request } - 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() + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param teamId - A team's id + * @returns - A team + */ + async getTeam( + context: 'admin' | 'organisation' | 'team', + contextId: number, + teamId: number, + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/teams/${teamId}`) + + try { + const team = await this._request.getAsync(url) + team.entityType = EntityType.Team + return team + } catch (error) { + throw new Error('Team data not found or improperly formatted.') } - - 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 *************/ - /********************************************/ - - // Emergency Contacts no longer have specific endpoint - - /********************************************/ - /***************** GROUPS *******************/ - /********************************************/ - - async getMemberGroup( - context: string, - contextId: number, - groupId: number, - ): Promise { - return groupsApi.getMemberGroup(this._request, context, contextId, groupId) - } - - 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.after !== undefined) { - optionsList.append('after', options.after) - } - 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.entityType}/${entity.id}`) - - // From the documentation: - // https://api.d4h.org/v2/documentation#operation/putTeamCustomfieldsEntity_typeEntity_id - // The PUT action for fields is distinguished by Bundle. If you include one field's value - // from a bundle (or an unbundled field's value) you must include values for all fields - // of that bundle (or all unbundled fields) - // ---------------------------------------------------------------------------------------- - // To ensure a mistake doesn't occur, let's ensure that *all* unbundled custom fields from the original - // entity are in the list of updates. - // - // At this time we don't actively use any custom fields in a bundle. To save on the additional complexity, - // bundled custom fields are not supported and will result in an error if attempting to update them. - - // At this time all entities we're working with have custom fields. As a result, throw an - // error if none are found. This most likely indicates the original request was made without - // including custom fields. - const originalCustomFields = entity.custom_fields - if (!originalCustomFields) { - throw new Error('Cannot update custom fields for an entity with no custom fields. Ensure your original request included custom fields.') - - } - - // For any fields not being changed, back fill from the original entity to ensure - // they retain the same value. - for (const field of originalCustomFields) { - const update = updates.find((u) => u.id == field.id) - if (update) { - if (onlyMemberEditOwn && !field.member_edit_own) { - throw new Error('onlyMemberEditOwn specified, but attempting to update non-memberEditOwn field.') - } else if (field.bundle) { - throw new Error('One or more custom fields being updated are part of a bundle. Updating fields in a bundle is not supported.') - } - } else { - let include = true - if (field.bundle || (onlyMemberEditOwn && !field.member_edit_own)) { - include = false - } - - if (include) { - updates.push({ - id: field.id, - value: field.value - }) - } - } - } - - return this._request.putAsync(url, { fields: updates }) } } + +class Organisations { + private readonly _request: D4HRequest + + constructor(d4hInstance: D4H) { + this._request = d4hInstance.request + } + + /** + * @param context - The point of view from where the request takes place + * @param contextId - Either a team, organisation or admin's id + * @param organisationId - An organisation's id + * @returns - A organisation + */ + async getOrganisation( + context: 'admin' | 'organisation' | 'team', + contextId: number, + organisationId: number, + ): Promise { + const url = new URL(`${D4H_BASE_URL}/${context}/${contextId}/organisations/${organisationId}`) + + try { + const organisation = await this._request.getAsync(url) + organisation.entityType = EntityType.Organisation + return organisation + } catch (error) { + throw new Error('Organisation data not found or improperly formatted.') + } + } +} + +export { + Teams, + Organisations, +} +export default D4H \ No newline at end of file diff --git a/lib/src/d4hRequest.ts b/lib/src/d4hRequest.ts index b030934..a3e1b2b 100644 --- a/lib/src/d4hRequest.ts +++ b/lib/src/d4hRequest.ts @@ -58,33 +58,32 @@ export default class D4HRequest { return this.requestAsync(url, HttpMethod.Get) } - async getManyAsync(url: URL, paginate: boolean = false): Promise { + async getManyAsync(url: URL, paginate = false): Promise { let results: DataType[] = [] if (paginate) { let offset = 0 - + let hasMore = true + // Pagination loop - while (true) { + while (hasMore) { 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 - } + + hasMore = newResults.length === this._fetchLimit } } 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 d5a3e9d..90d5df4 100644 --- a/lib/src/entity.ts +++ b/lib/src/entity.ts @@ -14,8 +14,13 @@ export interface Entity { export enum EntityType { Member = 'member', memberGroup = 'membergroup', + groupMembership = 'groupmembership', Incident = 'incident', Qualification = 'qualification', Award = 'award', - Animal = 'animal' + Animal = 'animal', + Team = 'team', + Organisation = 'organisation', + Role = 'role', + Activity = 'activity' } diff --git a/lib/src/types/accounts.ts b/lib/src/types/accounts.ts new file mode 100644 index 0000000..37aaa82 --- /dev/null +++ b/lib/src/types/accounts.ts @@ -0,0 +1,31 @@ +export interface Account { + id: number; + resourceType: string; +} + +export interface ContextOwner { + resourceType: string; + id: number; + title?: string; + owner?: ContextOwner; +} + +export interface Permissions { + [key: string]: { + [action: string]: boolean; + }; +} + +export interface Context { + id: number; + owner: ContextOwner; + name: string; + hasAccess: boolean; + resourceType: string; + permissions: Permissions; +} + +export interface WhoAmIType { + account: Account; + context: Context; +} diff --git a/lib/src/types/activity.ts b/lib/src/types/activity.ts new file mode 100644 index 0000000..f36cfb2 --- /dev/null +++ b/lib/src/types/activity.ts @@ -0,0 +1,19 @@ +import { Entity } from '../entity' +import { resourceType } from './generic'; + +export interface Activity extends Entity { + +activity: resourceType; +createdAt: string; +duration: number; +endsAt: string; +id: number; +member: resourceType; +owner: resourceType; +startsAt: string; +status: string; +resourceType: string; +role: resourceType; +updatedAt: string; + +} \ No newline at end of file diff --git a/lib/src/types/customField.ts b/lib/src/types/customField.ts index 2d8d07b..b9ea6d0 100644 --- a/lib/src/types/customField.ts +++ b/lib/src/types/customField.ts @@ -1,3 +1,4 @@ +/** @ignore @inline */ export enum CustomFieldType { Number = 'number', Text = 'text', @@ -14,6 +15,7 @@ export interface CustomField { member_edit_own: boolean; } +/** @ignore @inline */ export interface CustomFieldUpdate { id: number; value: string | null; diff --git a/lib/src/types/emergencyContacts.ts b/lib/src/types/emergencyContacts.ts index 9f766b6..9c738db 100644 --- a/lib/src/types/emergencyContacts.ts +++ b/lib/src/types/emergencyContacts.ts @@ -1,3 +1,5 @@ + +/** @ignore */ export interface EmergencyContact { name: string | null relation: string | null @@ -5,6 +7,7 @@ export interface EmergencyContact { alt_phone: string | null } +/** @ignore */ export interface EmergencyContacts { primary: EmergencyContact secondary: EmergencyContact diff --git a/lib/src/types/generic.ts b/lib/src/types/generic.ts new file mode 100644 index 0000000..d153f3e --- /dev/null +++ b/lib/src/types/generic.ts @@ -0,0 +1,9 @@ +//generic.ts + +// Reusable interface, used in many other interfaces + +/** @ignore @inline */ +export interface resourceType { + resourceType: string | null; + id: number | null; +} \ No newline at end of file diff --git a/lib/src/types/group.ts b/lib/src/types/group.ts index b625bce..cabbb02 100644 --- a/lib/src/types/group.ts +++ b/lib/src/types/group.ts @@ -1,4 +1,11 @@ import { Entity } from '../entity' +import { resourceType } from './generic' + + + +/********************************************/ +/**************** GROUPS ********************/ +/********************************************/ export interface memberGroup extends Entity{ id: number; @@ -8,4 +15,18 @@ export interface memberGroup extends Entity{ resourceType: string; createdAt: string; updatedAt: string; +} + + + + +/********************************************/ +/*********** GROUP MEMBERSHIP ***************/ +/********************************************/ + +export interface groupMembership extends Entity{ + id: number; + owner: resourceType; + group: resourceType; + member: resourceType; } \ No newline at end of file diff --git a/lib/src/types/incident.ts b/lib/src/types/incident.ts index e8741ac..a0b1850 100644 --- a/lib/src/types/incident.ts +++ b/lib/src/types/incident.ts @@ -1,21 +1,20 @@ import { Entity } from '../entity' +import { resourceType } from './generic' -export interface IncidentOwner { - resourceType: string; - id: number; -} - +/** @ignore @inline */ export interface IncidentLocation { type: string; coordinates: [number, number]; } +/** @ignore @inline */ export interface WeatherInfo { symbol: string | null; symbolDate: string | null; temperature: number | null; } +/** @ignore @inline */ export interface AddressInfo { postCode: string; region: string; @@ -23,20 +22,9 @@ export interface AddressInfo { 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; + owner: resourceType; resourceType: string; reference: string; referenceDescription: string; @@ -65,8 +53,8 @@ export interface Incident extends Entity{ weatherCloudCover: number | null; address: AddressInfo; location: IncidentLocation; - locationBookmark: IncidentLocationBookmark; + locationBookmark: resourceType; fullTeam: boolean; selfCoordinator: boolean; - tags: IncidentTag[]; + tags: resourceType[]; } diff --git a/lib/src/types/member.ts b/lib/src/types/member.ts index 9071cb3..acf4bef 100644 --- a/lib/src/types/member.ts +++ b/lib/src/types/member.ts @@ -1,5 +1,7 @@ import { Entity } from '../entity' +import { resourceType } from './generic' +/** @ignore @inline */ export interface MemberStatus { id: number type: string @@ -7,65 +9,39 @@ export interface MemberStatus { label: MemberStatusLabel | null } +/** @ignore @inline */ export interface MemberStatusLabel { id: number value: string } -export interface CustomMemberStatus { - id: number | null - resourceType: string -} - -export interface EquipmentLocation { - id: number | null - resourceType: string -} - +/** @ignore @inline */ export interface EmailInfo { value: string verified: boolean } +/** @ignore @inline */ export interface PhoneInfo { phone: string verified?: boolean } -export interface PrimaryEmergencyContact { +/** @ignore @inline */ +export interface emergencyContact { 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 -} - +/** @inline */ export interface Location { type: string coordinates: [number, number] } + export interface Member extends Entity { id: number name: string @@ -90,14 +66,14 @@ export interface Member extends Entity { permission: number credits: number defaultDuty: string - defaultEquipmentLocation: EquipmentLocation - customStatus: CustomMemberStatus + defaultEquipmentLocation: resourceType + customStatus: resourceType location: Location - locationBookmark: MemberLocationBookmark - retiredReason: RetiredReason - role: Role - primaryEmergencyContact: PrimaryEmergencyContact - secondaryEmergencyContact: SecondaryEmergencyContact + locationBookmark: resourceType + retiredReason: resourceType + role: resourceType + primaryEmergencyContact: emergencyContact + secondaryEmergencyContact: emergencyContact alertActivityApproval: boolean alertAllQualifications: boolean alertGear: boolean diff --git a/lib/src/types/organisation.ts b/lib/src/types/organisation.ts new file mode 100644 index 0000000..d52e1e7 --- /dev/null +++ b/lib/src/types/organisation.ts @@ -0,0 +1,12 @@ +import { Entity } from '../entity' + +/** @ignore @inline */ +export interface Organisation extends Entity { + id: number, + title: string, + country: string, + timezone: string, + createdAt: string, + updatedAt: string, + resourceType: string, +} \ No newline at end of file diff --git a/lib/src/types/qualification.ts b/lib/src/types/qualification.ts index 0c7602a..002308c 100644 --- a/lib/src/types/qualification.ts +++ b/lib/src/types/qualification.ts @@ -1,9 +1,5 @@ import { Entity } from '../entity' - -export interface Resource { - resourceType: string; - id: number; -} +import { resourceType } from './generic' export interface Qualification extends Entity { id: number, @@ -26,7 +22,7 @@ export interface MemberAwards extends Entity { resourceType: string; startsAt: string | null; endsAt: string | null; - owner: Resource; - member: Resource; - qualification: Resource; + owner: resourceType; + member: resourceType; + qualification: resourceType; } \ No newline at end of file diff --git a/lib/src/types/role.ts b/lib/src/types/role.ts new file mode 100644 index 0000000..59d4e8c --- /dev/null +++ b/lib/src/types/role.ts @@ -0,0 +1,20 @@ +import { Entity } from '../entity' +import { resourceType } from './generic' + + +export interface costs { + hour: number, + use: number +} + +export interface Role extends Entity{ + id: number, + title: string, + deprecatedBundle: string, + owner: resourceType, + order: number, + cost: costs, + resourceType: string, + createdAt: string, + upatedAt: string +} \ No newline at end of file diff --git a/lib/src/types/team.ts b/lib/src/types/team.ts new file mode 100644 index 0000000..ec50df2 --- /dev/null +++ b/lib/src/types/team.ts @@ -0,0 +1,34 @@ +import { Entity } from '../entity' +import { resourceType } from './generic' + + +/** @ignore @inline */ +export interface location { + type: string, + coordinates: [number, number], +} + + +/** @ignore @inline */ +export interface counts { + total: number, + operational: number, +} + + +/** @ignore @inline */ +export interface Team extends Entity { + id: number, + owner: resourceType, + title: string, + location: location, + memberCounts: counts, + timezone: string, + country: string, + deletedAt: null, + overview: string, + createdAt: string, + updatedAt: string, + subdomain: string, + resourceType: string, +} \ No newline at end of file diff --git a/test/getMember.ts b/test/getMember.ts deleted file mode 100644 index e498fd2..0000000 --- a/test/getMember.ts +++ /dev/null @@ -1,33 +0,0 @@ -import D4H from '../lib/src/d4h' -import * as dotenv from 'dotenv'; - -dotenv.config() -const apiToken = process.env['apiToken'] - -if (!apiToken) { - throw new Error('apiToken is not defined in the environment variables.'); -} - -// console.log(`Your API Token is: ${apiToken}`); - -const d4hInstance = new D4H(apiToken); -const getmember = async (team: string, contextId: number, id: number) => { - - //const memberdata = await d4hInstance.getMember(team, contextId, id) - console.log(id) - const memberdata = await d4hInstance.getMembers(team, contextId) - - return memberdata -} - -const logMember = async () => { - const member = await getmember('team', 1614, 85292); - // console.log(`${JSON.stringify(member, null, 2)}`); - - // const memberName = member.name - // const memberDEM = member.ref - - console.log(member) -} - -logMember(); \ No newline at end of file diff --git a/test/getMembers.ts b/test/getMembers.ts deleted file mode 100644 index e7f2b7e..0000000 --- a/test/getMembers.ts +++ /dev/null @@ -1,28 +0,0 @@ -import D4H from '../lib/src/d4h' -import * as dotenv from 'dotenv'; - -dotenv.config() -const apiToken = process.env['apiToken'] - -if (!apiToken) { - throw new Error('apiToken is not defined in the environment variables.'); -} - -// console.log(`Your API Token is: ${apiToken}`); - -const d4hInstance = new D4H(apiToken); -const getmembers = async (team: string, contextId: number) => { - - const memberdata = await d4hInstance.getAnimals(team, contextId) - - return memberdata -} - -const logMember = async () => { - const members = await getmembers('team', 1614); - - console.log(`${JSON.stringify(members, null, 2)}`); - -} - -logMember(); \ No newline at end of file diff --git a/test/index.ts b/test/index.ts index 4ebc58e..ffdc211 100644 --- a/test/index.ts +++ b/test/index.ts @@ -10,8 +10,8 @@ const token = env["D4H_TOKEN"]!; let api = new D4H(token); let getMembersOptions: GetMembersOptions = { - includeDetails: true, - includeCustomFields: true, +// includeDetails: true, +// includeCustomFields: true, }; let main = async function() { @@ -33,7 +33,7 @@ let main = async function() { try { const context = 'team' const contextId = 1234 - const members = await api.getMembersAsync(context, contextId, getMembersOptions) + const members = await api.getMembers(context, contextId, getMembersOptions) console.log(`Retrieved ${members.length} members.`) } catch (err) { console.log(JSON.stringify(err)) @@ -45,7 +45,7 @@ let main = async function() { try { const context = 'team' const contextId = 1234 - const groups = await api.getGroupsAsync(context, contextId) + const groups = await api.groups.getMemberGroups(context, contextId) console.log(`Retrieved ${groups.length} groups.`) } catch (err) { console.log(JSON.stringify(err)) @@ -58,7 +58,7 @@ let main = async function() { const context = 'team' const contextId = 1234 const memberId = 103636 - const member = await api.getMemberAsync(context, contextId, memberId, { includeDetails: true }) + const member = await api.getMember(context, contextId, memberId, { includeDetails: true }) console.log(`Retrieved single member: ${member.name}`) // Only execute update code on an instance where that's OK. diff --git a/typedoc.json b/typedoc.json index e76ff49..797392c 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,6 +1,19 @@ +// typedoc.json { "$schema": "https://typedoc.org/schema.json", "entryPoints": ["./lib/index.ts"], - "out": "docs" + "out": "docs", + "sidebarLinks": { + "Github Repo": "https://github.com/kc4x4sar/d4h-typescript" + }, + "projectDocuments": ["documents/install.md", "documents/using.md", "documents/examples.md", "documents/contributing.md"], + "navigation": { + "includeCategories": true, + "includeGroups": false, + "includeFolders": true, + "compactFolders": false, + "excludeReferences": true + }, + "categorizeByGroup": false }