@immomio/api-library
Advanced tools
Comparing version 1.1.3 to 1.2.0
import { Api } from '../api'; | ||
import { FlatUrl } from '../flats'; | ||
import { Flat } from '../flats'; | ||
import { ProfileUrl } from '../profiles'; | ||
@@ -12,3 +12,3 @@ import { JsonHalCollection, JsonHalObject } from '../utils/jsonHal'; | ||
expired: boolean; | ||
flat: FlatUrl; | ||
flat: Flat; | ||
maxInviteeCount: number; | ||
@@ -43,2 +43,2 @@ readonly currentInviteeCount: number; | ||
export declare const findAppointment: (locals: FindAppointment, api?: Api) => Promise<AppointmentResponse & JsonHalObject>; | ||
export declare const filterValidAppointments: (appointments: Appointment[], validAppointments: Appointment[], flat: string) => Appointment[]; | ||
export declare const filterValidAppointments: (appointments: Appointment[], validAppointments: Appointment[], flat: Flat) => Appointment[]; |
@@ -53,3 +53,3 @@ "use strict"; | ||
const hasAppointmentFreeSlots = (appointment) => appointment.maxInviteeCount === -1 || appointment.currentInviteeCount < appointment.maxInviteeCount; | ||
const appointmentForFlatFilter = (flat) => (appointment) => appointment.flat === flat; | ||
const appointmentForFlatFilter = (flat) => (appointment) => appointment.flat.id === flat.id; | ||
exports.filterValidAppointments = (appointments, validAppointments, flat) => { | ||
@@ -56,0 +56,0 @@ const flatFilter = appointmentForFlatFilter(flat); |
import { ApiUrlPath } from '../api'; | ||
export declare type FlatUrl = ApiUrlPath; | ||
export interface Flat { | ||
ID: string; | ||
id: string; | ||
name: string; | ||
} |
{ | ||
"name": "@immomio/api-library", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Immomio library to access the immomio-API", | ||
@@ -5,0 +5,0 @@ "engineStrict": true, |
import { Api, api as defaultApi } from '../api' | ||
import { FlatUrl } from '../flats' | ||
import { Flat } from '../flats' | ||
import { ProfileUrl } from '../profiles' | ||
@@ -23,3 +23,3 @@ import { fetch } from '../utils/fetch' | ||
expired: boolean | ||
flat: FlatUrl | ||
flat: Flat | ||
maxInviteeCount: number | ||
@@ -131,4 +131,4 @@ readonly currentInviteeCount: number | ||
/** factory to generate functions that check if an appointment connects to a specific flat */ | ||
const appointmentForFlatFilter = (flat: FlatUrl) => (appointment: Appointment) => | ||
appointment.flat === flat | ||
const appointmentForFlatFilter = (flat: Flat) => (appointment: Appointment) => | ||
appointment.flat.id === flat.id | ||
@@ -144,3 +144,3 @@ /** | ||
validAppointments: Appointment[], | ||
flat: FlatUrl, | ||
flat: Flat, | ||
): Appointment[] => { | ||
@@ -147,0 +147,0 @@ const flatFilter = appointmentForFlatFilter(flat) |
@@ -7,4 +7,4 @@ | ||
export interface Flat { | ||
ID: string | ||
id: string | ||
name: string | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34815