@blazeo.com/appointment-client 1.0.11 → 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.
Files changed (138) hide show
  1. package/blazeo.com-appointment-client-1.0.14.tgz +0 -0
  2. package/package.json +3 -2
  3. package/sample/src/EventTab.jsx +435 -395
  4. package/sample/src/FetchCalendarTab.jsx +19 -33
  5. package/sample/src/LeadTab.jsx +335 -0
  6. package/src/calendar/calendarCreation.ts +62 -15
  7. package/src/calendar/fetchCalendarDetails.ts +10 -2
  8. package/src/calendar/getCalendarsByCompany.ts +17 -64
  9. package/src/calendar/mapToDesiredResponse.ts +31 -17
  10. package/src/events/getAppointmentsByFilter.ts +98 -0
  11. package/src/index.ts +23 -14
  12. package/src/lead/fetchLeadDetails.ts +106 -0
  13. package/blazeo.com-appointment-client-1.0.11.tgz +0 -0
  14. package/dist/calendar/blazeoCalendarRelationMethods.d.ts +0 -8
  15. package/dist/calendar/blazeoCalendarRelationMethods.d.ts.map +0 -1
  16. package/dist/calendar/blazeoCalendarRelationMethods.js +0 -16
  17. package/dist/calendar/blazeoCalendarRelationMethods.js.map +0 -1
  18. package/dist/calendar/buildUnifiedCalendarView.d.ts +0 -39
  19. package/dist/calendar/buildUnifiedCalendarView.js +0 -301
  20. package/dist/calendar/calendarCreation.d.ts +0 -27
  21. package/dist/calendar/calendarCreation.js +0 -191
  22. package/dist/calendar/calendarCreationFacade.d.ts +0 -27
  23. package/dist/calendar/calendarCreationFacade.d.ts.map +0 -1
  24. package/dist/calendar/calendarCreationFacade.js +0 -167
  25. package/dist/calendar/calendarCreationFacade.js.map +0 -1
  26. package/dist/calendar/createCalendar.d.ts +0 -81
  27. package/dist/calendar/createCalendar.d.ts.map +0 -1
  28. package/dist/calendar/createCalendar.js +0 -206
  29. package/dist/calendar/createCalendar.js.map +0 -1
  30. package/dist/calendar/fetchCalendarDetails.d.ts +0 -41
  31. package/dist/calendar/fetchCalendarDetails.js +0 -262
  32. package/dist/calendar/fetchCalendarWithOpeningHours.d.ts +0 -25
  33. package/dist/calendar/fetchCalendarWithOpeningHours.js +0 -114
  34. package/dist/calendar/getAllParticipantOpeningHours.d.ts +0 -22
  35. package/dist/calendar/getAllParticipantOpeningHours.js +0 -22
  36. package/dist/calendar/getCalendarsByCompany.d.ts +0 -9
  37. package/dist/calendar/getCalendarsByCompany.js +0 -107
  38. package/dist/calendar/getOpeningHours.d.ts +0 -8
  39. package/dist/calendar/getOpeningHours.js +0 -9
  40. package/dist/calendar/getParticipantOpeningHours.d.ts +0 -37
  41. package/dist/calendar/getParticipantOpeningHours.js +0 -48
  42. package/dist/calendar/getParticipants.d.ts +0 -7
  43. package/dist/calendar/getParticipants.js +0 -13
  44. package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts +0 -10
  45. package/dist/calendar/mapCalendarBoToBlazeoSnapshot.d.ts.map +0 -1
  46. package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js +0 -44
  47. package/dist/calendar/mapCalendarBoToBlazeoSnapshot.js.map +0 -1
  48. package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts +0 -29
  49. package/dist/calendar/mapCalendarToBlazeoSnapshot.d.ts.map +0 -1
  50. package/dist/calendar/mapCalendarToBlazeoSnapshot.js +0 -44
  51. package/dist/calendar/mapCalendarToBlazeoSnapshot.js.map +0 -1
  52. package/dist/calendar/mapToDesiredResponse.d.ts +0 -70
  53. package/dist/calendar/mapToDesiredResponse.js +0 -99
  54. package/dist/config/applyBlazeoClientConfig.d.ts +0 -3
  55. package/dist/config/applyBlazeoClientConfig.d.ts.map +0 -1
  56. package/dist/config/applyBlazeoClientConfig.js +0 -14
  57. package/dist/config/applyBlazeoClientConfig.js.map +0 -1
  58. package/dist/config/applyBlazeoDefaults.d.ts +0 -2
  59. package/dist/config/applyBlazeoDefaults.d.ts.map +0 -1
  60. package/dist/config/applyBlazeoDefaults.js +0 -14
  61. package/dist/config/applyBlazeoDefaults.js.map +0 -1
  62. package/dist/config/blazeo.config.d.ts +0 -11
  63. package/dist/config/blazeo.config.d.ts.map +0 -1
  64. package/dist/config/blazeo.config.js +0 -11
  65. package/dist/config/blazeo.config.js.map +0 -1
  66. package/dist/config/blazeoClientDefaults.d.ts +0 -11
  67. package/dist/config/blazeoClientDefaults.d.ts.map +0 -1
  68. package/dist/config/blazeoClientDefaults.js +0 -11
  69. package/dist/config/blazeoClientDefaults.js.map +0 -1
  70. package/dist/config/ensureBlazeoHttpReady.d.ts +0 -17
  71. package/dist/config/ensureBlazeoHttpReady.js +0 -31
  72. package/dist/config/initializeAppointmentClient.d.ts +0 -11
  73. package/dist/config/initializeAppointmentClient.d.ts.map +0 -1
  74. package/dist/config/initializeAppointmentClient.js +0 -15
  75. package/dist/config/initializeAppointmentClient.js.map +0 -1
  76. package/dist/config/syncBlazeoConnection.d.ts +0 -6
  77. package/dist/config/syncBlazeoConnection.js +0 -18
  78. package/dist/events/appointmentEventFacade.d.ts +0 -67
  79. package/dist/events/appointmentEventFacade.d.ts.map +0 -1
  80. package/dist/events/appointmentEventFacade.js +0 -124
  81. package/dist/events/appointmentEventFacade.js.map +0 -1
  82. package/dist/events/mapAppointmentToEventSnapshot.d.ts +0 -5
  83. package/dist/events/mapAppointmentToEventSnapshot.d.ts.map +0 -1
  84. package/dist/events/mapAppointmentToEventSnapshot.js +0 -57
  85. package/dist/events/mapAppointmentToEventSnapshot.js.map +0 -1
  86. package/dist/exampleData.d.ts +0 -119
  87. package/dist/exampleData.d.ts.map +0 -1
  88. package/dist/exampleData.js +0 -71
  89. package/dist/exampleData.js.map +0 -1
  90. package/dist/facade/calendarCreationFacade.d.ts +0 -40
  91. package/dist/facade/calendarCreationFacade.d.ts.map +0 -1
  92. package/dist/facade/calendarCreationFacade.js +0 -96
  93. package/dist/facade/calendarCreationFacade.js.map +0 -1
  94. package/dist/facade/mapCalendarBOToSnapshot.d.ts +0 -10
  95. package/dist/facade/mapCalendarBOToSnapshot.d.ts.map +0 -1
  96. package/dist/facade/mapCalendarBOToSnapshot.js +0 -44
  97. package/dist/facade/mapCalendarBOToSnapshot.js.map +0 -1
  98. package/dist/facades/index.d.ts +0 -12
  99. package/dist/facades/index.d.ts.map +0 -1
  100. package/dist/facades/index.js +0 -12
  101. package/dist/facades/index.js.map +0 -1
  102. package/dist/index.d.ts +0 -40
  103. package/dist/index.d.ts.map +0 -1
  104. package/dist/index.js +0 -39
  105. package/dist/index.js.map +0 -1
  106. package/dist/models/CalendarRootModel.d.ts +0 -56
  107. package/dist/models/CalendarRootModel.d.ts.map +0 -1
  108. package/dist/models/CalendarRootModel.js +0 -54
  109. package/dist/models/CalendarRootModel.js.map +0 -1
  110. package/dist/models/CalendarSlotModel.d.ts +0 -9
  111. package/dist/models/CalendarSlotModel.d.ts.map +0 -1
  112. package/dist/models/CalendarSlotModel.js +0 -8
  113. package/dist/models/CalendarSlotModel.js.map +0 -1
  114. package/dist/models/EventModel.d.ts +0 -11
  115. package/dist/models/EventModel.d.ts.map +0 -1
  116. package/dist/models/EventModel.js +0 -10
  117. package/dist/models/EventModel.js.map +0 -1
  118. package/dist/models/ParticipantModel.d.ts +0 -9
  119. package/dist/models/ParticipantModel.d.ts.map +0 -1
  120. package/dist/models/ParticipantModel.js +0 -8
  121. package/dist/models/ParticipantModel.js.map +0 -1
  122. package/dist/models/index.d.ts +0 -5
  123. package/dist/models/index.d.ts.map +0 -1
  124. package/dist/models/index.js +0 -5
  125. package/dist/models/index.js.map +0 -1
  126. package/dist/types/appointment.d.ts +0 -28
  127. package/dist/types/appointment.d.ts.map +0 -1
  128. package/dist/types/appointment.js +0 -6
  129. package/dist/types/appointment.js.map +0 -1
  130. package/dist/types/calendar.d.ts +0 -52
  131. package/dist/types/calendar.d.ts.map +0 -1
  132. package/dist/types/calendar.js +0 -6
  133. package/dist/types/calendar.js.map +0 -1
  134. package/dist/types/calendarBo.d.ts +0 -62
  135. package/dist/types/calendarBo.d.ts.map +0 -1
  136. package/dist/types/calendarBo.js +0 -6
  137. package/dist/types/calendarBo.js.map +0 -1
  138. package/sample/package-lock.json +0 -1778
@@ -1,7 +0,0 @@
1
- /**
2
- * Fetches participants for a calendar.
3
- */
4
- export declare function getParticipants(calendarId: string, options?: {
5
- baseUrl?: string;
6
- consumer?: string;
7
- }): Promise<any[]>;
@@ -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,70 +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
- location: any;
19
- bookingPageTitle: any;
20
- reminderChannelStatuses: {
21
- id: any;
22
- calendarId: any;
23
- channelId: any;
24
- status: boolean;
25
- appointmentReminders: any;
26
- __typename: string;
27
- }[];
28
- members: {
29
- id: any;
30
- name: any;
31
- email: any;
32
- status: any;
33
- __typename: string;
34
- }[];
35
- createdOn: any;
36
- modifiedOn: any;
37
- name: any;
38
- timeZoneId: any;
39
- description: any;
40
- assignmentType: number | null;
41
- duration: number | null;
42
- bookingLimit: number | null;
43
- calendarJson: any;
44
- isThirdPartySaved: boolean;
45
- themeId: number | null;
46
- theme: {
47
- id: any;
48
- color: any;
49
- logoUrl: any;
50
- __typename: string;
51
- } | null;
52
- openingHours: {
53
- id: any;
54
- createdOn: any;
55
- modifiedOn: any;
56
- member: any;
57
- openingHourId: any;
58
- calendarId: any;
59
- participantId: any;
60
- days: any;
61
- startHour: any;
62
- startMinute: any;
63
- endHour: any;
64
- endMinute: any;
65
- off: boolean;
66
- __typename: string;
67
- }[];
68
- appointmentUserDefinedFields: any;
69
- __typename: string;
70
- } | null;
@@ -1,99 +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
- id: pick(oh, "id", "Id") ?? 0,
27
- createdOn: pick(oh, "createdOn", "CreatedOn", "created_on") ?? "0001-01-01T00:00:00.000Z",
28
- modifiedOn: pick(oh, "modifiedOn", "ModifiedOn", "modified_on") ?? "0001-01-01T00:00:00.000Z",
29
- member: pick(oh, "member", "Member"),
30
- openingHourId: pick(oh, "openingHourId", "OpeningHourId", "opening_hour_id") ?? "",
31
- calendarId: pick(oh, "calendarId", "CalendarId", "calendar_id") ?? "",
32
- participantId: pick(oh, "participantId", "ParticipantId", "participant_id") ?? "",
33
- days: oh.days ?? [],
34
- startHour: oh.startHour ?? pick(oh, "startHour", "StartHour") ?? 0,
35
- startMinute: oh.startMinute ?? pick(oh, "startMinute", "StartMinute") ?? 0,
36
- endHour: oh.endHour ?? pick(oh, "endHour", "EndHour") ?? 0,
37
- endMinute: oh.endMinute ?? pick(oh, "endMinute", "EndMinute") ?? 0,
38
- off: !!(oh.off ?? pick(oh, "off", "Off")),
39
- __typename: "OpeningHour"
40
- }));
41
- // Map theme
42
- const rawTheme = pick(payload, "theme", "Theme");
43
- const theme = rawTheme ? {
44
- id: pick(rawTheme, "id", "Id"),
45
- color: pick(rawTheme, "color", "Color"),
46
- logoUrl: pick(rawTheme, "logoUrl", "LogoUrl") ?? null,
47
- __typename: "Theme"
48
- } : null;
49
- // Map reminders
50
- const rawReminders = pick(payload, "reminderChannelStatuses", "ReminderChannelStatuses") ?? [];
51
- const reminderChannelStatuses = Array.isArray(rawReminders) ? rawReminders.map((r) => ({
52
- id: pick(r, "id", "Id"),
53
- calendarId: pick(r, "calendarId", "CalendarId"),
54
- channelId: pick(r, "channelId", "ChannelId"),
55
- status: !!pick(r, "status", "Status"),
56
- appointmentReminders: (pick(r, "appointmentReminders", "AppointmentReminders") ?? []).map((ar) => ({
57
- id: pick(ar, "id", "Id"),
58
- reminderChannelStatusId: pick(ar, "reminderChannelStatusId", "ReminderChannelStatusId"),
59
- recipientType: pick(ar, "recipientType", "RecipientType"),
60
- beforeEventTime: pick(ar, "beforeEventTime", "BeforeEventTime"),
61
- unit: pick(ar, "unit", "Unit"),
62
- __typename: "AppointmentReminder"
63
- })),
64
- __typename: "ReminderChannelStatus"
65
- })) : [];
66
- return {
67
- id: n(pick(payload, "id", "Id")),
68
- durationUnit: n(pick(payload, "durationUnit", "DurationUnit")),
69
- minimumBookingNotice: n(pick(payload, "minimumBookingNotice", "MinimumBookingNotice")),
70
- minimumBookingNoticeUnit: n(pick(payload, "minimumBookingNoticeUnit", "MinimumBookingNoticeUnit")),
71
- minimumCancelationNotice: n(pick(payload, "minimumCancelationNotice", "MinimumCancelationNotice")),
72
- minimumCancelationNoticeUnit: n(pick(payload, "minimumCancelationNoticeUnit", "MinimumCancelationNoticeUnit")),
73
- futureLimit: n(pick(payload, "futureLimit", "FutureLimit")),
74
- futureLimitUnit: n(pick(payload, "futureLimitUnit", "FutureLimitUnit")),
75
- bufferTime: n(pick(payload, "bufferTime", "BufferTime")),
76
- bufferTimeUnit: n(pick(payload, "bufferTimeUnit", "BufferTimeUnit")),
77
- calendarLink: pick(payload, "calendarLink", "CalendarLink"),
78
- uuid: pick(payload, "uuid", "Uuid", "calendarId", "CalendarId"),
79
- location: pick(payload, "location", "Location") ?? "",
80
- bookingPageTitle: pick(payload, "bookingPageTitle", "BookingPageTitle") ?? null,
81
- reminderChannelStatuses,
82
- members: mappedMembers,
83
- createdOn: pick(payload, "createdOn", "CreatedOn") ?? "0001-01-01T00:00:00.000Z",
84
- modifiedOn: pick(payload, "modifiedOn", "ModifiedOn") ?? "0001-01-01T00:00:00.000Z",
85
- name: pick(payload, "name", "Name"),
86
- timeZoneId: pick(payload, "timeZoneId", "TimeZoneId"),
87
- description: pick(payload, "description", "Description") ?? "",
88
- assignmentType: n(pick(payload, "assignmentType", "AssignmentType", "assignmentMethod", "AssignmentMethod")),
89
- duration: n(pick(payload, "duration", "Duration")),
90
- bookingLimit: n(pick(payload, "bookingLimit", "BookingLimit")),
91
- calendarJson: pick(payload, "calendarJson", "CalendarJson") ?? null,
92
- isThirdPartySaved: !!pick(payload, "isThirdPartySaved", "IsThirdPartySaved"),
93
- themeId: n(pick(payload, "themeId", "ThemeId")),
94
- theme,
95
- openingHours: mappedOpeningHours,
96
- appointmentUserDefinedFields: pick(payload, "appointmentUserDefinedFields", "AppointmentUserDefinedFields") ?? [],
97
- __typename: "Calendar"
98
- };
99
- }
@@ -1,3 +0,0 @@
1
- /** Push {@link blazeoClientConfig} into `@blazeo.com/calendar-client` (global store). */
2
- export declare function applyBlazeoClientConfig(): void;
3
- //# sourceMappingURL=applyBlazeoClientConfig.d.ts.map
@@ -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,2 +0,0 @@
1
- /** Push {@link blazeoClientConfig} into `@blazeo.com/calendar-client` (global store). Call explicitly if you use file defaults; otherwise use {@link initializeAppointmentClient}. */
2
- export declare function applyBlazeoClientConfig(): void;
@@ -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"}
@@ -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 const blazeoClientConfig = {
8
- baseUrl: "",
9
- consumer: "",
10
- };
11
- //# sourceMappingURL=blazeo.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blazeo.config.js","sourceRoot":"","sources":["../../src/config/blazeo.config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAG3B;IACF,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;CACb,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Optional file-based defaults for local development or publishing a fork.
3
- * Host apps should prefer {@link initializeAppointmentClient} with env-driven `baseUrl` / `consumer`.
4
- * To apply these values, call {@link applyBlazeoClientConfig} during bootstrap (not automatic on import).
5
- *
6
- * @example baseUrl: "https://apptscheduling.azurewebsites.net"
7
- */
8
- export declare const blazeoClientConfig: {
9
- baseUrl: string;
10
- consumer: string;
11
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"blazeoClientDefaults.d.ts","sourceRoot":"","sources":["../../src/config/blazeoClientDefaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAInB,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Optional file-based defaults for local development or publishing a fork.
3
- * Host apps should prefer {@link initializeAppointmentClient} with env-driven `baseUrl` / `consumer`.
4
- * To apply these values, call {@link applyBlazeoClientConfig} during bootstrap (not automatic on import).
5
- *
6
- * @example baseUrl: "https://apptscheduling.azurewebsites.net"
7
- */
8
- export const blazeoClientConfig = {
9
- baseUrl: "https://apptscheduling.azurewebsites.net",
10
- consumer: "smarthub",
11
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"blazeoClientDefaults.js","sourceRoot":"","sources":["../../src/config/blazeoClientDefaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAG3B;IACF,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;CACb,CAAC"}
@@ -1,17 +0,0 @@
1
- export type EnsureBlazeoHttpOptions = {
2
- baseUrl?: string;
3
- consumer?: string;
4
- };
5
- /**
6
- * Ensures global Blazeo `configure({ baseUrl })` runs before any `CalendarModel` / `EventModel` HTTP.
7
- * Uses the same resolution as {@link resolveBlazeoConnection}: explicit args, existing `getConfig()`,
8
- * then `blazeoClientDefaults` — so file defaults apply even if the host never called `configure`.
9
- */
10
- export declare function ensureBlazeoHttpReady(options?: EnsureBlazeoHttpOptions): {
11
- ok: true;
12
- baseUrl: string;
13
- consumer?: string;
14
- } | {
15
- ok: false;
16
- error: string;
17
- };
@@ -1,31 +0,0 @@
1
- import { configure } from "@blazeo.com/calendar-client";
2
- import { resolveBlazeoConnection } from "../calendar/createCalendar.js";
3
- /**
4
- * Ensures global Blazeo `configure({ baseUrl })` runs before any `CalendarModel` / `EventModel` HTTP.
5
- * Uses the same resolution as {@link resolveBlazeoConnection}: explicit args, existing `getConfig()`,
6
- * then `blazeoClientDefaults` — so file defaults apply even if the host never called `configure`.
7
- */
8
- export function ensureBlazeoHttpReady(options = {}) {
9
- // Hard-prefer explicit args (call-site can bypass any module-resolution mismatch).
10
- const explicitBase = options.baseUrl?.trim().replace(/\/+$/, "");
11
- const explicitConsumer = options.consumer?.trim() || undefined;
12
- if (explicitBase) {
13
- configure({
14
- baseUrl: explicitBase,
15
- ...(explicitConsumer ? { consumer: explicitConsumer } : {}),
16
- });
17
- return { ok: true, baseUrl: explicitBase, ...(explicitConsumer ? { consumer: explicitConsumer } : {}) };
18
- }
19
- const { baseUrl, consumer } = resolveBlazeoConnection(options);
20
- if (!baseUrl) {
21
- return {
22
- ok: false,
23
- error: "Blazeo base URL is not set. Call initializeAppointmentClient({ baseUrl }) or configure({ baseUrl }) at app startup, set blazeoClientConfig.baseUrl, or pass baseUrl when calling fetch APIs.",
24
- };
25
- }
26
- configure({
27
- baseUrl,
28
- ...(consumer ? { consumer } : {}),
29
- });
30
- return { ok: true, baseUrl, ...(consumer ? { consumer } : {}) };
31
- }
@@ -1,11 +0,0 @@
1
- export interface AppointmentClientConfig {
2
- baseUrl: string;
3
- consumer?: string;
4
- fetch?: typeof fetch;
5
- }
6
- /**
7
- * Applies Blazeo connection (same as {@link syncBlazeoConnection}) and marks the client as configured
8
- * when a non-empty `baseUrl` was written to `@blazeo.com/calendar-client`.
9
- */
10
- export declare function initializeAppointmentClient(config: AppointmentClientConfig): void;
11
- export declare function isAppointmentClientConfigured(): boolean;
@@ -1 +0,0 @@
1
- {"version":3,"file":"initializeAppointmentClient.d.ts","sourceRoot":"","sources":["../../src/config/initializeAppointmentClient.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CACjC,CAAC;AAEF,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,+BAAoC,GAC5C,IAAI,CAqBN;AAED,0FAA0F;AAC1F,wBAAgB,6BAA6B,IAAI,OAAO,CAGvD"}
@@ -1,15 +0,0 @@
1
- import { getConfig } from "@blazeo.com/calendar-client";
2
- import { syncBlazeoConnection } from "./syncBlazeoConnection.js";
3
- let isConfigured = false;
4
- /**
5
- * Applies Blazeo connection (same as {@link syncBlazeoConnection}) and marks the client as configured
6
- * when a non-empty `baseUrl` was written to `@blazeo.com/calendar-client`.
7
- */
8
- export function initializeAppointmentClient(config) {
9
- if (syncBlazeoConnection(config)) {
10
- isConfigured = true;
11
- }
12
- }
13
- export function isAppointmentClientConfigured() {
14
- return isConfigured || getConfig() !== null;
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"initializeAppointmentClient.js","sourceRoot":"","sources":["../../src/config/initializeAppointmentClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AA8B/D,MAAM,UAAU,2BAA2B,CACzC,UAA2C,EAAE;IAE7C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IAC9E,MAAM,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,8MAA8M,CAC/M,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GACZ,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;QACxB,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE;QACnC,SAAS,CAAC;IACZ,SAAS,CAAC;QACR,OAAO;QACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,gBAAgB;YAC1B,CAAC,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE;YAChD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,6BAA6B;IAC3C,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACvC,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { AppointmentClientConfig } from "./initializeAppointmentClient.js";
2
- /**
3
- * Writes `baseUrl` / `consumer` into the global `@blazeo.com/calendar-client` `configure()` store.
4
- * Returns whether anything was applied (skipped when `baseUrl` is empty after trim).
5
- */
6
- export declare function syncBlazeoConnection(config: AppointmentClientConfig): boolean;
@@ -1,18 +0,0 @@
1
- import { configure } from "@blazeo.com/calendar-client";
2
- /**
3
- * Writes `baseUrl` / `consumer` into the global `@blazeo.com/calendar-client` `configure()` store.
4
- * Returns whether anything was applied (skipped when `baseUrl` is empty after trim).
5
- */
6
- export function syncBlazeoConnection(config) {
7
- const baseUrl = config.baseUrl?.trim().replace(/\/+$/, "");
8
- if (!baseUrl)
9
- return false;
10
- configure({
11
- baseUrl,
12
- ...(config.consumer != null && String(config.consumer).trim() !== ""
13
- ? { consumer: String(config.consumer).trim() }
14
- : {}),
15
- ...(config.fetch ? { fetch: config.fetch } : {}),
16
- });
17
- return true;
18
- }