@blazeo.com/appointment-client 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blazeo.com-appointment-client-1.0.14.tgz +0 -0
- package/package.json +3 -2
- package/sample/src/EventTab.jsx +435 -395
- package/src/calendar/calendarCreation.ts +62 -15
- package/src/events/getAppointmentsByFilter.ts +98 -0
- package/src/index.ts +15 -4
- package/blazeo.com-appointment-client-1.0.11.tgz +0 -0
- package/blazeo.com-appointment-client-1.0.13.tgz +0 -0
- package/dist/calendar/blazeoCalendarRelationMethods.d.ts +0 -8
- package/dist/calendar/blazeoCalendarRelationMethods.d.ts.map +0 -1
- package/dist/calendar/blazeoCalendarRelationMethods.js +0 -16
- package/dist/calendar/blazeoCalendarRelationMethods.js.map +0 -1
- package/dist/calendar/buildUnifiedCalendarView.d.ts +0 -39
- package/dist/calendar/buildUnifiedCalendarView.js +0 -301
- package/dist/calendar/calendarCreation.d.ts +0 -27
- package/dist/calendar/calendarCreation.js +0 -191
- package/dist/calendar/calendarCreationFacade.d.ts +0 -27
- package/dist/calendar/calendarCreationFacade.d.ts.map +0 -1
- package/dist/calendar/calendarCreationFacade.js +0 -167
- package/dist/calendar/calendarCreationFacade.js.map +0 -1
- package/dist/calendar/createCalendar.d.ts +0 -81
- package/dist/calendar/createCalendar.d.ts.map +0 -1
- package/dist/calendar/createCalendar.js +0 -206
- package/dist/calendar/createCalendar.js.map +0 -1
- package/dist/calendar/fetchCalendarDetails.d.ts +0 -41
- package/dist/calendar/fetchCalendarDetails.js +0 -265
- package/dist/calendar/fetchCalendarWithOpeningHours.d.ts +0 -25
- package/dist/calendar/fetchCalendarWithOpeningHours.js +0 -114
- package/dist/calendar/getAllParticipantOpeningHours.d.ts +0 -22
- package/dist/calendar/getAllParticipantOpeningHours.js +0 -22
- package/dist/calendar/getCalendarsByCompany.d.ts +0 -9
- package/dist/calendar/getCalendarsByCompany.js +0 -62
- package/dist/calendar/getOpeningHours.d.ts +0 -8
- package/dist/calendar/getOpeningHours.js +0 -9
- package/dist/calendar/getParticipantOpeningHours.d.ts +0 -37
- package/dist/calendar/getParticipantOpeningHours.js +0 -48
- package/dist/calendar/getParticipants.d.ts +0 -7
- package/dist/calendar/getParticipants.js +0 -13
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts +0 -10
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts.map +0 -1
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js +0 -44
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js.map +0 -1
- package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts +0 -29
- package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts.map +0 -1
- package/dist/calendar/mapCalendarToBlazeoSnapshot.js +0 -44
- package/dist/calendar/mapCalendarToBlazeoSnapshot.js.map +0 -1
- package/dist/calendar/mapToDesiredResponse.d.ts +0 -56
- package/dist/calendar/mapToDesiredResponse.js +0 -111
- package/dist/config/applyBlazeoClientConfig.d.ts +0 -3
- package/dist/config/applyBlazeoClientConfig.d.ts.map +0 -1
- package/dist/config/applyBlazeoClientConfig.js +0 -14
- package/dist/config/applyBlazeoClientConfig.js.map +0 -1
- package/dist/config/applyBlazeoDefaults.d.ts +0 -2
- package/dist/config/applyBlazeoDefaults.d.ts.map +0 -1
- package/dist/config/applyBlazeoDefaults.js +0 -14
- package/dist/config/applyBlazeoDefaults.js.map +0 -1
- package/dist/config/blazeo.config.d.ts +0 -11
- package/dist/config/blazeo.config.d.ts.map +0 -1
- package/dist/config/blazeo.config.js +0 -11
- package/dist/config/blazeo.config.js.map +0 -1
- package/dist/config/blazeoClientDefaults.d.ts +0 -11
- package/dist/config/blazeoClientDefaults.d.ts.map +0 -1
- package/dist/config/blazeoClientDefaults.js +0 -11
- package/dist/config/blazeoClientDefaults.js.map +0 -1
- package/dist/config/ensureBlazeoHttpReady.d.ts +0 -17
- package/dist/config/ensureBlazeoHttpReady.js +0 -31
- package/dist/config/initializeAppointmentClient.d.ts +0 -11
- package/dist/config/initializeAppointmentClient.d.ts.map +0 -1
- package/dist/config/initializeAppointmentClient.js +0 -15
- package/dist/config/initializeAppointmentClient.js.map +0 -1
- package/dist/config/syncBlazeoConnection.d.ts +0 -6
- package/dist/config/syncBlazeoConnection.js +0 -18
- package/dist/events/appointmentEventFacade.d.ts +0 -67
- package/dist/events/appointmentEventFacade.d.ts.map +0 -1
- package/dist/events/appointmentEventFacade.js +0 -124
- package/dist/events/appointmentEventFacade.js.map +0 -1
- package/dist/events/mapAppointmentToEventSnapshot.d.ts +0 -5
- package/dist/events/mapAppointmentToEventSnapshot.d.ts.map +0 -1
- package/dist/events/mapAppointmentToEventSnapshot.js +0 -57
- package/dist/events/mapAppointmentToEventSnapshot.js.map +0 -1
- package/dist/exampleData.d.ts +0 -119
- package/dist/exampleData.d.ts.map +0 -1
- package/dist/exampleData.js +0 -71
- package/dist/exampleData.js.map +0 -1
- package/dist/facade/calendarCreationFacade.d.ts +0 -40
- package/dist/facade/calendarCreationFacade.d.ts.map +0 -1
- package/dist/facade/calendarCreationFacade.js +0 -96
- package/dist/facade/calendarCreationFacade.js.map +0 -1
- package/dist/facade/mapCalendarBOToSnapshot.d.ts +0 -10
- package/dist/facade/mapCalendarBOToSnapshot.d.ts.map +0 -1
- package/dist/facade/mapCalendarBOToSnapshot.js +0 -44
- package/dist/facade/mapCalendarBOToSnapshot.js.map +0 -1
- package/dist/facades/index.d.ts +0 -12
- package/dist/facades/index.d.ts.map +0 -1
- package/dist/facades/index.js +0 -12
- package/dist/facades/index.js.map +0 -1
- package/dist/index.d.ts +0 -79
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/lead/fetchLeadDetails.d.ts +0 -56
- package/dist/lead/fetchLeadDetails.js +0 -61
- package/dist/models/CalendarRootModel.d.ts +0 -56
- package/dist/models/CalendarRootModel.d.ts.map +0 -1
- package/dist/models/CalendarRootModel.js +0 -54
- package/dist/models/CalendarRootModel.js.map +0 -1
- package/dist/models/CalendarSlotModel.d.ts +0 -9
- package/dist/models/CalendarSlotModel.d.ts.map +0 -1
- package/dist/models/CalendarSlotModel.js +0 -8
- package/dist/models/CalendarSlotModel.js.map +0 -1
- package/dist/models/EventModel.d.ts +0 -11
- package/dist/models/EventModel.d.ts.map +0 -1
- package/dist/models/EventModel.js +0 -10
- package/dist/models/EventModel.js.map +0 -1
- package/dist/models/ParticipantModel.d.ts +0 -9
- package/dist/models/ParticipantModel.d.ts.map +0 -1
- package/dist/models/ParticipantModel.js +0 -8
- package/dist/models/ParticipantModel.js.map +0 -1
- package/dist/models/index.d.ts +0 -5
- package/dist/models/index.d.ts.map +0 -1
- package/dist/models/index.js +0 -5
- package/dist/models/index.js.map +0 -1
- package/dist/types/appointment.d.ts +0 -28
- package/dist/types/appointment.d.ts.map +0 -1
- package/dist/types/appointment.js +0 -6
- package/dist/types/appointment.js.map +0 -1
- package/dist/types/calendar.d.ts +0 -52
- package/dist/types/calendar.d.ts.map +0 -1
- package/dist/types/calendar.js +0 -6
- package/dist/types/calendar.js.map +0 -1
- package/dist/types/calendarBo.d.ts +0 -62
- package/dist/types/calendarBo.d.ts.map +0 -1
- package/dist/types/calendarBo.js +0 -6
- package/dist/types/calendarBo.js.map +0 -1
- package/sample/package-lock.json +0 -1778
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch all participant opening hours for a calendar.
|
|
3
|
-
* Uses `GET /Calendar/Participant/OpeningHours/All/Get`.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getAllParticipantOpeningHours(calendarId: string, options?: {
|
|
6
|
-
baseUrl?: string;
|
|
7
|
-
consumer?: string;
|
|
8
|
-
}): Promise<{
|
|
9
|
-
openingHours: any[];
|
|
10
|
-
raw: any[];
|
|
11
|
-
meta: {
|
|
12
|
-
ok: true;
|
|
13
|
-
shape: "array";
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
openingHours: any[];
|
|
17
|
-
raw: any;
|
|
18
|
-
meta: {
|
|
19
|
-
ok: boolean;
|
|
20
|
-
shape?: undefined;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CalendarModel } from "@blazeo.com/calendar-client";
|
|
2
|
-
import { ensureBlazeoHttpReady } from "../config/ensureBlazeoHttpReady.js";
|
|
3
|
-
import { normalizeParticipantOpeningHoursResponse } from "./fetchCalendarWithOpeningHours.js";
|
|
4
|
-
/**
|
|
5
|
-
* Fetch all participant opening hours for a calendar.
|
|
6
|
-
* Uses `GET /Calendar/Participant/OpeningHours/All/Get`.
|
|
7
|
-
*/
|
|
8
|
-
export async function getAllParticipantOpeningHours(calendarId, options = {}) {
|
|
9
|
-
const ready = ensureBlazeoHttpReady(options);
|
|
10
|
-
if (!ready.ok) {
|
|
11
|
-
throw new Error(ready.error);
|
|
12
|
-
}
|
|
13
|
-
const raw = await CalendarModel.getAllParticipantOpeningHours(calendarId);
|
|
14
|
-
// calendar-client static helper returns either `unknown[] | null` or an envelope depending on version/entrypoint.
|
|
15
|
-
if (Array.isArray(raw)) {
|
|
16
|
-
return { openingHours: raw, raw, meta: { ok: true, shape: "array" } };
|
|
17
|
-
}
|
|
18
|
-
const { list } = normalizeParticipantOpeningHoursResponse(raw);
|
|
19
|
-
const openingHours = Array.isArray(list) ? list : [];
|
|
20
|
-
const ok = Array.isArray(list) ? true : raw?.status === "success";
|
|
21
|
-
return { openingHours, raw, meta: { ok: !!ok } };
|
|
22
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches all calendars for a company and populates each with its members (participants).
|
|
3
|
-
* Uses a highly optimized single-request approach per calendar to ensure speed in list views.
|
|
4
|
-
* Results are normalized via mapToDesiredCalendarResponse.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getCalendarsByCompany(companyKey: string, connection?: {
|
|
7
|
-
baseUrl?: string;
|
|
8
|
-
consumer?: string;
|
|
9
|
-
}): Promise<any[]>;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { CalendarModel, CalendarParticipantModel } from "@blazeo.com/calendar-client";
|
|
2
|
-
import { ensureBlazeoHttpReady } from "../config/ensureBlazeoHttpReady.js";
|
|
3
|
-
import { mapToDesiredCalendarResponse } from "./mapToDesiredResponse.js";
|
|
4
|
-
/**
|
|
5
|
-
* Fetches all calendars for a company and populates each with its members (participants).
|
|
6
|
-
* Uses a highly optimized single-request approach per calendar to ensure speed in list views.
|
|
7
|
-
* Results are normalized via mapToDesiredCalendarResponse.
|
|
8
|
-
*/
|
|
9
|
-
export async function getCalendarsByCompany(companyKey, connection = {}) {
|
|
10
|
-
const ready = ensureBlazeoHttpReady(connection);
|
|
11
|
-
if (!ready.ok) {
|
|
12
|
-
throw new Error(ready.error);
|
|
13
|
-
}
|
|
14
|
-
// 1. Get all calendars for the company
|
|
15
|
-
const result = await CalendarModel.getByCompany(companyKey);
|
|
16
|
-
const calendars = Array.isArray(result) ? result : result?.calendars ?? [];
|
|
17
|
-
if (!calendars || calendars.length === 0) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
// 2. Fetch lightweight members for each calendar in parallel
|
|
21
|
-
const enrichedCalendars = await Promise.all(calendars.map(async (cal) => {
|
|
22
|
-
const calendarId = cal.calendarId ?? String(cal.id ?? "");
|
|
23
|
-
if (!calendarId)
|
|
24
|
-
return null;
|
|
25
|
-
try {
|
|
26
|
-
// Optimization: Use only getInfoByCalendar to get names/emails in a single request.
|
|
27
|
-
// This is much faster for a list view than fetching both list and info records.
|
|
28
|
-
const infoRaw = await CalendarParticipantModel.getInfoByCalendar(calendarId);
|
|
29
|
-
const info = Array.isArray(infoRaw) ? infoRaw : infoRaw?.info ?? [];
|
|
30
|
-
// Merge logic to ensure names are matched to IDs
|
|
31
|
-
const membersMap = new Map();
|
|
32
|
-
// Use participantId GUID as the primary key
|
|
33
|
-
const getAnyId = (obj) => obj.participantId ?? obj.ParticipantId ?? obj.participant_id ?? obj.id ?? obj.Id;
|
|
34
|
-
// 1. Process info list (Name, Email, Alias)
|
|
35
|
-
info.forEach((i) => {
|
|
36
|
-
const mid = getAnyId(i);
|
|
37
|
-
if (!mid)
|
|
38
|
-
return;
|
|
39
|
-
const key = String(mid).toLowerCase();
|
|
40
|
-
const resolvedEmail = i.email ?? i.Email ?? i.userSsoEmail ?? i.UserSsoEmail;
|
|
41
|
-
const memberData = {
|
|
42
|
-
id: mid,
|
|
43
|
-
name: i.name ?? i.Name ?? i.alias ?? i.Alias ?? "Member",
|
|
44
|
-
email: resolvedEmail,
|
|
45
|
-
status: i.status ?? i.Status ?? 1,
|
|
46
|
-
};
|
|
47
|
-
if (!membersMap.has(key)) {
|
|
48
|
-
membersMap.set(key, memberData);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const members = Array.from(membersMap.values());
|
|
52
|
-
// Use the unified mapper to ensure all properties (duration, calendarId, etc.) are included
|
|
53
|
-
return mapToDesiredCalendarResponse(cal, [], members);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
console.error(`[getCalendarsByCompany] Error fetching members for ${calendarId}:`, err);
|
|
57
|
-
// Fallback to minimal mapping if enrichment fails
|
|
58
|
-
return mapToDesiredCalendarResponse(cal, [], []);
|
|
59
|
-
}
|
|
60
|
-
}));
|
|
61
|
-
return enrichedCalendars.filter(Boolean);
|
|
62
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetches opening hours for a calendar.
|
|
3
|
-
* Automatically handles embedded calendar-level hours and participant-level fallbacks.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getOpeningHours(calendarId: string, options?: {
|
|
6
|
-
baseUrl?: string;
|
|
7
|
-
consumer?: string;
|
|
8
|
-
}): Promise<any>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { fetchCalendarWithOpeningHours } from "./fetchCalendarWithOpeningHours.js";
|
|
2
|
-
/**
|
|
3
|
-
* Fetches opening hours for a calendar.
|
|
4
|
-
* Automatically handles embedded calendar-level hours and participant-level fallbacks.
|
|
5
|
-
*/
|
|
6
|
-
export async function getOpeningHours(calendarId, options = {}) {
|
|
7
|
-
const result = await fetchCalendarWithOpeningHours(calendarId, options);
|
|
8
|
-
return result.openingHours;
|
|
9
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Direct wrapper around `calendar.getParticipantOpeningHours()` for a calendar id.
|
|
3
|
-
*
|
|
4
|
-
* This hits `GET /Calendar/Participant/OpeningHours/Get` (server-side shape may vary),
|
|
5
|
-
* so we also return a normalized list alongside the raw response.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getParticipantOpeningHours(calendarId: string, options?: any): Promise<{
|
|
8
|
-
openingHours: any[];
|
|
9
|
-
raw: any;
|
|
10
|
-
meta: {
|
|
11
|
-
ok: false;
|
|
12
|
-
reason: string;
|
|
13
|
-
count?: undefined;
|
|
14
|
-
status?: undefined;
|
|
15
|
-
error?: undefined;
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
openingHours: any[];
|
|
19
|
-
raw: any;
|
|
20
|
-
meta: {
|
|
21
|
-
ok: true;
|
|
22
|
-
count: number;
|
|
23
|
-
status: any;
|
|
24
|
-
reason?: undefined;
|
|
25
|
-
error?: undefined;
|
|
26
|
-
};
|
|
27
|
-
} | {
|
|
28
|
-
openingHours: any[];
|
|
29
|
-
raw: any;
|
|
30
|
-
meta: {
|
|
31
|
-
ok: false;
|
|
32
|
-
reason: string;
|
|
33
|
-
error: string;
|
|
34
|
-
count?: undefined;
|
|
35
|
-
status?: undefined;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { CalendarModel } from "@blazeo.com/calendar-client";
|
|
2
|
-
import { resolveBlazeoConnection } from "./createCalendar.js";
|
|
3
|
-
import { unwrapCalendarGetData, normalizeParticipantOpeningHoursResponse } from "./fetchCalendarWithOpeningHours.js";
|
|
4
|
-
/**
|
|
5
|
-
* Direct wrapper around `calendar.getParticipantOpeningHours()` for a calendar id.
|
|
6
|
-
*
|
|
7
|
-
* This hits `GET /Calendar/Participant/OpeningHours/Get` (server-side shape may vary),
|
|
8
|
-
* so we also return a normalized list alongside the raw response.
|
|
9
|
-
*/
|
|
10
|
-
export async function getParticipantOpeningHours(calendarId, options = {}) {
|
|
11
|
-
try {
|
|
12
|
-
const { baseUrl, consumer, ...passThrough } = options;
|
|
13
|
-
const { baseUrl: resolvedBase, consumer: resolvedConsumer } = resolveBlazeoConnection({ baseUrl, consumer });
|
|
14
|
-
const rawRes = await CalendarModel.getRaw(calendarId);
|
|
15
|
-
const payload = unwrapCalendarGetData(rawRes);
|
|
16
|
-
if (!payload) {
|
|
17
|
-
return {
|
|
18
|
-
openingHours: [],
|
|
19
|
-
raw: null,
|
|
20
|
-
meta: { ok: false, reason: "calendar_not_found" },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const cal = CalendarModel.create({ ...payload, calendarId }, { baseUrl: resolvedBase, consumer: resolvedConsumer });
|
|
24
|
-
const raw = await cal.getParticipantOpeningHours({ calendarId, ...(passThrough ?? {}) });
|
|
25
|
-
const { list } = normalizeParticipantOpeningHoursResponse(raw);
|
|
26
|
-
const openingHours = Array.isArray(list) ? list : [];
|
|
27
|
-
return {
|
|
28
|
-
openingHours,
|
|
29
|
-
raw,
|
|
30
|
-
meta: {
|
|
31
|
-
ok: true,
|
|
32
|
-
count: openingHours.length,
|
|
33
|
-
status: raw?.status ?? (raw?.Status || "unknown"),
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
return {
|
|
39
|
-
openingHours: [],
|
|
40
|
-
raw: null,
|
|
41
|
-
meta: {
|
|
42
|
-
ok: false,
|
|
43
|
-
reason: "exception",
|
|
44
|
-
error: err instanceof Error ? err.message : String(err),
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CalendarModel } from "@blazeo.com/calendar-client";
|
|
2
|
-
import { ensureBlazeoHttpReady } from "../config/ensureBlazeoHttpReady.js";
|
|
3
|
-
/**
|
|
4
|
-
* Fetches participants for a calendar.
|
|
5
|
-
*/
|
|
6
|
-
export async function getParticipants(calendarId, options = {}) {
|
|
7
|
-
const ready = ensureBlazeoHttpReady(options);
|
|
8
|
-
if (!ready.ok) {
|
|
9
|
-
throw new Error(ready.error);
|
|
10
|
-
}
|
|
11
|
-
const participants = await CalendarModel.getParticipants(calendarId);
|
|
12
|
-
return Array.isArray(participants) ? participants : [];
|
|
13
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CalendarBOInput } from "../types/calendar.js";
|
|
2
|
-
/**
|
|
3
|
-
* Maps Apex `CalendarBO`-shaped input to a snapshot for
|
|
4
|
-
* {@link CalendarModel.create} from `@blazeo.com/calendar-client`.
|
|
5
|
-
*
|
|
6
|
-
* Only fields that exist on Blazeo's `Calendar` model are included so MST does not receive
|
|
7
|
-
* unknown keys or invalid `null`s on optional numbers.
|
|
8
|
-
*/
|
|
9
|
-
export declare function mapCalendarBOToSnapshot(bo: CalendarBOInput): Record<string, unknown>;
|
|
10
|
-
//# sourceMappingURL=mapCalendarBoToBlazeoSnapshot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapCalendarBoToBlazeoSnapshot.d.ts","sourceRoot":"","sources":["../../src/calendar/mapCalendarBoToBlazeoSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAc9D;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,eAAe,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8BzB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** Default enum values aligned with ApexFlows / Blazeo (`AssignmentMethod`, `Unit`). */
|
|
2
|
-
const DEFAULT_ASSIGNMENT_METHOD = 1;
|
|
3
|
-
const DEFAULT_UNIT_MINUTES = 1;
|
|
4
|
-
/**
|
|
5
|
-
* For Blazeo `Calendar` MST: `types.optional(types.number)` accepts `undefined` (uses default)
|
|
6
|
-
* but not `null`. Coerce null/absent to `undefined`.
|
|
7
|
-
*/
|
|
8
|
-
function optionalNumber(v) {
|
|
9
|
-
return v == null ? undefined : v;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Maps Apex `CalendarBO`-shaped input to a snapshot for
|
|
13
|
-
* {@link CalendarModel.create} from `@blazeo.com/calendar-client`.
|
|
14
|
-
*
|
|
15
|
-
* Only fields that exist on Blazeo's `Calendar` model are included so MST does not receive
|
|
16
|
-
* unknown keys or invalid `null`s on optional numbers.
|
|
17
|
-
*/
|
|
18
|
-
export function mapCalendarBOToSnapshot(bo) {
|
|
19
|
-
const calendarId = bo.calendarId ?? bo.thirdPartyCalendarId ?? "new";
|
|
20
|
-
return {
|
|
21
|
-
id: bo.serverId == null ? undefined : bo.serverId,
|
|
22
|
-
companyKey: bo.companyKey ?? null,
|
|
23
|
-
calendarId,
|
|
24
|
-
name: bo.name ?? null,
|
|
25
|
-
timeZoneId: bo.timeZoneId ?? null,
|
|
26
|
-
purpose: bo.purpose ?? bo.bookingPageTitle ?? "",
|
|
27
|
-
description: bo.description ?? null,
|
|
28
|
-
assignmentMethod: bo.assignmentMethod ?? bo.assignmentType ?? DEFAULT_ASSIGNMENT_METHOD,
|
|
29
|
-
duration: optionalNumber(bo.duration) ?? 30,
|
|
30
|
-
durationUnit: optionalNumber(bo.durationUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
31
|
-
minimumBookingNotice: optionalNumber(bo.minimumBookingNotice) ?? 0,
|
|
32
|
-
minimumBookingNoticeUnit: optionalNumber(bo.minimumBookingNoticeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
33
|
-
minimumCancelationNotice: optionalNumber(bo.minimumCancelationNotice) ?? 0,
|
|
34
|
-
minimumCancelationNoticeUnit: optionalNumber(bo.minimumCancelationNoticeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
35
|
-
futureLimit: optionalNumber(bo.futureLimit) ?? 0,
|
|
36
|
-
futureLimitUnit: optionalNumber(bo.futureLimitUnit) ?? 3,
|
|
37
|
-
bufferTime: optionalNumber(bo.bufferTime),
|
|
38
|
-
bufferTimeUnit: optionalNumber(bo.bufferTimeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
39
|
-
bookingLimit: optionalNumber(bo.bookingLimit),
|
|
40
|
-
createdOn: bo.createdOn ?? null,
|
|
41
|
-
modifiedOn: bo.modifiedOn ?? null,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=mapCalendarBoToBlazeoSnapshot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapCalendarBoToBlazeoSnapshot.js","sourceRoot":"","sources":["../../src/calendar/mapCalendarBoToBlazeoSnapshot.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;GAGG;AACH,SAAS,cAAc,CAAC,CAA4B;IAClD,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,EAAmB;IAEnB,MAAM,UAAU,GACd,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC,oBAAoB,IAAI,KAAK,CAAC;IAEpD,OAAO;QACL,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ;QACjD,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;QACjC,UAAU;QACV,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrB,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;QACjC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,gBAAgB,IAAI,EAAE;QAChD,WAAW,EAAE,EAAE,CAAC,WAAW,IAAI,IAAI;QACnC,gBAAgB,EACd,EAAE,CAAC,gBAAgB,IAAI,EAAE,CAAC,cAAc,IAAI,yBAAyB;QACvE,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC3C,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,oBAAoB;QACrE,oBAAoB,EAAE,cAAc,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;QAClE,wBAAwB,EACtB,cAAc,CAAC,EAAE,CAAC,wBAAwB,CAAC,IAAI,oBAAoB;QACrE,wBAAwB,EAAE,cAAc,CAAC,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAC1E,4BAA4B,EAC1B,cAAc,CAAC,EAAE,CAAC,4BAA4B,CAAC,IAAI,oBAAoB;QACzE,WAAW,EAAE,cAAc,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;QAChD,eAAe,EAAE,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QACxD,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC,UAAU,CAAC;QACzC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,oBAAoB;QACzE,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,YAAY,CAAC;QAC7C,SAAS,EAAE,EAAE,CAAC,SAAS,IAAI,IAAI;QAC/B,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps Apex `CalendarBO`-shaped input to a snapshot for
|
|
3
|
-
* {@link CalendarModel.create} from `@blazeo.com/calendar-client`.
|
|
4
|
-
*
|
|
5
|
-
* Only fields that exist on Blazeo's `Calendar` model are included so MST does not receive
|
|
6
|
-
* unknown keys or invalid `null`s on optional numbers.
|
|
7
|
-
*/
|
|
8
|
-
export declare function mapCalendarBOToSnapshot(bo: any): {
|
|
9
|
-
companyKey: any;
|
|
10
|
-
calendarId: any;
|
|
11
|
-
name: any;
|
|
12
|
-
timeZoneId: any;
|
|
13
|
-
purpose: any;
|
|
14
|
-
description: any;
|
|
15
|
-
assignmentMethod: any;
|
|
16
|
-
duration: any;
|
|
17
|
-
durationUnit: any;
|
|
18
|
-
minimumBookingNotice: any;
|
|
19
|
-
minimumBookingNoticeUnit: any;
|
|
20
|
-
minimumCancelationNotice: any;
|
|
21
|
-
minimumCancelationNoticeUnit: any;
|
|
22
|
-
futureLimit: any;
|
|
23
|
-
futureLimitUnit: any;
|
|
24
|
-
bufferTime: any;
|
|
25
|
-
bufferTimeUnit: any;
|
|
26
|
-
bookingLimit: any;
|
|
27
|
-
createdOn: any;
|
|
28
|
-
modifiedOn: any;
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapCalendarToBlazeoSnapshot.d.ts","sourceRoot":"","sources":["../../src/calendar/mapCalendarToBlazeoSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAc1D;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,aAAa,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BzB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** Default enum values aligned with ApexFlows / Blazeo (`AssignmentMethod`, `Unit`). */
|
|
2
|
-
const DEFAULT_ASSIGNMENT_METHOD = 1;
|
|
3
|
-
const DEFAULT_UNIT_MINUTES = 1;
|
|
4
|
-
/**
|
|
5
|
-
* For Blazeo `Calendar` MST: `types.optional(types.number)` accepts `undefined` (uses default)
|
|
6
|
-
* but not `null`. Coerce null/absent to `undefined`.
|
|
7
|
-
*/
|
|
8
|
-
function optionalNumber(v) {
|
|
9
|
-
return v == null ? undefined : v;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Maps Apex `CalendarBO`-shaped input to a snapshot for
|
|
13
|
-
* {@link CalendarModel.create} from `@blazeo.com/calendar-client`.
|
|
14
|
-
*
|
|
15
|
-
* Only fields that exist on Blazeo's `Calendar` model are included so MST does not receive
|
|
16
|
-
* unknown keys or invalid `null`s on optional numbers.
|
|
17
|
-
*/
|
|
18
|
-
export function mapCalendarBOToSnapshot(bo) {
|
|
19
|
-
const c = globalThis.crypto;
|
|
20
|
-
const generatedId = c?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
21
|
-
const calendarId = bo.calendarId ?? generatedId;
|
|
22
|
-
return {
|
|
23
|
-
companyKey: bo.companyKey ?? null,
|
|
24
|
-
calendarId,
|
|
25
|
-
name: bo.name ?? null,
|
|
26
|
-
timeZoneId: bo.timeZoneId ?? null,
|
|
27
|
-
purpose: bo.purpose ?? bo.bookingPageTitle ?? "",
|
|
28
|
-
description: bo.description ?? null,
|
|
29
|
-
assignmentMethod: bo.assignmentMethod ?? bo.assignmentType ?? DEFAULT_ASSIGNMENT_METHOD,
|
|
30
|
-
duration: optionalNumber(bo.duration) ?? 30,
|
|
31
|
-
durationUnit: optionalNumber(bo.durationUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
32
|
-
minimumBookingNotice: optionalNumber(bo.minimumBookingNotice) ?? 0,
|
|
33
|
-
minimumBookingNoticeUnit: optionalNumber(bo.minimumBookingNoticeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
34
|
-
minimumCancelationNotice: optionalNumber(bo.minimumCancelationNotice) ?? 0,
|
|
35
|
-
minimumCancelationNoticeUnit: optionalNumber(bo.minimumCancelationNoticeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
36
|
-
futureLimit: optionalNumber(bo.futureLimit) ?? 0,
|
|
37
|
-
futureLimitUnit: optionalNumber(bo.futureLimitUnit) ?? 3,
|
|
38
|
-
bufferTime: optionalNumber(bo.bufferTime),
|
|
39
|
-
bufferTimeUnit: optionalNumber(bo.bufferTimeUnit) ?? DEFAULT_UNIT_MINUTES,
|
|
40
|
-
bookingLimit: optionalNumber(bo.bookingLimit),
|
|
41
|
-
createdOn: bo.createdOn ?? null,
|
|
42
|
-
modifiedOn: bo.modifiedOn ?? null,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapCalendarToBlazeoSnapshot.js","sourceRoot":"","sources":["../../src/calendar/mapCalendarToBlazeoSnapshot.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;GAGG;AACH,SAAS,cAAc,CAAC,CAA4B;IAClD,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,EAAiB;IAEjB,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;IAC5B,MAAM,WAAW,GACf,CAAC,EAAE,UAAU,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAClF,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,IAAI,WAAW,CAAC;IAEhD,OAAO;QACL,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;QACjC,UAAU;QACV,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrB,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;QACjC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,gBAAgB,IAAI,EAAE;QAChD,WAAW,EAAE,EAAE,CAAC,WAAW,IAAI,IAAI;QACnC,gBAAgB,EACd,EAAE,CAAC,gBAAgB,IAAI,EAAE,CAAC,cAAc,IAAI,yBAAyB;QACvE,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC3C,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,oBAAoB;QACrE,oBAAoB,EAAE,cAAc,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;QAClE,wBAAwB,EACtB,cAAc,CAAC,EAAE,CAAC,wBAAwB,CAAC,IAAI,oBAAoB;QACrE,wBAAwB,EAAE,cAAc,CAAC,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAC1E,4BAA4B,EAC1B,cAAc,CAAC,EAAE,CAAC,4BAA4B,CAAC,IAAI,oBAAoB;QACzE,WAAW,EAAE,cAAc,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;QAChD,eAAe,EAAE,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QACxD,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC,UAAU,CAAC;QACzC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,oBAAoB;QACzE,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,YAAY,CAAC;QAC7C,SAAS,EAAE,EAAE,CAAC,SAAS,IAAI,IAAI;QAC/B,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,IAAI;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps a raw Blazeo API calendar payload (often PascalCase) to the specific camelCase
|
|
3
|
-
* shape requested by the user, including typenames and normalized fields.
|
|
4
|
-
*/
|
|
5
|
-
export declare function mapToDesiredCalendarResponse(payload: any, openingHours?: any[], members?: any[]): {
|
|
6
|
-
id: number | null;
|
|
7
|
-
durationUnit: number | null;
|
|
8
|
-
minimumBookingNotice: number | null;
|
|
9
|
-
minimumBookingNoticeUnit: number | null;
|
|
10
|
-
minimumCancelationNotice: number | null;
|
|
11
|
-
minimumCancelationNoticeUnit: number | null;
|
|
12
|
-
futureLimit: number | null;
|
|
13
|
-
futureLimitUnit: number | null;
|
|
14
|
-
bufferTime: number | null;
|
|
15
|
-
bufferTimeUnit: number | null;
|
|
16
|
-
calendarLink: any;
|
|
17
|
-
uuid: any;
|
|
18
|
-
calendarId: any;
|
|
19
|
-
location: any;
|
|
20
|
-
bookingPageTitle: any;
|
|
21
|
-
reminderChannelStatuses: {
|
|
22
|
-
id: any;
|
|
23
|
-
calendarId: any;
|
|
24
|
-
channelId: any;
|
|
25
|
-
status: boolean;
|
|
26
|
-
appointmentReminders: any;
|
|
27
|
-
__typename: string;
|
|
28
|
-
}[];
|
|
29
|
-
members: {
|
|
30
|
-
id: any;
|
|
31
|
-
name: any;
|
|
32
|
-
email: any;
|
|
33
|
-
status: any;
|
|
34
|
-
__typename: string;
|
|
35
|
-
}[];
|
|
36
|
-
createdOn: any;
|
|
37
|
-
modifiedOn: any;
|
|
38
|
-
name: any;
|
|
39
|
-
timeZoneId: any;
|
|
40
|
-
description: any;
|
|
41
|
-
assignmentType: number | null;
|
|
42
|
-
duration: number | null;
|
|
43
|
-
bookingLimit: number | null;
|
|
44
|
-
calendarJson: any;
|
|
45
|
-
isThirdPartySaved: boolean;
|
|
46
|
-
themeId: number | null;
|
|
47
|
-
theme: {
|
|
48
|
-
id: any;
|
|
49
|
-
color: any;
|
|
50
|
-
logoUrl: any;
|
|
51
|
-
__typename: string;
|
|
52
|
-
} | null;
|
|
53
|
-
openingHours: any[];
|
|
54
|
-
appointmentUserDefinedFields: any;
|
|
55
|
-
__typename: string;
|
|
56
|
-
} | null;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps a raw Blazeo API calendar payload (often PascalCase) to the specific camelCase
|
|
3
|
-
* shape requested by the user, including typenames and normalized fields.
|
|
4
|
-
*/
|
|
5
|
-
export function mapToDesiredCalendarResponse(payload, openingHours = [], members = []) {
|
|
6
|
-
if (!payload)
|
|
7
|
-
return null;
|
|
8
|
-
const pick = (obj, ...keys) => {
|
|
9
|
-
for (const k of keys) {
|
|
10
|
-
if (obj[k] !== undefined && obj[k] !== null)
|
|
11
|
-
return obj[k];
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
const n = (v) => (v != null && v !== "" ? Number(v) : null);
|
|
16
|
-
// Map members with typename
|
|
17
|
-
const mappedMembers = members.map(m => ({
|
|
18
|
-
id: m.id ?? pick(m, "id", "Id"),
|
|
19
|
-
name: m.name ?? pick(m, "name", "Name", "alias", "Alias"),
|
|
20
|
-
email: m.email ?? pick(m, "email", "Email") ?? null,
|
|
21
|
-
status: m.status ?? pick(m, "status", "Status") ?? 0,
|
|
22
|
-
__typename: "Member"
|
|
23
|
-
}));
|
|
24
|
-
// Map opening hours with typename and raw fields
|
|
25
|
-
const mappedOpeningHours = openingHours.map(oh => {
|
|
26
|
-
// If it's already a unified object (has day/start/end), preserve it but ensure __typename
|
|
27
|
-
if (oh.day !== undefined && oh.start !== undefined && oh.end !== undefined) {
|
|
28
|
-
return {
|
|
29
|
-
...oh,
|
|
30
|
-
__typename: "OpeningHour"
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
// Otherwise, map from raw PascalCase or camelCase
|
|
34
|
-
return {
|
|
35
|
-
id: pick(oh, "id", "Id") ?? 0,
|
|
36
|
-
createdOn: pick(oh, "createdOn", "CreatedOn", "created_on") ?? "0001-01-01T00:00:00.000Z",
|
|
37
|
-
modifiedOn: pick(oh, "modifiedOn", "ModifiedOn", "modified_on") ?? "0001-01-01T00:00:00.000Z",
|
|
38
|
-
member: pick(oh, "member", "Member"),
|
|
39
|
-
openingHourId: pick(oh, "openingHourId", "OpeningHourId", "opening_hour_id") ?? "",
|
|
40
|
-
calendarId: pick(oh, "calendarId", "CalendarId", "calendar_id") ?? "",
|
|
41
|
-
participantId: pick(oh, "participantId", "ParticipantId", "participant_id") ?? "",
|
|
42
|
-
days: oh.days ?? [],
|
|
43
|
-
startHour: oh.startHour ?? pick(oh, "startHour", "StartHour") ?? 0,
|
|
44
|
-
startMinute: oh.startMinute ?? pick(oh, "startMinute", "StartMinute") ?? 0,
|
|
45
|
-
endHour: oh.endHour ?? pick(oh, "endHour", "EndHour") ?? 0,
|
|
46
|
-
endMinute: oh.endMinute ?? pick(oh, "endMinute", "EndMinute") ?? 0,
|
|
47
|
-
off: !!(oh.off ?? pick(oh, "off", "Off")),
|
|
48
|
-
__typename: "OpeningHour"
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
// Map theme
|
|
52
|
-
const rawTheme = pick(payload, "theme", "Theme");
|
|
53
|
-
const theme = rawTheme ? {
|
|
54
|
-
id: pick(rawTheme, "id", "Id"),
|
|
55
|
-
color: pick(rawTheme, "color", "Color"),
|
|
56
|
-
logoUrl: pick(rawTheme, "logoUrl", "LogoUrl") ?? null,
|
|
57
|
-
__typename: "Theme"
|
|
58
|
-
} : null;
|
|
59
|
-
// Map reminders
|
|
60
|
-
const rawReminders = pick(payload, "reminderChannelStatuses", "ReminderChannelStatuses") ?? [];
|
|
61
|
-
const reminderChannelStatuses = Array.isArray(rawReminders) ? rawReminders.map((r) => ({
|
|
62
|
-
id: pick(r, "id", "Id"),
|
|
63
|
-
calendarId: pick(r, "calendarId", "CalendarId"),
|
|
64
|
-
channelId: pick(r, "channelId", "ChannelId"),
|
|
65
|
-
status: !!pick(r, "status", "Status"),
|
|
66
|
-
appointmentReminders: (pick(r, "appointmentReminders", "AppointmentReminders") ?? []).map((ar) => ({
|
|
67
|
-
id: pick(ar, "id", "Id"),
|
|
68
|
-
reminderChannelStatusId: pick(ar, "reminderChannelStatusId", "ReminderChannelStatusId"),
|
|
69
|
-
recipientType: pick(ar, "recipientType", "RecipientType"),
|
|
70
|
-
beforeEventTime: pick(ar, "beforeEventTime", "BeforeEventTime"),
|
|
71
|
-
unit: pick(ar, "unit", "Unit"),
|
|
72
|
-
__typename: "AppointmentReminder"
|
|
73
|
-
})),
|
|
74
|
-
__typename: "ReminderChannelStatus"
|
|
75
|
-
})) : [];
|
|
76
|
-
const uuid = pick(payload, "uuid", "Uuid", "calendarId", "CalendarId");
|
|
77
|
-
return {
|
|
78
|
-
id: n(pick(payload, "id", "Id")),
|
|
79
|
-
durationUnit: n(pick(payload, "durationUnit", "DurationUnit")),
|
|
80
|
-
minimumBookingNotice: n(pick(payload, "minimumBookingNotice", "MinimumBookingNotice")),
|
|
81
|
-
minimumBookingNoticeUnit: n(pick(payload, "minimumBookingNoticeUnit", "MinimumBookingNoticeUnit")),
|
|
82
|
-
minimumCancelationNotice: n(pick(payload, "minimumCancelationNotice", "MinimumCancelationNotice")),
|
|
83
|
-
minimumCancelationNoticeUnit: n(pick(payload, "minimumCancelationNoticeUnit", "MinimumCancelationNoticeUnit")),
|
|
84
|
-
futureLimit: n(pick(payload, "futureLimit", "FutureLimit")),
|
|
85
|
-
futureLimitUnit: n(pick(payload, "futureLimitUnit", "FutureLimitUnit")),
|
|
86
|
-
bufferTime: n(pick(payload, "bufferTime", "BufferTime")),
|
|
87
|
-
bufferTimeUnit: n(pick(payload, "bufferTimeUnit", "BufferTimeUnit")),
|
|
88
|
-
calendarLink: pick(payload, "calendarLink", "CalendarLink"),
|
|
89
|
-
uuid: uuid,
|
|
90
|
-
calendarId: uuid, // Explicit alias requested by user
|
|
91
|
-
location: pick(payload, "location", "Location") ?? "",
|
|
92
|
-
bookingPageTitle: pick(payload, "bookingPageTitle", "BookingPageTitle") ?? null,
|
|
93
|
-
reminderChannelStatuses,
|
|
94
|
-
members: mappedMembers,
|
|
95
|
-
createdOn: pick(payload, "createdOn", "CreatedOn") ?? "0001-01-01T00:00:00.000Z",
|
|
96
|
-
modifiedOn: pick(payload, "modifiedOn", "ModifiedOn") ?? "0001-01-01T00:00:00.000Z",
|
|
97
|
-
name: pick(payload, "name", "Name"),
|
|
98
|
-
timeZoneId: pick(payload, "timeZoneId", "TimeZoneId"),
|
|
99
|
-
description: pick(payload, "description", "Description") ?? "",
|
|
100
|
-
assignmentType: n(pick(payload, "assignmentType", "AssignmentType", "assignmentMethod", "AssignmentMethod")),
|
|
101
|
-
duration: n(pick(payload, "duration", "Duration")),
|
|
102
|
-
bookingLimit: n(pick(payload, "bookingLimit", "BookingLimit")),
|
|
103
|
-
calendarJson: pick(payload, "calendarJson", "CalendarJson") ?? null,
|
|
104
|
-
isThirdPartySaved: !!pick(payload, "isThirdPartySaved", "IsThirdPartySaved"),
|
|
105
|
-
themeId: n(pick(payload, "themeId", "ThemeId")),
|
|
106
|
-
theme,
|
|
107
|
-
openingHours: mappedOpeningHours,
|
|
108
|
-
appointmentUserDefinedFields: pick(payload, "appointmentUserDefinedFields", "AppointmentUserDefinedFields") ?? [],
|
|
109
|
-
__typename: "Calendar"
|
|
110
|
-
};
|
|
111
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applyBlazeoClientConfig.d.ts","sourceRoot":"","sources":["../../src/config/applyBlazeoClientConfig.ts"],"names":[],"mappings":"AAGA,yFAAyF;AACzF,wBAAgB,uBAAuB,IAAI,IAAI,CAS9C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { configure } from "@blazeo.com/calendar-client";
|
|
2
|
-
import { blazeoClientConfig } from "./blazeo.config.js";
|
|
3
|
-
/** Push {@link blazeoClientConfig} into `@blazeo.com/calendar-client` (global store). */
|
|
4
|
-
export function applyBlazeoClientConfig() {
|
|
5
|
-
const baseUrl = blazeoClientConfig.baseUrl?.trim().replace(/\/+$/, "");
|
|
6
|
-
if (!baseUrl)
|
|
7
|
-
return;
|
|
8
|
-
const consumer = blazeoClientConfig.consumer?.trim();
|
|
9
|
-
configure({
|
|
10
|
-
baseUrl,
|
|
11
|
-
...(consumer ? { consumer } : {}),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=applyBlazeoClientConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applyBlazeoClientConfig.js","sourceRoot":"","sources":["../../src/config/applyBlazeoClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,yFAAyF;AACzF,MAAM,UAAU,uBAAuB;IACrC,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrD,SAAS,CAAC;QACR,OAAO;QACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applyBlazeoDefaults.d.ts","sourceRoot":"","sources":["../../src/config/applyBlazeoDefaults.ts"],"names":[],"mappings":"AAGA,sLAAsL;AACtL,wBAAgB,uBAAuB,IAAI,IAAI,CAS9C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { blazeoClientConfig } from "./blazeoClientDefaults.js";
|
|
2
|
-
import { syncBlazeoConnection } from "./syncBlazeoConnection.js";
|
|
3
|
-
/** Push {@link blazeoClientConfig} into `@blazeo.com/calendar-client` (global store). Call explicitly if you use file defaults; otherwise use {@link initializeAppointmentClient}. */
|
|
4
|
-
export function applyBlazeoClientConfig() {
|
|
5
|
-
debugger;
|
|
6
|
-
const baseUrl = blazeoClientConfig.baseUrl?.trim().replace(/\/+$/, "");
|
|
7
|
-
if (!baseUrl)
|
|
8
|
-
return;
|
|
9
|
-
const consumer = blazeoClientConfig.consumer?.trim();
|
|
10
|
-
syncBlazeoConnection({
|
|
11
|
-
baseUrl,
|
|
12
|
-
...(consumer ? { consumer } : {}),
|
|
13
|
-
});
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applyBlazeoDefaults.js","sourceRoot":"","sources":["../../src/config/applyBlazeoDefaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,sLAAsL;AACtL,MAAM,UAAU,uBAAuB;IACrC,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrD,SAAS,CAAC;QACR,OAAO;QACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Central Blazeo API settings for `appointment-client`.
|
|
3
|
-
* Edit once; `configure()` runs when you import this package (see `index.ts`).
|
|
4
|
-
*
|
|
5
|
-
* @example baseUrl: "https://apptscheduling.azurewebsites.net"
|
|
6
|
-
*/
|
|
7
|
-
export declare const blazeoClientConfig: {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
consumer?: string;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=blazeo.config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blazeo.config.d.ts","sourceRoot":"","sources":["../../src/config/blazeo.config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAInB,CAAC"}
|