@blazeo.com/calendar-client 1.0.11 → 1.0.12

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/index.js CHANGED
@@ -551,16 +551,20 @@ EventModel.getByVisitorPhone = async (phone, opts = {}) => {
551
551
  }
552
552
  return null;
553
553
  };
554
- EventModel.getByDateRangeWithFilters = async (startDateFrom, startDateTo, opts = {}) => {
554
+ EventModel.getByDateRangeWithFilters = async (companyKey, startDateFrom, startDateTo, opts = {}) => {
555
+ if (companyKey == null || String(companyKey).trim() === "") {
556
+ throw new Error("companyKey required");
557
+ }
555
558
  const { reqGet } = createRequestHelpersFromEnv(getConfig());
556
559
  const query = {
560
+ company_key: String(companyKey).trim(),
557
561
  start_date_from: startDateFrom,
558
562
  start_date_to: startDateTo
559
563
  };
560
564
  const offset = opts.offset ?? getDefaultOffset();
561
- if (opts.companyKey != null && opts.companyKey !== "") query.company_key = opts.companyKey;
562
565
  if (opts.calendarId != null && opts.calendarId !== "") query.calendar_id = opts.calendarId;
563
566
  if (opts.participantId != null && opts.participantId !== "") query.participant_id = opts.participantId;
567
+ if (opts.leadId != null && opts.leadId !== "") query.lead_id = opts.leadId;
564
568
  if (opts.visitorName != null && opts.visitorName !== "") query.visitor_name = opts.visitorName;
565
569
  if (opts.visitorEmail != null && opts.visitorEmail !== "") query.visitor_email = opts.visitorEmail;
566
570
  if (opts.visitorPhone != null && opts.visitorPhone !== "") query.visitor_phone = opts.visitorPhone;
package/dist/index.mjs CHANGED
@@ -498,16 +498,20 @@ EventModel.getByVisitorPhone = async (phone, opts = {}) => {
498
498
  }
499
499
  return null;
500
500
  };
501
- EventModel.getByDateRangeWithFilters = async (startDateFrom, startDateTo, opts = {}) => {
501
+ EventModel.getByDateRangeWithFilters = async (companyKey, startDateFrom, startDateTo, opts = {}) => {
502
+ if (companyKey == null || String(companyKey).trim() === "") {
503
+ throw new Error("companyKey required");
504
+ }
502
505
  const { reqGet } = createRequestHelpersFromEnv(getConfig());
503
506
  const query = {
507
+ company_key: String(companyKey).trim(),
504
508
  start_date_from: startDateFrom,
505
509
  start_date_to: startDateTo
506
510
  };
507
511
  const offset = opts.offset ?? getDefaultOffset();
508
- if (opts.companyKey != null && opts.companyKey !== "") query.company_key = opts.companyKey;
509
512
  if (opts.calendarId != null && opts.calendarId !== "") query.calendar_id = opts.calendarId;
510
513
  if (opts.participantId != null && opts.participantId !== "") query.participant_id = opts.participantId;
514
+ if (opts.leadId != null && opts.leadId !== "") query.lead_id = opts.leadId;
511
515
  if (opts.visitorName != null && opts.visitorName !== "") query.visitor_name = opts.visitorName;
512
516
  if (opts.visitorEmail != null && opts.visitorEmail !== "") query.visitor_email = opts.visitorEmail;
513
517
  if (opts.visitorPhone != null && opts.visitorPhone !== "") query.visitor_phone = opts.visitorPhone;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazeo.com/calendar-client",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Blazeo Calendar / Appointment API client with MobX State Tree models",
5
5
  "exports": {
6
6
  ".": {