@blazeo.com/appointment-client 1.0.0 → 1.0.1
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/dist/calendar/blazeoCalendarRelationMethods.d.ts +40 -0
- package/dist/calendar/blazeoCalendarRelationMethods.d.ts.map +1 -0
- package/dist/calendar/blazeoCalendarRelationMethods.js +17 -0
- package/dist/calendar/blazeoCalendarRelationMethods.js.map +1 -0
- package/dist/calendar/calendarCreationFacade.d.ts +37 -0
- package/dist/calendar/calendarCreationFacade.d.ts.map +1 -0
- package/dist/calendar/calendarCreationFacade.js +174 -0
- package/dist/calendar/calendarCreationFacade.js.map +1 -0
- package/dist/calendar/createCalendar.d.ts +51 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -0
- package/dist/calendar/createCalendar.js +208 -0
- package/dist/calendar/createCalendar.js.map +1 -0
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts +10 -0
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts.map +1 -0
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js +44 -0
- package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js.map +1 -0
- package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts +10 -0
- package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts.map +1 -0
- package/dist/calendar/mapCalendarToBlazeoSnapshot.js +44 -0
- package/dist/calendar/mapCalendarToBlazeoSnapshot.js.map +1 -0
- package/dist/config/applyBlazeoClientConfig.d.ts +3 -0
- package/dist/config/applyBlazeoClientConfig.d.ts.map +1 -0
- package/dist/config/applyBlazeoClientConfig.js +14 -0
- package/dist/config/applyBlazeoClientConfig.js.map +1 -0
- package/dist/config/applyBlazeoDefaults.d.ts +3 -0
- package/dist/config/applyBlazeoDefaults.d.ts.map +1 -0
- package/dist/config/applyBlazeoDefaults.js +14 -0
- package/dist/config/applyBlazeoDefaults.js.map +1 -0
- package/dist/config/blazeo.config.d.ts +11 -0
- package/dist/config/blazeo.config.d.ts.map +1 -0
- package/dist/config/blazeo.config.js +11 -0
- package/dist/config/blazeo.config.js.map +1 -0
- package/dist/config/blazeoClientDefaults.d.ts +12 -0
- package/dist/config/blazeoClientDefaults.d.ts.map +1 -0
- package/dist/config/blazeoClientDefaults.js +12 -0
- package/dist/config/blazeoClientDefaults.js.map +1 -0
- package/dist/config/initializeAppointmentClient.d.ts +28 -0
- package/dist/config/initializeAppointmentClient.d.ts.map +1 -0
- package/dist/config/initializeAppointmentClient.js +23 -0
- package/dist/config/initializeAppointmentClient.js.map +1 -0
- package/dist/events/appointmentEventFacade.d.ts +44 -0
- package/dist/events/appointmentEventFacade.d.ts.map +1 -0
- package/dist/events/appointmentEventFacade.js +130 -0
- package/dist/events/appointmentEventFacade.js.map +1 -0
- package/dist/events/mapAppointmentToEventSnapshot.d.ts +8 -0
- package/dist/events/mapAppointmentToEventSnapshot.d.ts.map +1 -0
- package/dist/events/mapAppointmentToEventSnapshot.js +56 -0
- package/dist/events/mapAppointmentToEventSnapshot.js.map +1 -0
- package/dist/exampleData.d.ts +15 -0
- package/dist/exampleData.d.ts.map +1 -0
- package/dist/exampleData.js +72 -0
- package/dist/exampleData.js.map +1 -0
- package/dist/facade/calendarCreationFacade.d.ts +40 -0
- package/dist/facade/calendarCreationFacade.d.ts.map +1 -0
- package/dist/facade/calendarCreationFacade.js +96 -0
- package/dist/facade/calendarCreationFacade.js.map +1 -0
- package/dist/facade/mapCalendarBOToSnapshot.d.ts +10 -0
- package/dist/facade/mapCalendarBOToSnapshot.d.ts.map +1 -0
- package/dist/facade/mapCalendarBOToSnapshot.js +44 -0
- package/dist/facade/mapCalendarBOToSnapshot.js.map +1 -0
- package/dist/facades/index.d.ts +12 -0
- package/dist/facades/index.d.ts.map +1 -0
- package/dist/facades/index.js +12 -0
- package/dist/facades/index.js.map +1 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/models/CalendarRootModel.d.ts +31 -0
- package/dist/models/CalendarRootModel.d.ts.map +1 -0
- package/dist/models/CalendarRootModel.js +37 -0
- package/dist/models/CalendarRootModel.js.map +1 -0
- package/dist/models/CalendarSlotModel.d.ts +9 -0
- package/dist/models/CalendarSlotModel.d.ts.map +1 -0
- package/dist/models/CalendarSlotModel.js +8 -0
- package/dist/models/CalendarSlotModel.js.map +1 -0
- package/dist/models/EventModel.d.ts +11 -0
- package/dist/models/EventModel.d.ts.map +1 -0
- package/dist/models/EventModel.js +10 -0
- package/dist/models/EventModel.js.map +1 -0
- package/dist/models/ParticipantModel.d.ts +9 -0
- package/dist/models/ParticipantModel.d.ts.map +1 -0
- package/dist/models/ParticipantModel.js +8 -0
- package/dist/models/ParticipantModel.js.map +1 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +5 -0
- package/dist/models/index.js.map +1 -0
- package/dist/types/appointment.d.ts +27 -0
- package/dist/types/appointment.d.ts.map +1 -0
- package/dist/types/appointment.js +6 -0
- package/dist/types/appointment.js.map +1 -0
- package/dist/types/calendar.d.ts +62 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +6 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/calendarBo.d.ts +62 -0
- package/dist/types/calendarBo.d.ts.map +1 -0
- package/dist/types/calendarBo.js +6 -0
- package/dist/types/calendarBo.js.map +1 -0
- package/package.json +34 -7
- package/blazeo.com-appointment-client-1.0.0.tgz +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IStateTreeNode } from "mobx-state-tree";
|
|
2
|
+
import type { CalendarBOInput } from "../types/calendarBo.js";
|
|
3
|
+
export type CreateCalendarOptions = {
|
|
4
|
+
/** Overrides `blazeo.config` / global `configure` when set. */
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
consumer?: string;
|
|
7
|
+
/**
|
|
8
|
+
* When true, only builds the MST `Calendar` node (no HTTP).
|
|
9
|
+
* Default false: calls `calendar.create()` → POST `/Calendar/Create`.
|
|
10
|
+
*/
|
|
11
|
+
localOnly?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Typical Blazeo `reqPost` / `calendar.create()` result shape. */
|
|
14
|
+
export type BlazeoCalendarCreateResponse = {
|
|
15
|
+
status: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
data?: unknown;
|
|
18
|
+
};
|
|
19
|
+
export type CreateCalendarSuccess = {
|
|
20
|
+
ok: true;
|
|
21
|
+
calendar: IStateTreeNode;
|
|
22
|
+
apiResponse?: BlazeoCalendarCreateResponse;
|
|
23
|
+
};
|
|
24
|
+
export type CreateCalendarFailure = {
|
|
25
|
+
ok: false;
|
|
26
|
+
error: string;
|
|
27
|
+
apiResponse?: BlazeoCalendarCreateResponse;
|
|
28
|
+
};
|
|
29
|
+
export type CreateCalendarResult = CreateCalendarSuccess | CreateCalendarFailure;
|
|
30
|
+
/** Merge per-call options with global Blazeo config (file + `configure`). */
|
|
31
|
+
export declare function resolveBlazeoConnection(options?: CreateCalendarOptions): {
|
|
32
|
+
baseUrl?: string;
|
|
33
|
+
consumer?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Uses {@link resolveBlazeoConnection} (config file + `configure` + optional overrides),
|
|
37
|
+
* then `CalendarModel.create` and `calendar.create()` unless `localOnly`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createCalendarAsync(calendar: CalendarBOInput, options?: CreateCalendarOptions): Promise<CreateCalendarResult>;
|
|
40
|
+
//# sourceMappingURL=calendarCreationFacade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarCreationFacade.d.ts","sourceRoot":"","sources":["../../src/facade/calendarCreationFacade.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQ9D,MAAM,MAAM,qBAAqB,GAAG;IAClC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,EAAE,4BAA4B,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,4BAA4B,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAMjF,6EAA6E;AAC7E,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,qBAA0B,GAAG;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAgBA;AAkCD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,eAAe,EACzB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CA8D/B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CalendarModel, configure, getConfig } from "@blazeo.com/calendar-client";
|
|
2
|
+
import { blazeoClientConfig } from "../config/blazeo.config.js";
|
|
3
|
+
import { mapCalendarBOToSnapshot } from "./mapCalendarBOToSnapshot.js";
|
|
4
|
+
function isFailureStatus(res) {
|
|
5
|
+
return res.status !== "success" && res.status !== "Success";
|
|
6
|
+
}
|
|
7
|
+
/** Merge per-call options with global Blazeo config (file + `configure`). */
|
|
8
|
+
export function resolveBlazeoConnection(options = {}) {
|
|
9
|
+
const cfg = getConfig();
|
|
10
|
+
const fromFileBase = blazeoClientConfig.baseUrl?.trim().replace(/\/+$/, "");
|
|
11
|
+
const fromFileConsumer = blazeoClientConfig.consumer?.trim();
|
|
12
|
+
const baseUrl = options.baseUrl?.trim().replace(/\/+$/, "") ||
|
|
13
|
+
cfg?.baseUrl?.replace(/\/+$/, "") ||
|
|
14
|
+
(fromFileBase || undefined);
|
|
15
|
+
const consumer = options.consumer?.trim() ||
|
|
16
|
+
cfg?.consumer ||
|
|
17
|
+
(fromFileConsumer || undefined);
|
|
18
|
+
return { baseUrl, consumer };
|
|
19
|
+
}
|
|
20
|
+
function buildModelEnv(baseUrl, consumer, forLocalOnly) {
|
|
21
|
+
if (forLocalOnly && !baseUrl) {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
const cfg = getConfig();
|
|
25
|
+
const env = {};
|
|
26
|
+
if (baseUrl) {
|
|
27
|
+
env.baseUrl = baseUrl;
|
|
28
|
+
}
|
|
29
|
+
else if (cfg?.baseUrl) {
|
|
30
|
+
env.baseUrl = cfg.baseUrl;
|
|
31
|
+
}
|
|
32
|
+
if (consumer) {
|
|
33
|
+
env.consumer = consumer;
|
|
34
|
+
}
|
|
35
|
+
else if (cfg?.consumer) {
|
|
36
|
+
env.consumer = cfg.consumer;
|
|
37
|
+
}
|
|
38
|
+
if (cfg?.fetch != null)
|
|
39
|
+
env.fetch = cfg.fetch;
|
|
40
|
+
if (cfg?.getDefaultOffset != null) {
|
|
41
|
+
env.getDefaultOffset = cfg.getDefaultOffset;
|
|
42
|
+
}
|
|
43
|
+
return env;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Uses {@link resolveBlazeoConnection} (config file + `configure` + optional overrides),
|
|
47
|
+
* then `CalendarModel.create` and `calendar.create()` unless `localOnly`.
|
|
48
|
+
*/
|
|
49
|
+
export async function createCalendarAsync(calendar, options = {}) {
|
|
50
|
+
try {
|
|
51
|
+
const { baseUrl: resolvedBase, consumer: resolvedConsumer } = resolveBlazeoConnection(options);
|
|
52
|
+
if (resolvedBase) {
|
|
53
|
+
configure({
|
|
54
|
+
baseUrl: resolvedBase,
|
|
55
|
+
...(resolvedConsumer ? { consumer: resolvedConsumer } : {}),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const baseUrl = resolvedBase;
|
|
59
|
+
const consumer = resolvedConsumer;
|
|
60
|
+
if (!options.localOnly && !baseUrl) {
|
|
61
|
+
return {
|
|
62
|
+
ok: false,
|
|
63
|
+
error: "baseUrl is missing. Set `blazeoClientConfig.baseUrl` in `appointment-client/src/config/blazeo.config.ts` or call `configure({ baseUrl })`.",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const snapshot = mapCalendarBOToSnapshot(calendar);
|
|
67
|
+
const env = buildModelEnv(baseUrl, consumer, Boolean(options.localOnly));
|
|
68
|
+
if (!options.localOnly && env.baseUrl == null) {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
error: "Model env requires baseUrl. Set `blazeoClientConfig` or pass `baseUrl` in options.",
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const calendarNode = CalendarModel.create(snapshot, env);
|
|
75
|
+
if (options.localOnly) {
|
|
76
|
+
return { ok: true, calendar: calendarNode };
|
|
77
|
+
}
|
|
78
|
+
const apiRes = await calendarNode.create();
|
|
79
|
+
if (isFailureStatus(apiRes)) {
|
|
80
|
+
const msg = apiRes.message ??
|
|
81
|
+
(typeof apiRes.data === "string" ? apiRes.data : undefined) ??
|
|
82
|
+
JSON.stringify(apiRes);
|
|
83
|
+
return {
|
|
84
|
+
ok: false,
|
|
85
|
+
error: msg || "Calendar create failed",
|
|
86
|
+
apiResponse: apiRes,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return { ok: true, calendar: calendarNode, apiResponse: apiRes };
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
return { ok: false, error: message };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=calendarCreationFacade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarCreationFacade.js","sourceRoot":"","sources":["../../src/facade/calendarCreationFacade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAuCvE,SAAS,eAAe,CAAC,GAAiC;IACxD,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC;AAC9D,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,uBAAuB,CAAC,UAAiC,EAAE;IAIzE,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,MAAM,YAAY,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE7D,MAAM,OAAO,GACX,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3C,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACjC,CAAC,YAAY,IAAI,SAAS,CAAC,CAAC;IAE9B,MAAM,QAAQ,GACZ,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;QACxB,GAAG,EAAE,QAAQ;QACb,CAAC,gBAAgB,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AC,CAAC;YACzB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE,GAAG,IAAI,wBAAwB;gBACtC,WAAW,EAAE,MAAM;aACpB,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACnE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CalendarBOInput } from "../types/calendarBo.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=mapCalendarBOToSnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCalendarBOToSnapshot.d.ts","sourceRoot":"","sources":["../../src/facade/mapCalendarBOToSnapshot.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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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=mapCalendarBOToSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapCalendarBOToSnapshot.js","sourceRoot":"","sources":["../../src/facade/mapCalendarBOToSnapshot.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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
|
|
2
|
+
* Public facade surface for `appointment-client`.
|
|
3
|
+
*
|
|
4
|
+
* Call {@link initializeAppointmentClient} from `../config/initializeAppointmentClient.js`
|
|
5
|
+
* before using these APIs in a host application.
|
|
6
|
+
*/
|
|
7
|
+
export { createCalendarAsync, updateCalendarAsync, deleteCalendarAsync, resolveBlazeoConnection, type BlazeoCalendarCreateResponse, type CreateCalendarOptions, type CreateCalendarResult, } from "../calendar/createCalendar.js";
|
|
8
|
+
export { CalendarCreationFacade, createCalendarWithRelationsAsync, updateCalendarWithRelationsAsync, resolveParticipantIdForOpeningHour, type CalendarWithRelationsResult, type CalendarWithRelationsSuccess, } from "../calendar/calendarCreationFacade.js";
|
|
9
|
+
export { addParticipantToCalendar, removeParticipantFromCalendar, saveCalendarOpeningHour, saveCalendarOpeningHoursBatch, type BlazeoCalendarForRelations, type BlazeoCalendarRelationResponse, } from "../calendar/blazeoCalendarRelationMethods.js";
|
|
10
|
+
export { createAppointmentEventAsync, rescheduleAppointmentEventAsync, cancelAppointmentEventAsync, type AppointmentEventOptions, type AppointmentEventResult, type AppointmentEventSuccess, type AppointmentEventFailure, type BlazeoEventApiResponse, } from "../events/appointmentEventFacade.js";
|
|
11
|
+
export { mapAppointmentToEventSnapshot, type AppointmentEventMappingMode, } from "../events/mapAppointmentToEventSnapshot.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/facades/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,GACpC,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,6BAA6B,EAC7B,KAAK,2BAA2B,GACjC,MAAM,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public facade surface for `appointment-client`.
|
|
3
|
+
*
|
|
4
|
+
* Call {@link initializeAppointmentClient} from `../config/initializeAppointmentClient.js`
|
|
5
|
+
* before using these APIs in a host application.
|
|
6
|
+
*/
|
|
7
|
+
export { createCalendarAsync, updateCalendarAsync, deleteCalendarAsync, resolveBlazeoConnection, } from "../calendar/createCalendar.js";
|
|
8
|
+
export { CalendarCreationFacade, createCalendarWithRelationsAsync, updateCalendarWithRelationsAsync, resolveParticipantIdForOpeningHour, } from "../calendar/calendarCreationFacade.js";
|
|
9
|
+
export { addParticipantToCalendar, removeParticipantFromCalendar, saveCalendarOpeningHour, saveCalendarOpeningHoursBatch, } from "../calendar/blazeoCalendarRelationMethods.js";
|
|
10
|
+
export { createAppointmentEventAsync, rescheduleAppointmentEventAsync, cancelAppointmentEventAsync, } from "../events/appointmentEventFacade.js";
|
|
11
|
+
export { mapAppointmentToEventSnapshot, } from "../events/mapAppointmentToEventSnapshot.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/facades/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GAIxB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,GAGnC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,GAG9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,GAM5B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,6BAA6B,GAE9B,MAAM,4CAA4C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@blazeo.com/appointment-client` — Blazeo calendar / appointment facades.
|
|
3
|
+
*
|
|
4
|
+
* In a host app, call {@link initializeAppointmentClient} once with your API `baseUrl`
|
|
5
|
+
* (and optional `consumer`) before using any facade that performs HTTP calls.
|
|
6
|
+
* File-based defaults (`blazeoClientConfig`) are optional; use {@link applyBlazeoClientConfig}
|
|
7
|
+
* if you keep defaults in `blazeoClientDefaults.ts` and want them applied after import.
|
|
8
|
+
*/
|
|
9
|
+
import { initializeAppointmentClient, isAppointmentClientConfigured, type AppointmentClientConnectOptions } from "./config/initializeAppointmentClient.js";
|
|
10
|
+
export declare const packageName = "appointment-client";
|
|
11
|
+
export { initializeAppointmentClient, isAppointmentClientConfigured, type AppointmentClientConnectOptions, };
|
|
12
|
+
export { applyBlazeoClientConfig } from "./config/applyBlazeoDefaults.js";
|
|
13
|
+
export { blazeoClientConfig } from "./config/blazeoClientDefaults.js";
|
|
14
|
+
/** Calendar + event facades (see `src/facades/index.ts`). */
|
|
15
|
+
export * from "./facades/index.js";
|
|
16
|
+
export * from "./models/index.js";
|
|
17
|
+
export { mapCalendarBOToSnapshot } from "./calendar/mapCalendarToBlazeoSnapshot.js";
|
|
18
|
+
export type { CalendarInput as CalendarBOInput, MemberBOInput, OpeningHourBOInput, } from "./types/calendar.js";
|
|
19
|
+
export type { ApexAppointmentInput } from "./types/appointment.js";
|
|
20
|
+
export { CalendarModel, EventModel, ParticipantModel, OpeningHourModel, } from "@blazeo.com/calendar-client";
|
|
21
|
+
export { configure, getConfig } from "@blazeo.com/calendar-client";
|
|
22
|
+
export { getExampleCalendarRoot, getExampleCalendarRootSnapshot, getExampleEvents, getExampleParticipants, getExampleSlots, } from "./exampleData.js";
|
|
23
|
+
/** Low-level MST env helper (advanced); most apps use {@link initializeAppointmentClient} only. */
|
|
24
|
+
export { buildModelEnv } from "./calendar/createCalendar.js";
|
|
25
|
+
export declare class CalendarClient {
|
|
26
|
+
readonly name = "appointment-client";
|
|
27
|
+
/** Same as {@link initializeAppointmentClient} — sugar for class-style apps. */
|
|
28
|
+
connect(options: AppointmentClientConnectOptions): void;
|
|
29
|
+
getExampleSlots(): (import("mobx-state-tree").ModelInstanceTypeProps<{
|
|
30
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
31
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
32
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
33
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
34
|
+
}> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
35
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
36
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
37
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
38
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
39
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
40
|
+
getExampleRoot(): import("mobx-state-tree").ModelInstanceTypeProps<{
|
|
41
|
+
slots: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
42
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
43
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
44
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
45
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
46
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
47
|
+
events: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
48
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
49
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
50
|
+
calendarId: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
51
|
+
startsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
52
|
+
endsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
53
|
+
participantIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
54
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
55
|
+
participants: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
56
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
57
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
58
|
+
email: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
59
|
+
role: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
60
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
61
|
+
}> & {
|
|
62
|
+
removeSlot(id: string): void;
|
|
63
|
+
removeEvent(id: string): void;
|
|
64
|
+
removeParticipant(id: string): void;
|
|
65
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
66
|
+
slots: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
67
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
68
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
69
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
70
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
71
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
72
|
+
events: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
73
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
74
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
75
|
+
calendarId: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
76
|
+
startsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
77
|
+
endsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
78
|
+
participantIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
79
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
80
|
+
participants: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
81
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
82
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
83
|
+
email: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
84
|
+
role: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
85
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
86
|
+
}, {
|
|
87
|
+
removeSlot(id: string): void;
|
|
88
|
+
removeEvent(id: string): void;
|
|
89
|
+
removeParticipant(id: string): void;
|
|
90
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGf"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@blazeo.com/appointment-client` — Blazeo calendar / appointment facades.
|
|
3
|
+
*
|
|
4
|
+
* In a host app, call {@link initializeAppointmentClient} once with your API `baseUrl`
|
|
5
|
+
* (and optional `consumer`) before using any facade that performs HTTP calls.
|
|
6
|
+
* File-based defaults (`blazeoClientConfig`) are optional; use {@link applyBlazeoClientConfig}
|
|
7
|
+
* if you keep defaults in `blazeoClientDefaults.ts` and want them applied after import.
|
|
8
|
+
*/
|
|
9
|
+
import { initializeAppointmentClient, isAppointmentClientConfigured, } from "./config/initializeAppointmentClient.js";
|
|
10
|
+
import { getExampleCalendarRoot, getExampleSlots } from "./exampleData.js";
|
|
11
|
+
export const packageName = "appointment-client";
|
|
12
|
+
export { initializeAppointmentClient, isAppointmentClientConfigured, };
|
|
13
|
+
export { applyBlazeoClientConfig } from "./config/applyBlazeoDefaults.js";
|
|
14
|
+
export { blazeoClientConfig } from "./config/blazeoClientDefaults.js";
|
|
15
|
+
/** Calendar + event facades (see `src/facades/index.ts`). */
|
|
16
|
+
export * from "./facades/index.js";
|
|
17
|
+
export * from "./models/index.js";
|
|
18
|
+
export { mapCalendarBOToSnapshot } from "./calendar/mapCalendarToBlazeoSnapshot.js";
|
|
19
|
+
export { CalendarModel, EventModel, ParticipantModel, OpeningHourModel, } from "@blazeo.com/calendar-client";
|
|
20
|
+
export { configure, getConfig } from "@blazeo.com/calendar-client";
|
|
21
|
+
export { getExampleCalendarRoot, getExampleCalendarRootSnapshot, getExampleEvents, getExampleParticipants, getExampleSlots, } from "./exampleData.js";
|
|
22
|
+
/** Low-level MST env helper (advanced); most apps use {@link initializeAppointmentClient} only. */
|
|
23
|
+
export { buildModelEnv } from "./calendar/createCalendar.js";
|
|
24
|
+
export class CalendarClient {
|
|
25
|
+
name = packageName;
|
|
26
|
+
/** Same as {@link initializeAppointmentClient} — sugar for class-style apps. */
|
|
27
|
+
connect(options) {
|
|
28
|
+
initializeAppointmentClient(options);
|
|
29
|
+
}
|
|
30
|
+
getExampleSlots() {
|
|
31
|
+
return getExampleSlots();
|
|
32
|
+
}
|
|
33
|
+
getExampleRoot() {
|
|
34
|
+
return getExampleCalendarRoot();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAE9B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAE9B,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,6DAA6D;AAC7D,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AASpF,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,mGAAmG;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,cAAc;IAChB,IAAI,GAAG,WAAW,CAAC;IAE5B,gFAAgF;IAChF,OAAO,CAAC,OAAwC;QAC9C,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,eAAe;QACb,OAAO,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED,cAAc;QACZ,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Instance, type SnapshotIn } from "mobx-state-tree";
|
|
2
|
+
export declare const CalendarRootModel: import("mobx-state-tree").IModelType<{
|
|
3
|
+
slots: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
4
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
5
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
6
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
7
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
8
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
9
|
+
events: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
10
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
11
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
12
|
+
calendarId: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
13
|
+
startsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
14
|
+
endsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
15
|
+
participantIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
16
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
17
|
+
participants: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
18
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
19
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
20
|
+
email: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
21
|
+
role: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
22
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
23
|
+
}, {
|
|
24
|
+
removeSlot(id: string): void;
|
|
25
|
+
removeEvent(id: string): void;
|
|
26
|
+
removeParticipant(id: string): void;
|
|
27
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
28
|
+
export type CalendarRoot = Instance<typeof CalendarRootModel>;
|
|
29
|
+
export type CalendarRootSnapshotIn = SnapshotIn<typeof CalendarRootModel>;
|
|
30
|
+
export declare function createCalendarRoot(snapshot?: CalendarRootSnapshotIn): CalendarRoot;
|
|
31
|
+
//# sourceMappingURL=CalendarRootModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRootModel.d.ts","sourceRoot":"","sources":["../../src/models/CalendarRootModel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EAEhB,MAAM,iBAAiB,CAAC;AAKzB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;mBAOX,MAAM;oBAIL,MAAM;0BAIA,MAAM;sFAI3B,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE1E,wBAAgB,kBAAkB,CAChC,QAAQ,CAAC,EAAE,sBAAsB,GAChC,YAAY,CAQd"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { types, } from "mobx-state-tree";
|
|
2
|
+
import { CalendarSlotModel } from "./CalendarSlotModel.js";
|
|
3
|
+
import { EventModel } from "./EventModel.js";
|
|
4
|
+
import { ParticipantModel } from "./ParticipantModel.js";
|
|
5
|
+
export const CalendarRootModel = types
|
|
6
|
+
.model("CalendarRoot", {
|
|
7
|
+
slots: types.array(CalendarSlotModel),
|
|
8
|
+
events: types.array(EventModel),
|
|
9
|
+
participants: types.array(ParticipantModel),
|
|
10
|
+
})
|
|
11
|
+
.actions((self) => ({
|
|
12
|
+
removeSlot(id) {
|
|
13
|
+
const i = self.slots.findIndex((s) => s.id === id);
|
|
14
|
+
if (i >= 0)
|
|
15
|
+
self.slots.splice(i, 1);
|
|
16
|
+
},
|
|
17
|
+
removeEvent(id) {
|
|
18
|
+
const i = self.events.findIndex((e) => e.id === id);
|
|
19
|
+
if (i >= 0)
|
|
20
|
+
self.events.splice(i, 1);
|
|
21
|
+
},
|
|
22
|
+
removeParticipant(id) {
|
|
23
|
+
const i = self.participants.findIndex((p) => p.id === id);
|
|
24
|
+
if (i >= 0)
|
|
25
|
+
self.participants.splice(i, 1);
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
export function createCalendarRoot(snapshot) {
|
|
29
|
+
return snapshot
|
|
30
|
+
? CalendarRootModel.create(snapshot)
|
|
31
|
+
: CalendarRootModel.create({
|
|
32
|
+
slots: [],
|
|
33
|
+
events: [],
|
|
34
|
+
participants: [],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=CalendarRootModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRootModel.js","sourceRoot":"","sources":["../../src/models/CalendarRootModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAA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AC,QAAQ,CAAC;QACpC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;YACvB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,EAAE;SACjB,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Instance } from "mobx-state-tree";
|
|
2
|
+
export declare const CalendarSlotModel: import("mobx-state-tree").IModelType<{
|
|
3
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
4
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
5
|
+
start: import("mobx-state-tree").ISimpleType<string>;
|
|
6
|
+
end: import("mobx-state-tree").ISimpleType<string>;
|
|
7
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
8
|
+
export type CalendarSlot = Instance<typeof CalendarSlotModel>;
|
|
9
|
+
//# sourceMappingURL=CalendarSlotModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarSlotModel.d.ts","sourceRoot":"","sources":["../../src/models/CalendarSlotModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAS,MAAM,iBAAiB,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;;;;0FAK5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarSlotModel.js","sourceRoot":"","sources":["../../src/models/CalendarSlotModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE;IAC3D,EAAE,EAAE,KAAK,CAAC,UAAU;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM;IACnB,KAAK,EAAE,KAAK,CAAC,MAAM;IACnB,GAAG,EAAE,KAAK,CAAC,MAAM;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Instance } from "mobx-state-tree";
|
|
2
|
+
export declare const EventModel: import("mobx-state-tree").IModelType<{
|
|
3
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
4
|
+
title: import("mobx-state-tree").ISimpleType<string>;
|
|
5
|
+
calendarId: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
6
|
+
startsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
7
|
+
endsAt: import("mobx-state-tree").ISimpleType<string>;
|
|
8
|
+
participantIds: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
9
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
10
|
+
export type Event = Instance<typeof EventModel>;
|
|
11
|
+
//# sourceMappingURL=EventModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventModel.d.ts","sourceRoot":"","sources":["../../src/models/EventModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAS,MAAM,iBAAiB,CAAC;AAEvD,eAAO,MAAM,UAAU;;;;;;;0FAOrB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { types } from "mobx-state-tree";
|
|
2
|
+
export const EventModel = types.model("Event", {
|
|
3
|
+
id: types.identifier,
|
|
4
|
+
title: types.string,
|
|
5
|
+
calendarId: types.optional(types.string, ""),
|
|
6
|
+
startsAt: types.string,
|
|
7
|
+
endsAt: types.string,
|
|
8
|
+
participantIds: types.optional(types.array(types.string), []),
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=EventModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventModel.js","sourceRoot":"","sources":["../../src/models/EventModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;IAC7C,EAAE,EAAE,KAAK,CAAC,UAAU;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM;IACnB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,MAAM;IACtB,MAAM,EAAE,KAAK,CAAC,MAAM;IACpB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;CAC9D,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Instance } from "mobx-state-tree";
|
|
2
|
+
export declare const ParticipantModel: import("mobx-state-tree").IModelType<{
|
|
3
|
+
id: import("mobx-state-tree").ISimpleType<string>;
|
|
4
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
5
|
+
email: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
6
|
+
role: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
7
|
+
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
8
|
+
export type Participant = Instance<typeof ParticipantModel>;
|
|
9
|
+
//# sourceMappingURL=ParticipantModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticipantModel.d.ts","sourceRoot":"","sources":["../../src/models/ParticipantModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAS,MAAM,iBAAiB,CAAC;AAEvD,eAAO,MAAM,gBAAgB;;;;;0FAK3B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { types } from "mobx-state-tree";
|
|
2
|
+
export const ParticipantModel = types.model("Participant", {
|
|
3
|
+
id: types.identifier,
|
|
4
|
+
name: types.string,
|
|
5
|
+
email: types.optional(types.string, ""),
|
|
6
|
+
role: types.optional(types.string, "Participant"),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=ParticipantModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticipantModel.js","sourceRoot":"","sources":["../../src/models/ParticipantModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE;IACzD,EAAE,EAAE,KAAK,CAAC,UAAU;IACpB,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;IACvC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CalendarRootModel, createCalendarRoot, type CalendarRoot, type CalendarRootSnapshotIn, } from "./CalendarRootModel.js";
|
|
2
|
+
export { CalendarSlotModel, type CalendarSlot, } from "./CalendarSlotModel.js";
|
|
3
|
+
export { EventModel, type Event } from "./EventModel.js";
|
|
4
|
+
export { ParticipantModel, type Participant, } from "./ParticipantModel.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,EACjB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CalendarRootModel, createCalendarRoot, } from "./CalendarRootModel.js";
|
|
2
|
+
export { CalendarSlotModel, } from "./CalendarSlotModel.js";
|
|
3
|
+
export { EventModel } from "./EventModel.js";
|
|
4
|
+
export { ParticipantModel, } from "./ParticipantModel.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAc,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ApexFlows `AppointmentBO`-aligned input for Blazeo event APIs
|
|
3
|
+
* (same intent as `AppointmentAPIAdapter` Create / Reschedule / Cancel).
|
|
4
|
+
*/
|
|
5
|
+
export type ApexAppointmentInput = {
|
|
6
|
+
/** Blazeo `calendarId` — `ThirdPartyCalendarId` in Apex. */
|
|
7
|
+
thirdPartyCalendarId: string;
|
|
8
|
+
/** Participant GUID string (with or without braces). */
|
|
9
|
+
participantId: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
/** Create: `AppointmentBO.Description`. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Reschedule / update: Apex often uses `Notes` for body (see adapter). */
|
|
14
|
+
notes?: string;
|
|
15
|
+
startDate: string | Date;
|
|
16
|
+
endDate: string | Date;
|
|
17
|
+
visitorEmail?: string;
|
|
18
|
+
visitorPhone?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
phone?: string;
|
|
21
|
+
rescheduleUrl?: string;
|
|
22
|
+
cancelUrl?: string;
|
|
23
|
+
timeZone?: string;
|
|
24
|
+
/** Existing Blazeo event id — required for reschedule; omit or `"new"` for create. */
|
|
25
|
+
thirdPartyAppointmentId?: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=appointment.d.ts.map
|