From 29a3838f7281fb782841b65a331e029aac726905 Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Tue, 25 Oct 2022 11:02:08 +0100 Subject: [PATCH 1/7] feat: Create genericLenses (for seller only presently) These should allow for more mixing more liberal opportunity validation with lenses --- src/genericLenses.js | 250 +++++++++++++++++++++++++++++++++++++++++++ src/index.js | 2 + src/lenses.js | 86 ++++----------- 3 files changed, 273 insertions(+), 65 deletions(-) create mode 100644 src/genericLenses.js diff --git a/src/genericLenses.js b/src/genericLenses.js new file mode 100644 index 0000000..dd6c8c1 --- /dev/null +++ b/src/genericLenses.js @@ -0,0 +1,250 @@ +/** + * Lenses which are used to interact with data from an Opportunity regardless of the Opportunity's + * type (i.e. Slot vs ScheduledSession). + * + * `genericLenses` is intended to allow use of lenses without being too overly specific about what + * fields are required in an opportunity. + * + * The purpose of having this (as opposed to only having `lenses.js`) is to allow for not having to + * be as prescriptive about field requirements for opportunity data. This means that we spend less + * time fiddling with validation errors that are irrelevant to a given task (e.g. we wouldn't want + * geolocator to fail because an Opportunity's `openingHoursSpecification` is incorrect). + * This allows us to more easily satisfy the Robustness Principle: + * + * > "be conservative in what you send, be liberal in what you accept" + */ +const R = require('ramda'); + +/** + * @template TEventSeriesFields + * @typedef {{ + * type: 'ScheduledSession', + * superEvent: { + * superEvent: TEventSeriesFields + * } + * }} ScSLike + */ + +/** + * @template TFacilityUseFields + * @typedef {{ + * type: 'Slot', + * facilityUse: { + * type: 'FacilityUse', + * } & TFacilityUseFields, + * }} SlotNoIfuLike + */ + +/** + * @template TFacilityUseFields + * @typedef {{ + * type: 'Slot', + * facilityUse: { + * type: 'IndividualFacilityUse', + * facilityUse: { + * type: 'FacilityUse', + * } & TFacilityUseFields, + * } + * }} SlotIfuLike + */ + +/** + * @template TFacilityUseFields + * @typedef {SlotNoIfuLike | SlotIfuLike} SlotLike + */ + +/** + * @template {SlotLike} TSlot + * @param {string[]} propertyPath + * @returns {import('ramda').Lens} + */ +function createSlotLensForFacilityUseProperty(propertyPath) { + const slotGetter = (/** @type {TSlot} */ slot) => { + if (slot.facilityUse.type === 'FacilityUse') { + return R.path(['facilityUse', ...propertyPath], slot); + } + return R.path(['facilityUse', 'facilityUse', ...propertyPath], slot); + }; + const slotSetter = (/** @type {any} */ newValue, /** @type {TSlot} */ slot) => { + if (slot.facilityUse.type === 'FacilityUse') { + return R.assocPath(['facilityUse', ...propertyPath], newValue, slot); + } + return R.assocPath(['facilityUse', 'facilityUse', ...propertyPath], newValue, slot); + }; + return R.lens(slotGetter, slotSetter); +} + +/** + * @template {ScSLike} TScS + * @template {SlotLike} TSlot + * @param {{ + * scs?: import('ramda').Lens, + * slot?: import('ramda').Lens + * }} lensByOpportunityType + */ +function opportunityTypeLens(lensByOpportunityType) { + const opportunityTypeGetter = ( /** @type {TScS | TSlot} */ opportunity) => { + if (opportunity.type === 'ScheduledSession') { + if (!lensByOpportunityType.scs) { + throw new Error('lens not expected to be used for a ScheduledSession'); + } + return R.view(lensByOpportunityType.scs, opportunity); + } + if (!lensByOpportunityType.slot) { + throw new Error('lens not expected to be used for a Slot'); + } + return R.view(lensByOpportunityType.slot, opportunity); + }; + + const opportunityTypeSetter = (/** @type {any} */ newValue, /** @type {TScS | TSlot} */ opportunity) => { + if (opportunity.type === 'ScheduledSession') { + if (!lensByOpportunityType.scs) { + throw new Error('lens not expected to be used for a ScheduledSession'); + } + return R.set(lensByOpportunityType.scs, newValue, opportunity); + } + if (!lensByOpportunityType.slot) { + throw new Error('lens not expected to be used for a Slot'); + } + return R.set(lensByOpportunityType.slot, newValue, opportunity); + }; + + return R.lens(opportunityTypeGetter, opportunityTypeSetter); +} + +// /** +// * @template TSeller +// * @param {ScSLike2<{ organizer: TSeller }> | SlotLike2<{ provider: TSeller }>} opportunityTemplate +// * @returns {import('ramda').Lens | SlotLike2<{ provider: TSeller }>, TSeller>} +// */ +// function createSellerLens(opportunityTemplate) { +// return opportunityTypeLens({ +// scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), +// slot: createSlotLensForFacilityUseProperty(['provider']), +// }); +// } + +// /** +// * @template TSeller +// * @param {import('@imin/speck/lib/types').Speck | SlotLike2<{ provider: TSeller }>, any>} opportunitySpeck +// * @returns {import('ramda').Lens | SlotLike2<{ provider: TSeller }>, TSeller>} +// */ +// function createSellerLens2(opportunitySpeck) { +// return opportunityTypeLens({ +// scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), +// slot: createSlotLensForFacilityUseProperty(['provider']), +// }); +// } + +/** + * How to use in JSDoc (the `*\` is an intentional mistake to allow this to fit into a JSDoc. Correct it + * in order to use it): + * + * ```js + * const sellerLens = /** @type {typeof createSellerLens} *\(createSellerLens)(); + * ``` + * + * (thanks to https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1223795056 for this style + * of using generics in JSDoc) + * + * In .ts, of course, you could just use: + * + * ```ts + * const sellerLens = createSellerLens(); + * ``` + * + * @template TSeller + * @template {ScSLike<{ organizer: TSeller }> | SlotLike<{ provider: TSeller }>} TOpportunity + * @returns {import('ramda').Lens} + */ +function createSellerLens() { + // > Type 'Lens | ScSLike, any>' is not assignable to type 'Lens' + return /** @type {any} */(opportunityTypeLens({ + scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), + slot: createSlotLensForFacilityUseProperty(['provider']), + })); +} + +const genericLenses = { + createSellerLens, +}; + +module.exports = { + createSlotLensForFacilityUseProperty, + opportunityTypeLens, + genericLenses, +}; + +// /** +// * - 1: +// * - Cons: +// * - If no speck is forthcoming, we have to arbitrarily create an object or do something like type{Type}(type {any}(null)) +// * - 2: +// * - Pros: +// * - When we have a speck, this is the most convenient +// * - Cons: +// * - If no speck forthcoming, this cannot be used +// * - 3: +// * - Pros: +// * - In a sense, simple. Doesn't involve pretending to use entities +// * - In .ts files, this would be the actual solution, which means that this works best when able to use .ts files +// * - Cons: +// * - This is the most fiddly +// */ + +// const MinimalSlotNoIfu = s.type({ +// type: s.literal('Slot'), +// facilityUse: s.type({ +// type: s.literal('FacilityUse'), +// provider: Organizer, +// }), +// }); + +// const MinimalSlotIfu = s.type({ +// type: s.literal('Slot'), +// facilityUse: s.type({ +// type: s.literal('IndividualFacilityUse'), +// facilityUse: s.type({ +// type: s.literal('FacilityUse'), +// provider: Organizer, +// }), +// }), +// }); + +// const Opp = s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]); + +// /** +// * @typedef {import('@imin/speck/lib/types').TypeOf} OppType +// */ + +// const S = createSellerLens(s.gen(s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]))) + +// const aS = R.view(S, s.gen(BsBookableScheduledSession)); +// const aS_1 = R.view(S, s.gen(MinimalSlotNoIfu)); +// const aS_2 = R.view(S, s.gen(MinimalSlotIfu)); +// const aS_3 = R.view(S, s.gen(MinimalSlotIfu)); +// const aS_4 = R.view(S, s.gen(s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]))); + +// const x = null; +// const Sa = createSellerLens(/** @type {OppType} */(/** @type {any} */(null))); +// const aSa = R.view(Sa, s.gen(BsBookableScheduledSession)); +// const aSa_1 = R.view(Sa, s.gen(MinimalSlotNoIfu)); +// const aSa_2 = R.view(Sa, s.gen(MinimalSlotIfu)); +// const aSa_3 = R.view(Sa, s.gen(MinimalSlotIfu)); +// const aSa_4 = R.view(Sa, s.gen(Opp)); + +// const S2 = createSellerLens2(Opp); +// const aS2 = R.view(S2, s.gen(BsBookableScheduledSession)); +// const aS2_1 = R.view(S2, s.gen(MinimalSlotNoIfu)); +// const aS2_2 = R.view(S2, s.gen(MinimalSlotIfu)); +// const aS2_3 = R.view(S2, s.gen(MinimalSlotIfu)); +// const aS2_4 = R.view(S2, s.gen(Opp)); + +// /** @type {typeof createSellerLens3} */ +// const createSellerLens3Opp = createSellerLens3; +// const S3 = createSellerLens3Opp(); +// const aS3 = R.view(S3, s.gen(BsBookableScheduledSession)); +// const aS3_1 = R.view(S3, s.gen(MinimalSlotNoIfu)); +// const aS3_2 = R.view(S3, s.gen(MinimalSlotIfu)); +// const aS3_3 = R.view(S3, s.gen(MinimalSlotIfu)); +// const aS3_4 = R.view(S3, s.gen(Opp)); diff --git a/src/index.js b/src/index.js index 6ff66ec..bda1fcd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +const { genericLenses } = require('./genericLenses'); const { logger } = require('./logger'); const { kongSecretMiddleware } = require('./kongSecretMiddleware'); const postgres = require('./postgres'); @@ -19,4 +20,5 @@ module.exports = { getHerokuReleaseInfo, }, Lenses, + genericLenses, }; diff --git a/src/lenses.js b/src/lenses.js index aa279e2..8048dba 100644 --- a/src/lenses.js +++ b/src/lenses.js @@ -1,10 +1,20 @@ +/** + * An implementation of `genericLenses.js` which is tailored to the + * SearchIsBookingRequestFacilityUseSlotType, BsBookableScheduledSessionType & + * GetSlotByIdResponseType types for Opportunities which are used in a few different places. + */ const R = require('ramda'); +const { + createSlotLensForFacilityUseProperty, + opportunityTypeLens: genericOpportunityTypeLens, + genericLenses: { createSellerLens }, +} = require('./genericLenses'); /** * @typedef {import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseSlotType} SearchIsBookingRequestFacilityUseSlotType * @typedef {import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').BsBookableScheduledSessionType} BsBookableScheduledSessionType * @typedef {import('@imin/shared-data-types/src/booking/GetSlotByIdResponse').GetSlotByIdResponseType} GetSlotByIdResponseType - * @typedef {SearchIsBookingRequestFacilityUseSlotType|BsBookableScheduledSessionType | GetSlotByIdResponseType} TOpportunity + * @typedef {SearchIsBookingRequestFacilityUseSlotType | BsBookableScheduledSessionType | GetSlotByIdResponseType} Opportunity * * @typedef {import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').LocationSummaryLocationType} PlaceType // even though this is from the ScS, the FacilityUsePlace is exactly the same model * @typedef {import('@imin/shared-data-types/src/modellingSpec/common').OrganizerType} Organizer @@ -12,86 +22,32 @@ const R = require('ramda'); * @typedef {import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseType} SearchIsBookingRequestFacilityUseType */ -/** - * @param {string[]} propertyPath - * @returns {import('ramda').Lens} - */ -function createSlotLensForFacilityUseProperty(propertyPath) { - const slotGetter = (/** @type {SearchIsBookingRequestFacilityUseSlotType} */ slot) => { - if (slot.facilityUse.type === 'FacilityUse') { - return R.path(['facilityUse', ...propertyPath], slot); - } - return R.path(['facilityUse', 'facilityUse', ...propertyPath], slot); - }; - const slotSetter = (/** @type {any} */ newValue, /** @type {SearchIsBookingRequestFacilityUseSlotType} */ slot) => { - if (slot.facilityUse.type === 'FacilityUse') { - return R.assocPath(['facilityUse', ...propertyPath], newValue, slot); - } - return R.assocPath(['facilityUse', 'facilityUse', ...propertyPath], newValue, slot); - }; - return R.lens(slotGetter, slotSetter); -} - -/** - * @param {{ - * scs?: import('ramda').Lens, - * slot?: import('ramda').Lens - * }} lensByOpportunityType - */ -function opportunityTypeLens(lensByOpportunityType) { - const opportunityTypeGetter = ( /** @type {TOpportunity} */ opportunity) => { - if (opportunity.type === 'ScheduledSession') { - return lensByOpportunityType.scs - ? R.view(lensByOpportunityType.scs, opportunity) - : () => { throw new Error('lens not expected to be used'); }; - } - return lensByOpportunityType.slot - ? R.view(lensByOpportunityType.slot, opportunity) - : () => { throw new Error('lens not expected to be used'); }; - }; - - const opportunityTypeSetter = (/** @type {any} */ newValue, /** @type {TOpportunity} */ opportunity) => { - if (opportunity.type === 'ScheduledSession') { - return lensByOpportunityType.scs - ? R.set(lensByOpportunityType.scs, newValue, opportunity) - : () => { throw new Error('lens not expected to be used'); }; - } - return lensByOpportunityType.slot - ? R.set(lensByOpportunityType.slot, newValue, opportunity) - : () => { throw new Error('lens not expected to be used'); }; - }; - - // @ts-ignore - return R.lens(opportunityTypeGetter, opportunityTypeSetter); -} +/** @type {typeof genericOpportunityTypeLens} */ +const opportunityTypeLens = genericOpportunityTypeLens; const Lenses = { - /** @type {import('ramda').Lens } */ - seller: opportunityTypeLens({ - scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), - slot: createSlotLensForFacilityUseProperty(['provider']), - }), - /** @type {import('ramda').Lens } */ + seller: /** @type {typeof createSellerLens} */(createSellerLens)(), + /** @type {import('ramda').Lens } */ providerId: opportunityTypeLens({ scs: R.lensProp('_provider'), slot: createSlotLensForFacilityUseProperty(['_providerId']), }), - /** @type {import('ramda').Lens } */ + /** @type {import('ramda').Lens } */ name: opportunityTypeLens({ scs: R.lensPath(['superEvent', 'superEvent', 'name']), slot: createSlotLensForFacilityUseProperty(['name']), }), - /** @type {import('ramda').Lens } */ + /** @type {import('ramda').Lens } */ place: opportunityTypeLens({ scs: R.lensPath(['superEvent', 'superEvent', 'imin:locationSummary', '0']), slot: createSlotLensForFacilityUseProperty(['location']), }), - /** @type {import('ramda').Lens} */ + /** @type {import('ramda').Lens} */ facilityUse: opportunityTypeLens({ slot: createSlotLensForFacilityUseProperty([]), }), - /** @type {import('ramda').Lens } */ + /** @type {import('ramda').Lens } */ offers: opportunityTypeLens({ scs: R.lensPath(['superEvent', 'offers']), slot: R.lensProp('offers'), @@ -100,12 +56,12 @@ const Lenses = { scs: R.lensPath(['superEvent', 'superEvent', 'imin:aggregateOffer']), slot: R.lensProp('imin:aggregateOffer'), }), - /** @type {import('ramda').Lens } */ + /** @type {import('ramda').Lens } */ remainingCapacity: opportunityTypeLens({ scs: R.lensPath(['remainingAttendeeCapacity']), slot: R.lensPath(['remainingUses']), }), - /** @type {import('ramda').Lens } */ + /** @type {import('ramda').Lens } */ maxCapacity: opportunityTypeLens({ scs: R.lensPath(['maximumAttendeeCapacity']), slot: R.lensPath(['maximumUses']), From 713d9801af5c51c2784bed10ae9b20aeafb6327c Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Tue, 25 Oct 2022 11:50:00 +0100 Subject: [PATCH 2/7] clean up --- built-types/genericLenses.d.ts | 107 +++++++++++++++++++++++++++++++++ built-types/index.d.ts | 3 +- built-types/lenses.d.ts | 42 +++++++------ src/genericLenses.js | 98 ------------------------------ 4 files changed, 132 insertions(+), 118 deletions(-) create mode 100644 built-types/genericLenses.d.ts diff --git a/built-types/genericLenses.d.ts b/built-types/genericLenses.d.ts new file mode 100644 index 0000000..7dd7929 --- /dev/null +++ b/built-types/genericLenses.d.ts @@ -0,0 +1,107 @@ +export type ScSLike = { + type: 'ScheduledSession'; + superEvent: { + superEvent: TEventSeriesFields; + }; +}; +export type SlotNoIfuLike = { + type: 'Slot'; + facilityUse: { + type: 'FacilityUse'; + } & TFacilityUseFields; +}; +export type SlotIfuLike = { + type: 'Slot'; + facilityUse: { + type: 'IndividualFacilityUse'; + facilityUse: { + type: 'FacilityUse'; + } & TFacilityUseFields; + }; +}; +export type SlotLike = SlotNoIfuLike | SlotIfuLike; +/** + * @template TEventSeriesFields + * @typedef {{ + * type: 'ScheduledSession', + * superEvent: { + * superEvent: TEventSeriesFields + * } + * }} ScSLike + */ +/** + * @template TFacilityUseFields + * @typedef {{ + * type: 'Slot', + * facilityUse: { + * type: 'FacilityUse', + * } & TFacilityUseFields, + * }} SlotNoIfuLike + */ +/** + * @template TFacilityUseFields + * @typedef {{ + * type: 'Slot', + * facilityUse: { + * type: 'IndividualFacilityUse', + * facilityUse: { + * type: 'FacilityUse', + * } & TFacilityUseFields, + * } + * }} SlotIfuLike + */ +/** + * @template TFacilityUseFields + * @typedef {SlotNoIfuLike | SlotIfuLike} SlotLike + */ +/** + * @template {SlotLike} TSlot + * @param {string[]} propertyPath + * @returns {import('ramda').Lens} + */ +export function createSlotLensForFacilityUseProperty>(propertyPath: string[]): R.Lens; +/** + * @template {ScSLike} TScS + * @template {SlotLike} TSlot + * @param {{ + * scs?: import('ramda').Lens, + * slot?: import('ramda').Lens + * }} lensByOpportunityType + */ +export function opportunityTypeLens, TSlot extends SlotLike>(lensByOpportunityType: { + scs?: R.Lens | undefined; + slot?: R.Lens | undefined; +}): R.Lens; +export namespace genericLenses { + export { createSellerLens }; +} +import R = require("ramda"); +/** + * How to use in JSDoc (the `*\` is an intentional mistake to allow this to fit into a JSDoc. Correct it + * in order to use it): + * + * ```js + * const sellerLens = /** @type {typeof createSellerLens} *\(createSellerLens)(); + * ``` + * + * (thanks to https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1223795056 for this style + * of using generics in JSDoc) + * + * In .ts, of course, you could just use: + * + * ```ts + * const sellerLens = createSellerLens(); + * ``` + * + * @template TSeller + * @template {ScSLike<{ organizer: TSeller }> | SlotLike<{ provider: TSeller }>} TOpportunity + * @returns {import('ramda').Lens} + */ +declare function createSellerLens | SlotNoIfuLike<{ + provider: TSeller; +}> | SlotIfuLike<{ + provider: TSeller; +}>>(): R.Lens; +export {}; diff --git a/built-types/index.d.ts b/built-types/index.d.ts index 9f049cb..1e3937e 100644 --- a/built-types/index.d.ts +++ b/built-types/index.d.ts @@ -6,6 +6,7 @@ import { validateReq } from "./expressUtils"; import { validateReqQuery } from "./expressUtils"; import { getHerokuReleaseInfo } from "./herokuUtils"; import { Lenses } from "./lenses"; +import { genericLenses } from "./genericLenses"; export declare namespace expressUtils { export { validateReq }; export { validateReqQuery }; @@ -13,4 +14,4 @@ export declare namespace expressUtils { export declare namespace herokuUtils { export { getHerokuReleaseInfo }; } -export { logger, kongSecretMiddleware, postgres, syncDbMigrations, Lenses }; +export { logger, kongSecretMiddleware, postgres, syncDbMigrations, Lenses, genericLenses }; diff --git a/built-types/lenses.d.ts b/built-types/lenses.d.ts index c593006..93218ea 100644 --- a/built-types/lenses.d.ts +++ b/built-types/lenses.d.ts @@ -58,7 +58,7 @@ export type SearchIsBookingRequestFacilityUseSlotType = ({ 'imin:fullAddress'?: string | null | undefined; }) | null | undefined; telephone?: string | null | undefined; - email?: string | null | undefined; /** @type {TOpportunity} */ + email?: string | null | undefined; logo?: ({ type: "ImageObject"; } & { @@ -89,7 +89,6 @@ export type SearchIsBookingRequestFacilityUseSlotType = ({ latestCancellationBeforeStartDate?: string | null | undefined; validFromBeforeStartDate?: string | null | undefined; validThroughBeforeStartDate?: string | null | undefined; - /** @type {import('ramda').Lens } */ availableChannel?: string[] | null | undefined; prepayment?: string | null | undefined; advanceBooking?: string | null | undefined; @@ -1072,7 +1071,7 @@ export type GetSlotByIdResponseType = ({ provider: { type: "Organization"; } & { - description?: string | null | undefined; /** @type {SearchIsBookingRequestFacilityUseSlotType} */ + description?: string | null | undefined; name?: string | null | undefined; id?: string | null | undefined; identifier?: string | number | null | undefined; @@ -1119,7 +1118,7 @@ export type GetSlotByIdResponseType = ({ latestCancellationBeforeStartDate?: string | null | undefined; validFromBeforeStartDate?: string | null | undefined; validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; /** @type {import('ramda').Lens } */ + availableChannel?: string[] | null | undefined; prepayment?: string | null | undefined; advanceBooking?: string | null | undefined; allowCustomerCancellationFullRefund?: boolean | null | undefined; @@ -1665,7 +1664,7 @@ export type GetSlotByIdResponseType = ({ _stripeConnectedAccountId?: string | null | undefined; _gitCommit?: string | null | undefined; }); -export type TOpportunity = ({ +export type Opportunity = ({ type: "Slot"; id: string; identifier: string; @@ -1725,7 +1724,7 @@ export type TOpportunity = ({ 'imin:fullAddress'?: string | null | undefined; }) | null | undefined; telephone?: string | null | undefined; - email?: string | null | undefined; /** @type {TOpportunity} */ + email?: string | null | undefined; logo?: ({ type: "ImageObject"; } & { @@ -1756,7 +1755,6 @@ export type TOpportunity = ({ latestCancellationBeforeStartDate?: string | null | undefined; validFromBeforeStartDate?: string | null | undefined; validThroughBeforeStartDate?: string | null | undefined; - /** @type {import('ramda').Lens } */ availableChannel?: string[] | null | undefined; prepayment?: string | null | undefined; advanceBooking?: string | null | undefined; @@ -2340,7 +2338,7 @@ export type TOpportunity = ({ provider: { type: "Organization"; } & { - description?: string | null | undefined; /** @type {SearchIsBookingRequestFacilityUseSlotType} */ + description?: string | null | undefined; name?: string | null | undefined; id?: string | null | undefined; identifier?: string | number | null | undefined; @@ -2387,7 +2385,7 @@ export type TOpportunity = ({ latestCancellationBeforeStartDate?: string | null | undefined; validFromBeforeStartDate?: string | null | undefined; validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; /** @type {import('ramda').Lens } */ + availableChannel?: string[] | null | undefined; prepayment?: string | null | undefined; advanceBooking?: string | null | undefined; allowCustomerCancellationFullRefund?: boolean | null | undefined; @@ -2959,7 +2957,7 @@ export type PlaceType = { name?: string | null | undefined; id?: string | null | undefined; identifier?: string | number | null | undefined; - url?: string | null | undefined; /** @type {import('ramda').Lens } */ + url?: string | null | undefined; telephone?: string | null | undefined; 'beta:formattedDescription'?: string | null | undefined; }; @@ -3198,15 +3196,21 @@ export type SearchIsBookingRequestFacilityUseType = { attendeeInstructions?: string | null | undefined; }; export namespace Lenses { - const seller: import('ramda').Lens; - const providerId: import('ramda').Lens; - const name: import('ramda').Lens; - const place: import('ramda').Lens; - const facilityUse: import('ramda').Lens; - const offers: import('ramda').Lens; - const aggregateOffer: R.Lens; - const remainingCapacity: import('ramda').Lens; - const maxCapacity: import('ramda').Lens; + const seller: R.Lens | import("./genericLenses").SlotNoIfuLike<{ + provider: any; + }> | import("./genericLenses").SlotIfuLike<{ + provider: any; + }>, any>; + const providerId: import('ramda').Lens; + const name: import('ramda').Lens; + const place: import('ramda').Lens; + const facilityUse: import('ramda').Lens; + const offers: import('ramda').Lens; + const aggregateOffer: R.Lens; + const remainingCapacity: import('ramda').Lens; + const maxCapacity: import('ramda').Lens; namespace util { const throwErrorIfUsed: import('ramda').Lens; } diff --git a/src/genericLenses.js b/src/genericLenses.js index dd6c8c1..c829240 100644 --- a/src/genericLenses.js +++ b/src/genericLenses.js @@ -112,30 +112,6 @@ function opportunityTypeLens(lensByOpportunityType) { return R.lens(opportunityTypeGetter, opportunityTypeSetter); } -// /** -// * @template TSeller -// * @param {ScSLike2<{ organizer: TSeller }> | SlotLike2<{ provider: TSeller }>} opportunityTemplate -// * @returns {import('ramda').Lens | SlotLike2<{ provider: TSeller }>, TSeller>} -// */ -// function createSellerLens(opportunityTemplate) { -// return opportunityTypeLens({ -// scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), -// slot: createSlotLensForFacilityUseProperty(['provider']), -// }); -// } - -// /** -// * @template TSeller -// * @param {import('@imin/speck/lib/types').Speck | SlotLike2<{ provider: TSeller }>, any>} opportunitySpeck -// * @returns {import('ramda').Lens | SlotLike2<{ provider: TSeller }>, TSeller>} -// */ -// function createSellerLens2(opportunitySpeck) { -// return opportunityTypeLens({ -// scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), -// slot: createSlotLensForFacilityUseProperty(['provider']), -// }); -// } - /** * How to use in JSDoc (the `*\` is an intentional mistake to allow this to fit into a JSDoc. Correct it * in order to use it): @@ -174,77 +150,3 @@ module.exports = { opportunityTypeLens, genericLenses, }; - -// /** -// * - 1: -// * - Cons: -// * - If no speck is forthcoming, we have to arbitrarily create an object or do something like type{Type}(type {any}(null)) -// * - 2: -// * - Pros: -// * - When we have a speck, this is the most convenient -// * - Cons: -// * - If no speck forthcoming, this cannot be used -// * - 3: -// * - Pros: -// * - In a sense, simple. Doesn't involve pretending to use entities -// * - In .ts files, this would be the actual solution, which means that this works best when able to use .ts files -// * - Cons: -// * - This is the most fiddly -// */ - -// const MinimalSlotNoIfu = s.type({ -// type: s.literal('Slot'), -// facilityUse: s.type({ -// type: s.literal('FacilityUse'), -// provider: Organizer, -// }), -// }); - -// const MinimalSlotIfu = s.type({ -// type: s.literal('Slot'), -// facilityUse: s.type({ -// type: s.literal('IndividualFacilityUse'), -// facilityUse: s.type({ -// type: s.literal('FacilityUse'), -// provider: Organizer, -// }), -// }), -// }); - -// const Opp = s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]); - -// /** -// * @typedef {import('@imin/speck/lib/types').TypeOf} OppType -// */ - -// const S = createSellerLens(s.gen(s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]))) - -// const aS = R.view(S, s.gen(BsBookableScheduledSession)); -// const aS_1 = R.view(S, s.gen(MinimalSlotNoIfu)); -// const aS_2 = R.view(S, s.gen(MinimalSlotIfu)); -// const aS_3 = R.view(S, s.gen(MinimalSlotIfu)); -// const aS_4 = R.view(S, s.gen(s.unionObjects([BsBookableScheduledSession, s.unionObjects([MinimalSlotNoIfu, MinimalSlotIfu])]))); - -// const x = null; -// const Sa = createSellerLens(/** @type {OppType} */(/** @type {any} */(null))); -// const aSa = R.view(Sa, s.gen(BsBookableScheduledSession)); -// const aSa_1 = R.view(Sa, s.gen(MinimalSlotNoIfu)); -// const aSa_2 = R.view(Sa, s.gen(MinimalSlotIfu)); -// const aSa_3 = R.view(Sa, s.gen(MinimalSlotIfu)); -// const aSa_4 = R.view(Sa, s.gen(Opp)); - -// const S2 = createSellerLens2(Opp); -// const aS2 = R.view(S2, s.gen(BsBookableScheduledSession)); -// const aS2_1 = R.view(S2, s.gen(MinimalSlotNoIfu)); -// const aS2_2 = R.view(S2, s.gen(MinimalSlotIfu)); -// const aS2_3 = R.view(S2, s.gen(MinimalSlotIfu)); -// const aS2_4 = R.view(S2, s.gen(Opp)); - -// /** @type {typeof createSellerLens3} */ -// const createSellerLens3Opp = createSellerLens3; -// const S3 = createSellerLens3Opp(); -// const aS3 = R.view(S3, s.gen(BsBookableScheduledSession)); -// const aS3_1 = R.view(S3, s.gen(MinimalSlotNoIfu)); -// const aS3_2 = R.view(S3, s.gen(MinimalSlotIfu)); -// const aS3_3 = R.view(S3, s.gen(MinimalSlotIfu)); -// const aS3_4 = R.view(S3, s.gen(Opp)); From 787782d620c2b1ea55dadb6f256fec9b52acd1a3 Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Tue, 25 Oct 2022 11:54:45 +0100 Subject: [PATCH 3/7] fix: Upgrade TS to 4.2 to support ramda --- built-types/lenses.d.ts | 3204 +---------------------------- built-types/logger.d.ts | 2 +- built-types/syncDbMigrations.d.ts | 10 +- package-lock.json | 14 +- package.json | 2 +- 5 files changed, 18 insertions(+), 3214 deletions(-) diff --git a/built-types/lenses.d.ts b/built-types/lenses.d.ts index c593006..ebda6d5 100644 --- a/built-types/lenses.d.ts +++ b/built-types/lenses.d.ts @@ -1,3202 +1,14 @@ -export type SearchIsBookingRequestFacilityUseSlotType = ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; /** @type {TOpportunity} */ - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - /** @type {import('ramda').Lens } */ - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -}) | ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - type: "IndividualFacilityUse"; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - location?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - provider?: ({ - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }) | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -}); -export type BsBookableScheduledSessionType = { - type: "ScheduledSession"; - id: string; - identifier: string; - startDate: string; - _rpdeId: string; - superEvent: { - type: "SessionSeries"; - id: string; - identifier: string; - offers: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[]; - location: { - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - superEvent: { - name: string; - type: "EventSeries"; - id: string; - identifier: string; - organizer: ({ - type: "Person"; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - givenName?: string | null | undefined; - familyName?: string | null | undefined; - email?: string | null | undefined; - 'imin:is13OrOver'?: boolean | null | undefined; - hasAccount?: string | null | undefined; - }) | ({ - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }); - 'imin:locationSummary': ({ - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - })[]; - } & { - description?: string | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - '@context'?: string[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - genderRestriction?: string | null | undefined; - isAccessibleForFree?: boolean | null | undefined; - eventAttendanceMode?: string | null | undefined; - 'beta:isVirtuallyCoached'?: boolean | null | undefined; - 'beta:isInteractivityPreferred'?: boolean | null | undefined; - 'beta:participantSuppliedEquipment'?: string | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - 'imin:dataSource'?: ({ - type: "WebAPI"; - } & { - identifier?: string | null | undefined; - }) | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - url?: string | null | undefined; - '@context'?: string[] | null | undefined; - 'beta:affiliatedLocation'?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - 'beta:virtualLocation'?: ({ - type: "VirtualLocation"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - url?: string | null | undefined; - }) | null | undefined; - leader?: ({ - type: "Person"; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - givenName?: string | null | undefined; - familyName?: string | null | undefined; - email?: string | null | undefined; - 'imin:is13OrOver'?: boolean | null | undefined; - hasAccount?: string | null | undefined; - }) | ({ - type: "Person"; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - givenName?: string | null | undefined; - familyName?: string | null | undefined; - email?: string | null | undefined; - 'imin:is13OrOver'?: boolean | null | undefined; - hasAccount?: string | null | undefined; - })[] | null | undefined; - eventSchedule?: (({ - type: "Schedule"; - repeatFrequency: string; - scheduleTimezone: string; - scheduledEventType: string; - startTime: string; - endTime: string; - } & { - startDate?: string | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - byDay?: ("https://schema.org/Monday" | "https://schema.org/Tuesday" | "https://schema.org/Wednesday" | "https://schema.org/Thursday" | "https://schema.org/Friday" | "https://schema.org/Saturday" | "https://schema.org/Sunday" | "schema:Monday" | "schema:Tuesday" | "schema:Wednesday" | "schema:Thursday" | "schema:Friday" | "schema:Saturday" | "schema:Sunday")[] | null | undefined; - byMonth?: number[] | null | undefined; - byMonthDay?: number[] | null | undefined; - repeatCount?: number | null | undefined; - exceptDate?: string[] | null | undefined; - urlTemplate?: string | null | undefined; - idTemplate?: string | null | undefined; - }) | ({ - type: "PartialSchedule"; - } & { - startTime?: string | null | undefined; - endTime?: string | null | undefined; - repeatFrequency?: string | null | undefined; - byDay?: ("https://schema.org/Monday" | "https://schema.org/Tuesday" | "https://schema.org/Wednesday" | "https://schema.org/Thursday" | "https://schema.org/Friday" | "https://schema.org/Saturday" | "https://schema.org/Sunday" | "schema:Monday" | "schema:Tuesday" | "schema:Wednesday" | "schema:Thursday" | "schema:Friday" | "schema:Saturday" | "schema:Sunday")[] | null | undefined; - byMonth?: number[] | null | undefined; - byMonthDay?: number[] | null | undefined; - duration?: string | null | undefined; - endDate?: string | null | undefined; - exceptDate?: string[] | null | undefined; - repeatCount?: number | null | undefined; - scheduleTimezone?: string | null | undefined; - startDate?: string | null | undefined; - }))[] | null | undefined; - }; - _provider: string; -} & { - '@context'?: string[] | null | undefined; - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - location?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - 'beta:affiliatedLocation'?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - 'beta:virtualLocation'?: ({ - type: "VirtualLocation"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - url?: string | null | undefined; - }) | null | undefined; - isAccessibleForFree?: boolean | null | undefined; - eventAttendanceMode?: string | null | undefined; - maximumAttendeeCapacity?: number | null | undefined; - remainingAttendeeCapacity?: number | null | undefined; - endDate?: string | null | undefined; - eventStatus?: "https://schema.org/EventCancelled" | "https://schema.org/EventPostponed" | "https://schema.org/EventRescheduled" | "https://schema.org/EventScheduled" | "schema:EventCancelled" | "schema:EventPostponed" | "schema:EventRescheduled" | "schema:EventScheduled" | null | undefined; - duration?: string | null | undefined; - maximumVirtualAttendeeCapacity?: number | null | undefined; -}; -export type GetSlotByIdResponseType = ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; /** @type {SearchIsBookingRequestFacilityUseSlotType} */ - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; /** @type {import('ramda').Lens } */ - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -} & { - _stripeConnectedAccountId?: string | null | undefined; - _gitCommit?: string | null | undefined; -}) | ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - type: "IndividualFacilityUse"; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - location?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - provider?: ({ - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }) | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -} & { - _stripeConnectedAccountId?: string | null | undefined; - _gitCommit?: string | null | undefined; -}); -export type TOpportunity = ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; /** @type {TOpportunity} */ - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - /** @type {import('ramda').Lens } */ - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -}) | ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - type: "IndividualFacilityUse"; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - location?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - provider?: ({ - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }) | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -}) | import("@imin/shared-data-types/src/booking/BsBookableScheduledSession").BsBookableScheduledSessionType | ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; /** @type {SearchIsBookingRequestFacilityUseSlotType} */ - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; /** @type {import('ramda').Lens } */ - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -} & { - _stripeConnectedAccountId?: string | null | undefined; - _gitCommit?: string | null | undefined; -}) | ({ - type: "Slot"; - id: string; - identifier: string; - startDate: string; - remainingUses: number; - maximumUses: number; - facilityUse: { - type: "IndividualFacilityUse"; - facilityUse: { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; - } & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; - }; - } & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - location?: ({ - type: "Place"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - geo?: ({ - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }) | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - provider?: ({ - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }) | null | undefined; - attendeeInstructions?: string | null | undefined; - }; -} & { - offers?: ({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - endDate?: string | null | undefined; - duration?: string | null | undefined; - 'imin:checkoutUrlTemplate'?: string | null | undefined; -} & { - _stripeConnectedAccountId?: string | null | undefined; - _gitCommit?: string | null | undefined; -}); +export type SearchIsBookingRequestFacilityUseSlotType = import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseSlotType; +export type BsBookableScheduledSessionType = import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').BsBookableScheduledSessionType; +export type GetSlotByIdResponseType = import('@imin/shared-data-types/src/booking/GetSlotByIdResponse').GetSlotByIdResponseType; +export type TOpportunity = SearchIsBookingRequestFacilityUseSlotType | BsBookableScheduledSessionType | GetSlotByIdResponseType; /** * // even though this is from the ScS, the FacilityUsePlace is exactly the same model */ -export type PlaceType = { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; -} & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; /** @type {import('ramda').Lens } */ - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; -}; -export type Organizer = ({ - type: "Person"; -} & { - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - givenName?: string | null | undefined; - familyName?: string | null | undefined; - email?: string | null | undefined; - 'imin:is13OrOver'?: boolean | null | undefined; - hasAccount?: string | null | undefined; -}) | ({ - type: "Organization"; -} & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; -}); -export type OfferType = { - type: "Offer"; -} & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; -}; -export type SearchIsBookingRequestFacilityUseType = { - name: string; - type: "FacilityUse"; - id: string; - identifier: string; - location: { - type: "Place"; - address: { - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }; - geo: { - type: "GeoCoordinates"; - } & { - latitude?: number | null | undefined; - longitude?: number | null | undefined; - }; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - telephone?: string | null | undefined; - 'beta:formattedDescription'?: string | null | undefined; - }; - _rpdeId: string; - _providerId: string; - provider: { - type: "Organization"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - url?: string | null | undefined; - address?: ({ - type: "PostalAddress"; - } & { - addressCountry?: "GB" | null | undefined; - postalCode?: string | null | undefined; - addressRegion?: string | null | undefined; - addressLocality?: string | null | undefined; - streetAddress?: string | null | undefined; - 'imin:fullAddress'?: string | null | undefined; - }) | null | undefined; - telephone?: string | null | undefined; - email?: string | null | undefined; - logo?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - }) | null | undefined; - sameAs?: string[] | null | undefined; - isOpenBookingAllowed?: boolean | null | undefined; - }; -} & { - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - '@context'?: string[] | null | undefined; - offers?: (({ - type: "Offer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }) | ({ - type: "beta:IndicativeOffer"; - } & { - description?: string | null | undefined; - name?: string | null | undefined; - id?: string | null | undefined; - identifier?: string | number | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - ageRange?: ({ - type: "QuantitativeValue"; - } & { - maxValue?: number | null | undefined; - minValue?: number | null | undefined; - }) | null | undefined; - acceptedPaymentMethod?: string[] | null | undefined; - latestCancellationBeforeStartDate?: string | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - availableChannel?: string[] | null | undefined; - prepayment?: string | null | undefined; - advanceBooking?: string | null | undefined; - allowCustomerCancellationFullRefund?: boolean | null | undefined; - openBookingFlowRequirement?: "https://openactive.io/OpenBookingIntakeForm" | "https://openactive.io/OpenBookingAttendeeDetails" | "https://openactive.io/OpenBookingApproval" | "https://openactive.io/OpenBookingNegotiation" | "https://openactive.io/OpenBookingMessageExchange" | "oa:OpenBookingIntakeForm" | "oa:OpenBookingAttendeeDetails" | "oa:OpenBookingApproval" | "oa:OpenBookingNegotiation" | "oa:OpenBookingMessageExchange" | null | undefined; - openBookingInAdvance?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - openBookingPrepayment?: "https://openactive.io/Required" | "https://openactive.io/Optional" | "https://openactive.io/Unavailable" | "oa:Required" | "oa:Optional" | "oa:Unavailable" | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - }))[] | null | undefined; - activity?: ({ - type: "Concept"; - } & { - id?: string | null | undefined; - inScheme?: string | null | undefined; - prefLabel?: string | null | undefined; - })[] | null | undefined; - 'imin:aggregateOffer'?: ({ - type: "imin:AggregateOffer"; - } & { - publicAdult?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - publicJunior?: ({ - type: "AggregateOffer"; - } & { - id?: string | null | undefined; - price?: number | null | undefined; - priceCurrency?: "GBP" | null | undefined; - validFromBeforeStartDate?: string | null | undefined; - validThroughBeforeStartDate?: string | null | undefined; - 'imin:membershipRequired'?: boolean | null | undefined; - '_imin:isPotentiallyBookable'?: boolean | null | undefined; - }) | null | undefined; - '_imin:entitlementOffersDict'?: Record | null | undefined; - }) | null | undefined; - image?: ({ - type: "ImageObject"; - } & { - url?: string | null | undefined; - })[] | null | undefined; - category?: string[] | null | undefined; - attendeeInstructions?: string | null | undefined; -}; +export type PlaceType = import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').LocationSummaryLocationType; +export type Organizer = import('@imin/shared-data-types/src/modellingSpec/common').OrganizerType; +export type OfferType = import('@imin/shared-data-types/src/modellingSpec/common').OfferType; +export type SearchIsBookingRequestFacilityUseType = import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseType; export namespace Lenses { const seller: import('ramda').Lens; const providerId: import('ramda').Lens; diff --git a/built-types/logger.d.ts b/built-types/logger.d.ts index 8481376..3bf9ad1 100644 --- a/built-types/logger.d.ts +++ b/built-types/logger.d.ts @@ -1,3 +1,3 @@ -export type AxiosError = import("axios").AxiosError; +export type AxiosError = import('axios').AxiosError; export const logger: winston.Logger; import winston = require("winston"); diff --git a/built-types/syncDbMigrations.d.ts b/built-types/syncDbMigrations.d.ts index c236d3b..0a21299 100644 --- a/built-types/syncDbMigrations.d.ts +++ b/built-types/syncDbMigrations.d.ts @@ -1,12 +1,4 @@ -export type PostgresConnectionDetails = { - user: string; - password: string; - host: string; - database: string; - appName: string; - numConnections?: number | null | undefined; - isRds?: boolean | null | undefined; -}; +export type PostgresConnectionDetails = import('./postgres').PostgresConnectionDetails; /** * See: https://db-migrate.readthedocs.io/en/latest/API/programable/#:~:text=cmdoptions */ diff --git a/package-lock.json b/package-lock.json index 2a1ada9..0ed8011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@types/node": "^14.14.19", "@types/pg": "^7.14.7", "axios": "^0.25.0", - "typescript": "^4.1.3" + "typescript": "^4.2.4" }, "engines": { "node": ">=14.15.0", @@ -1846,9 +1846,9 @@ } }, "node_modules/typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -3468,9 +3468,9 @@ } }, "typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", "dev": true }, "unpipe": { diff --git a/package.json b/package.json index 8809e73..c42fd87 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/node": "^14.14.19", "@types/pg": "^7.14.7", "axios": "^0.25.0", - "typescript": "^4.1.3" + "typescript": "^4.2.4" }, "engines": { "node": ">=14.15.0", From fcb9593d6e695f53224dc0eddb8f478bd6b11c3f Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Tue, 25 Oct 2022 12:02:57 +0100 Subject: [PATCH 4/7] TS version -> 4.7.4 --- .vscode/settings.json | 3 +++ built-types/genericLenses.d.ts | 4 +--- built-types/lenses.d.ts | 26 ++++++++++++++++++++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- 5 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 built-types/lenses.d.ts diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3662b37 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} \ No newline at end of file diff --git a/built-types/genericLenses.d.ts b/built-types/genericLenses.d.ts index 7dd7929..398583b 100644 --- a/built-types/genericLenses.d.ts +++ b/built-types/genericLenses.d.ts @@ -99,9 +99,7 @@ import R = require("ramda"); */ declare function createSellerLens | SlotNoIfuLike<{ - provider: TSeller; -}> | SlotIfuLike<{ +}> | SlotLike<{ provider: TSeller; }>>(): R.Lens; export {}; diff --git a/built-types/lenses.d.ts b/built-types/lenses.d.ts new file mode 100644 index 0000000..21f97e7 --- /dev/null +++ b/built-types/lenses.d.ts @@ -0,0 +1,26 @@ +export type SearchIsBookingRequestFacilityUseSlotType = import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseSlotType; +export type BsBookableScheduledSessionType = import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').BsBookableScheduledSessionType; +export type GetSlotByIdResponseType = import('@imin/shared-data-types/src/booking/GetSlotByIdResponse').GetSlotByIdResponseType; +export type Opportunity = SearchIsBookingRequestFacilityUseSlotType | BsBookableScheduledSessionType | GetSlotByIdResponseType; +/** + * // even though this is from the ScS, the FacilityUsePlace is exactly the same model + */ +export type PlaceType = import('@imin/shared-data-types/src/booking/BsBookableScheduledSession').LocationSummaryLocationType; +export type Organizer = import('@imin/shared-data-types/src/modellingSpec/common').OrganizerType; +export type OfferType = import('@imin/shared-data-types/src/modellingSpec/common').OfferType; +export type SearchIsBookingRequestFacilityUseType = import('@imin/shared-data-types/src/search/SearchIsBookingRequestFacilityUseSlot').SearchIsBookingRequestFacilityUseType; +export namespace Lenses { + const seller: R.Lens; + const providerId: import('ramda').Lens; + const name: import('ramda').Lens; + const place: import('ramda').Lens; + const facilityUse: import('ramda').Lens; + const offers: import('ramda').Lens; + const aggregateOffer: R.Lens; + const remainingCapacity: import('ramda').Lens; + const maxCapacity: import('ramda').Lens; + namespace util { + const throwErrorIfUsed: import('ramda').Lens; + } +} +import R = require("ramda"); diff --git a/package-lock.json b/package-lock.json index 0ed8011..9d9ff52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@types/node": "^14.14.19", "@types/pg": "^7.14.7", "axios": "^0.25.0", - "typescript": "^4.2.4" + "typescript": "^4.7.4" }, "engines": { "node": ">=14.15.0", @@ -1846,9 +1846,9 @@ } }, "node_modules/typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -3468,9 +3468,9 @@ } }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true }, "unpipe": { diff --git a/package.json b/package.json index c42fd87..4bd7e04 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/node": "^14.14.19", "@types/pg": "^7.14.7", "axios": "^0.25.0", - "typescript": "^4.2.4" + "typescript": "^4.7.4" }, "engines": { "node": ">=14.15.0", From 5e224ea1e084470daff7533c51b50fd8f923ddf1 Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Wed, 26 Oct 2022 15:54:11 +0100 Subject: [PATCH 5/7] allow for generic lens fields to be optional --- built-types/genericLenses.d.ts | 6 +++--- src/genericLenses.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/built-types/genericLenses.d.ts b/built-types/genericLenses.d.ts index 398583b..807198a 100644 --- a/built-types/genericLenses.d.ts +++ b/built-types/genericLenses.d.ts @@ -94,12 +94,12 @@ import R = require("ramda"); * ``` * * @template TSeller - * @template {ScSLike<{ organizer: TSeller }> | SlotLike<{ provider: TSeller }>} TOpportunity + * @template {ScSLike<{ organizer?: TSeller }> | SlotLike<{ provider?: TSeller }>} TOpportunity * @returns {import('ramda').Lens} */ declare function createSellerLens | SlotLike<{ - provider: TSeller; + provider?: TSeller | undefined; }>>(): R.Lens; export {}; diff --git a/src/genericLenses.js b/src/genericLenses.js index c829240..8bcdcc8 100644 --- a/src/genericLenses.js +++ b/src/genericLenses.js @@ -130,7 +130,7 @@ function opportunityTypeLens(lensByOpportunityType) { * ``` * * @template TSeller - * @template {ScSLike<{ organizer: TSeller }> | SlotLike<{ provider: TSeller }>} TOpportunity + * @template {ScSLike<{ organizer?: TSeller }> | SlotLike<{ provider?: TSeller }>} TOpportunity * @returns {import('ramda').Lens} */ function createSellerLens() { From 1f94f01277b519749e0a22697860ad81d0eec4af Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Fri, 4 Nov 2022 10:01:07 +0000 Subject: [PATCH 6/7] Place & name generic lenses --- src/genericLenses.js | 97 +++++++++++++++++++++++++++++++++++++------- src/lenses.js | 18 ++++---- 2 files changed, 89 insertions(+), 26 deletions(-) diff --git a/src/genericLenses.js b/src/genericLenses.js index 8bcdcc8..38d8ec7 100644 --- a/src/genericLenses.js +++ b/src/genericLenses.js @@ -17,11 +17,12 @@ const R = require('ramda'); /** * @template TEventSeriesFields + * @template TSessionSeriesFields * @typedef {{ * type: 'ScheduledSession', * superEvent: { * superEvent: TEventSeriesFields - * } + * } & TSessionSeriesFields, * }} ScSLike */ @@ -75,7 +76,7 @@ function createSlotLensForFacilityUseProperty(propertyPath) { } /** - * @template {ScSLike} TScS + * @template {ScSLike} TScS * @template {SlotLike} TSlot * @param {{ * scs?: import('ramda').Lens, @@ -112,9 +113,84 @@ function opportunityTypeLens(lensByOpportunityType) { return R.lens(opportunityTypeGetter, opportunityTypeSetter); } +/** + * @template TSeller + * @template {ScSLike<{ organizer?: TSeller }, any> | SlotLike<{ provider?: TSeller }>} TOpportunity + * @returns {import('ramda').Lens} + */ +function createSellerLens() { + // > Type 'Lens | ScSLike, any>' is not assignable to type 'Lens' + return /** @type {any} */(opportunityTypeLens({ + scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), + slot: createSlotLensForFacilityUseProperty(['provider']), + })); +} + +/** + * @template {string | null | undefined} TName + * @template {ScSLike<{ name?: TName }, any> | SlotLike<{ name?: TName }>} TOpportunity + * @returns {import('ramda').Lens} + */ +function createNameLens() { + return /** @type {any} */(opportunityTypeLens({ + scs: R.lensPath(['superEvent', 'superEvent', 'name']), + slot: createSlotLensForFacilityUseProperty(['name']), + })); +} + +/* It would be nice to have a generic createPlaceLens() that searches either EventSeries +imin:locationSummary or SessionSeries location (for sessions). I believe this is relatively easy +(but fiddly for existing use cases). + +The only reason we haven't done that here is that there is not yet a use case where a fully formed Place +could be either in [EventSeries].imin:locationSummary or [SessionSeries].location */ + +/** + * Lens for the Opportunity's Place. For ScheduledSessions, this searches imin:locationSummary. + * Therefore, this is the function to use when dealing with Opportunities that have come from imin + * Search. + * + * Pre-condition: + * - The EventSeries, if it has a location summary, only has one item which has + * the same location as the ScheduledSession's SessionSeries. + * I believe this is how the Search ScS by-id endpoint works. + * + * @template TPlace + * @template {ScSLike<{ 'imin:locationSummary'?: TPlace[] }, any> | SlotLike<{ location?: TPlace }>} TOpportunity + * @returns {import('ramda').Lens} + */ +function createLocationSummaryLens() { + /* TODO a more sophisticated operation might be to get the imin:locationSummary item with the ID + that matches superEvent.location.id. This would then allow for an imin:locationSummary with + multiple items and thus allow us to remove our pre-condition */ + return /** @type {any} */(opportunityTypeLens({ + scs: R.lensPath(['superEvent', 'superEvent', 'imin:locationSummary', '0']), + slot: createSlotLensForFacilityUseProperty(['location']), + })); +} + +/** + * Lens for the Opportunity's Place. For ScheduledSessions, this searches SessionSeries location. + * Therefore, this is the function to use when dealing with Opportunities that have come from an + * OpenActive Data Source. + * + * @template TPlace + * @template {ScSLike | SlotLike<{ location?: TPlace }>} TOpportunity + * @returns {import('ramda').Lens} + */ +function createLocationLens() { + /* TODO a more sophisticated operation might be to get the imin:locationSummary item with the ID + that matches superEvent.location.id. This would then allow for an imin:locationSummary with + multiple items and thus allow us to remove our pre-condition */ + return /** @type {any} */(opportunityTypeLens({ + scs: R.lensPath(['superEvent', 'location']), + slot: createSlotLensForFacilityUseProperty(['location']), + })); +} + /** * How to use in JSDoc (the `*\` is an intentional mistake to allow this to fit into a JSDoc. Correct it - * in order to use it): + * in order to use it), on, as an example, `createSellerLens`: * * ```js * const sellerLens = /** @type {typeof createSellerLens} *\(createSellerLens)(); @@ -128,21 +204,12 @@ function opportunityTypeLens(lensByOpportunityType) { * ```ts * const sellerLens = createSellerLens(); * ``` - * - * @template TSeller - * @template {ScSLike<{ organizer?: TSeller }> | SlotLike<{ provider?: TSeller }>} TOpportunity - * @returns {import('ramda').Lens} */ -function createSellerLens() { - // > Type 'Lens | ScSLike, any>' is not assignable to type 'Lens' - return /** @type {any} */(opportunityTypeLens({ - scs: R.lensPath(['superEvent', 'superEvent', 'organizer']), - slot: createSlotLensForFacilityUseProperty(['provider']), - })); -} - const genericLenses = { createSellerLens, + createNameLens, + createLocationSummaryLens, + createLocationLens, }; module.exports = { diff --git a/src/lenses.js b/src/lenses.js index 8048dba..2868587 100644 --- a/src/lenses.js +++ b/src/lenses.js @@ -7,7 +7,11 @@ const R = require('ramda'); const { createSlotLensForFacilityUseProperty, opportunityTypeLens: genericOpportunityTypeLens, - genericLenses: { createSellerLens }, + genericLenses: { + createSellerLens, + createNameLens, + createLocationSummaryLens + }, } = require('./genericLenses'); /** @@ -32,16 +36,8 @@ const Lenses = { scs: R.lensProp('_provider'), slot: createSlotLensForFacilityUseProperty(['_providerId']), }), - /** @type {import('ramda').Lens } */ - name: opportunityTypeLens({ - scs: R.lensPath(['superEvent', 'superEvent', 'name']), - slot: createSlotLensForFacilityUseProperty(['name']), - }), - /** @type {import('ramda').Lens } */ - place: opportunityTypeLens({ - scs: R.lensPath(['superEvent', 'superEvent', 'imin:locationSummary', '0']), - slot: createSlotLensForFacilityUseProperty(['location']), - }), + name: /** @type {typeof createNameLens} */(createNameLens)(), + place: /** @type {typeof createLocationSummaryLens} */(createLocationSummaryLens)(), /** @type {import('ramda').Lens} */ facilityUse: opportunityTypeLens({ slot: createSlotLensForFacilityUseProperty([]), From f160397bcfc05b433f6ccb77976a41610be54b9c Mon Sep 17 00:00:00 2001 From: Luke Winship Date: Mon, 7 Nov 2022 17:11:13 +0000 Subject: [PATCH 7/7] oopstypes --- built-types/genericLenses.d.ts | 77 ++++++++++++++++++++++++---------- built-types/lenses.d.ts | 4 +- 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/built-types/genericLenses.d.ts b/built-types/genericLenses.d.ts index 807198a..4ebbc13 100644 --- a/built-types/genericLenses.d.ts +++ b/built-types/genericLenses.d.ts @@ -1,8 +1,8 @@ -export type ScSLike = { +export type ScSLike = { type: 'ScheduledSession'; superEvent: { superEvent: TEventSeriesFields; - }; + } & TSessionSeriesFields; }; export type SlotNoIfuLike = { type: 'Slot'; @@ -22,11 +22,12 @@ export type SlotIfuLike = { export type SlotLike = SlotNoIfuLike | SlotIfuLike; /** * @template TEventSeriesFields + * @template TSessionSeriesFields * @typedef {{ * type: 'ScheduledSession', * superEvent: { * superEvent: TEventSeriesFields - * } + * } & TSessionSeriesFields, * }} ScSLike */ /** @@ -61,45 +62,75 @@ export type SlotLike = SlotNoIfuLike | S */ export function createSlotLensForFacilityUseProperty>(propertyPath: string[]): R.Lens; /** - * @template {ScSLike} TScS + * @template {ScSLike} TScS * @template {SlotLike} TSlot * @param {{ * scs?: import('ramda').Lens, * slot?: import('ramda').Lens * }} lensByOpportunityType */ -export function opportunityTypeLens, TSlot extends SlotLike>(lensByOpportunityType: { +export function opportunityTypeLens, TSlot extends SlotLike>(lensByOpportunityType: { scs?: R.Lens | undefined; slot?: R.Lens | undefined; }): R.Lens; export namespace genericLenses { export { createSellerLens }; + export { createNameLens }; + export { createLocationSummaryLens }; + export { createLocationLens }; } import R = require("ramda"); /** - * How to use in JSDoc (the `*\` is an intentional mistake to allow this to fit into a JSDoc. Correct it - * in order to use it): - * - * ```js - * const sellerLens = /** @type {typeof createSellerLens} *\(createSellerLens)(); - * ``` - * - * (thanks to https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1223795056 for this style - * of using generics in JSDoc) - * - * In .ts, of course, you could just use: - * - * ```ts - * const sellerLens = createSellerLens(); - * ``` - * * @template TSeller - * @template {ScSLike<{ organizer?: TSeller }> | SlotLike<{ provider?: TSeller }>} TOpportunity + * @template {ScSLike<{ organizer?: TSeller }, any> | SlotLike<{ provider?: TSeller }>} TOpportunity * @returns {import('ramda').Lens} */ declare function createSellerLens | SlotLike<{ +}, any> | SlotLike<{ provider?: TSeller | undefined; }>>(): R.Lens; +/** + * @template {string | null | undefined} TName + * @template {ScSLike<{ name?: TName }, any> | SlotLike<{ name?: TName }>} TOpportunity + * @returns {import('ramda').Lens} + */ +declare function createNameLens | SlotLike<{ + name?: TName | undefined; +}>>(): R.Lens; +/** + * Lens for the Opportunity's Place. For ScheduledSessions, this searches imin:locationSummary. + * Therefore, this is the function to use when dealing with Opportunities that have come from imin + * Search. + * + * Pre-condition: + * - The EventSeries, if it has a location summary, only has one item which has + * the same location as the ScheduledSession's SessionSeries. + * I believe this is how the Search ScS by-id endpoint works. + * + * @template TPlace + * @template {ScSLike<{ 'imin:locationSummary'?: TPlace[] }, any> | SlotLike<{ location?: TPlace }>} TOpportunity + * @returns {import('ramda').Lens} + */ +declare function createLocationSummaryLens | SlotLike<{ + location?: TPlace | undefined; +}>>(): R.Lens; +/** + * Lens for the Opportunity's Place. For ScheduledSessions, this searches SessionSeries location. + * Therefore, this is the function to use when dealing with Opportunities that have come from an + * OpenActive Data Source. + * + * @template TPlace + * @template {ScSLike | SlotLike<{ location?: TPlace }>} TOpportunity + * @returns {import('ramda').Lens} + */ +declare function createLocationLens | SlotLike<{ + location?: TPlace | undefined; +}>>(): R.Lens; export {}; diff --git a/built-types/lenses.d.ts b/built-types/lenses.d.ts index 21f97e7..7bbc347 100644 --- a/built-types/lenses.d.ts +++ b/built-types/lenses.d.ts @@ -12,8 +12,8 @@ export type SearchIsBookingRequestFacilityUseType = import('@imin/shared-data-ty export namespace Lenses { const seller: R.Lens; const providerId: import('ramda').Lens; - const name: import('ramda').Lens; - const place: import('ramda').Lens; + const name: R.Lens; + const place: R.Lens; const facilityUse: import('ramda').Lens; const offers: import('ramda').Lens; const aggregateOffer: R.Lens;