@blazeo.com/calendar-client 1.0.36 → 1.0.37

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.d.ts CHANGED
@@ -297,6 +297,7 @@ export const LeadModel: {
297
297
  source?: string;
298
298
  leadType?: 'sales' | 'service' | 'others' | number;
299
299
  referrerLink?: string;
300
+ description?: string;
300
301
  }): Promise<{ status: string; data?: unknown; message?: string } | null>;
301
302
  updateLead(payload: {
302
303
  leadId: string;
@@ -307,6 +308,7 @@ export const LeadModel: {
307
308
  source?: string;
308
309
  leadType?: 'sales' | 'service' | 'others' | number;
309
310
  referrerLink?: string;
311
+ description?: string;
310
312
  }): Promise<unknown>;
311
313
  deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
312
314
  requestExport(
package/dist/index.js CHANGED
@@ -779,6 +779,7 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
779
779
  if (opts.title != null && opts.title !== "") query.title = opts.title;
780
780
  if (opts.search != null && opts.search !== "") query.search = opts.search;
781
781
  if (opts.attendeeStatus != null && opts.attendeeStatus !== "") query.attendee_status = opts.attendeeStatus;
782
+ if (opts.status != null && opts.status !== "") query.status = opts.status;
782
783
  if (opts.eventSource != null && opts.eventSource !== "") query.event_source = opts.eventSource;
783
784
  const sortBy = opts.sortBy ?? opts.sort ?? opts.sort_column;
784
785
  if (sortBy != null && sortBy !== "") query.sort = sortBy;
@@ -787,12 +788,17 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
787
788
  const u = String(sortOrderRaw).trim().toUpperCase();
788
789
  query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
789
790
  }
790
- if (opts.page != null) {
791
- query.page = opts.page;
792
- if (opts.page_size != null) query.page_size = opts.page_size;
791
+ const pageSize = opts.page_size ?? opts.pageSize;
792
+ const pageNum = opts.page != null ? Number(opts.page) : null;
793
+ const hasSkipTake = opts.skip != null || opts.take != null;
794
+ const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
795
+ if (usePageMode) {
796
+ query.page = pageNum;
797
+ if (pageSize != null) query.page_size = pageSize;
793
798
  } else {
794
799
  if (opts.skip != null) query.skip = opts.skip;
795
- if (opts.take != null) query.take = opts.take;
800
+ const take = opts.take ?? (pageSize != null && !hasSkipTake ? pageSize : null);
801
+ if (take != null) query.take = take;
796
802
  }
797
803
  const res = await reqGet(path, query, { headers: { offset: String(offset) } });
798
804
  if (res.status !== "success") {
@@ -2513,6 +2519,7 @@ function mapLeadFromApi(d) {
2513
2519
  source: pick2("source", "Source") ?? "",
2514
2520
  leadType,
2515
2521
  referrerLink: pick2("referrerLink", "ReferrerLink", "referrer_link") ?? "",
2522
+ description: pick2("description", "Description") ?? "",
2516
2523
  createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
2517
2524
  modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null
2518
2525
  };
@@ -2527,6 +2534,7 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
2527
2534
  source: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
2528
2535
  leadType: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.number, 2),
2529
2536
  referrerLink: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
2537
+ description: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
2530
2538
  createdOn: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.maybeNull(import_mobx_state_tree20.types.string), null),
2531
2539
  modifiedOn: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.maybeNull(import_mobx_state_tree20.types.string), null)
2532
2540
  }).actions((self) => {
@@ -2591,7 +2599,8 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
2591
2599
  companyKey: self.companyKey,
2592
2600
  source: self.source,
2593
2601
  leadType: self.leadType,
2594
- referrerLink: self.referrerLink
2602
+ referrerLink: self.referrerLink,
2603
+ description: self.description
2595
2604
  };
2596
2605
  const res = await reqPost("/lead/create", payload);
2597
2606
  if (res.status === "success" && res.data) {
@@ -2612,7 +2621,8 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
2612
2621
  companyKey: self.companyKey,
2613
2622
  source: self.source,
2614
2623
  leadType: self.leadType,
2615
- referrerLink: self.referrerLink
2624
+ referrerLink: self.referrerLink,
2625
+ description: self.description
2616
2626
  };
2617
2627
  const res = await reqPost("/lead/update", payload);
2618
2628
  if (res.status === "success" && res.data) {
@@ -2680,6 +2690,7 @@ LeadModel.allowedColumns = [
2680
2690
  "source",
2681
2691
  "lead_type",
2682
2692
  "referrer_link",
2693
+ "description",
2683
2694
  "created_on",
2684
2695
  "modified_on"
2685
2696
  ];
package/dist/index.mjs CHANGED
@@ -705,6 +705,7 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
705
705
  if (opts.title != null && opts.title !== "") query.title = opts.title;
706
706
  if (opts.search != null && opts.search !== "") query.search = opts.search;
707
707
  if (opts.attendeeStatus != null && opts.attendeeStatus !== "") query.attendee_status = opts.attendeeStatus;
708
+ if (opts.status != null && opts.status !== "") query.status = opts.status;
708
709
  if (opts.eventSource != null && opts.eventSource !== "") query.event_source = opts.eventSource;
709
710
  const sortBy = opts.sortBy ?? opts.sort ?? opts.sort_column;
710
711
  if (sortBy != null && sortBy !== "") query.sort = sortBy;
@@ -713,12 +714,17 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
713
714
  const u = String(sortOrderRaw).trim().toUpperCase();
714
715
  query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
715
716
  }
716
- if (opts.page != null) {
717
- query.page = opts.page;
718
- if (opts.page_size != null) query.page_size = opts.page_size;
717
+ const pageSize = opts.page_size ?? opts.pageSize;
718
+ const pageNum = opts.page != null ? Number(opts.page) : null;
719
+ const hasSkipTake = opts.skip != null || opts.take != null;
720
+ const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
721
+ if (usePageMode) {
722
+ query.page = pageNum;
723
+ if (pageSize != null) query.page_size = pageSize;
719
724
  } else {
720
725
  if (opts.skip != null) query.skip = opts.skip;
721
- if (opts.take != null) query.take = opts.take;
726
+ const take = opts.take ?? (pageSize != null && !hasSkipTake ? pageSize : null);
727
+ if (take != null) query.take = take;
722
728
  }
723
729
  const res = await reqGet(path, query, { headers: { offset: String(offset) } });
724
730
  if (res.status !== "success") {
@@ -2439,6 +2445,7 @@ function mapLeadFromApi(d) {
2439
2445
  source: pick2("source", "Source") ?? "",
2440
2446
  leadType,
2441
2447
  referrerLink: pick2("referrerLink", "ReferrerLink", "referrer_link") ?? "",
2448
+ description: pick2("description", "Description") ?? "",
2442
2449
  createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
2443
2450
  modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null
2444
2451
  };
@@ -2453,6 +2460,7 @@ var LeadModel = types20.model("Lead", {
2453
2460
  source: types20.optional(types20.string, ""),
2454
2461
  leadType: types20.optional(types20.number, 2),
2455
2462
  referrerLink: types20.optional(types20.string, ""),
2463
+ description: types20.optional(types20.string, ""),
2456
2464
  createdOn: types20.optional(types20.maybeNull(types20.string), null),
2457
2465
  modifiedOn: types20.optional(types20.maybeNull(types20.string), null)
2458
2466
  }).actions((self) => {
@@ -2517,7 +2525,8 @@ var LeadModel = types20.model("Lead", {
2517
2525
  companyKey: self.companyKey,
2518
2526
  source: self.source,
2519
2527
  leadType: self.leadType,
2520
- referrerLink: self.referrerLink
2528
+ referrerLink: self.referrerLink,
2529
+ description: self.description
2521
2530
  };
2522
2531
  const res = await reqPost("/lead/create", payload);
2523
2532
  if (res.status === "success" && res.data) {
@@ -2538,7 +2547,8 @@ var LeadModel = types20.model("Lead", {
2538
2547
  companyKey: self.companyKey,
2539
2548
  source: self.source,
2540
2549
  leadType: self.leadType,
2541
- referrerLink: self.referrerLink
2550
+ referrerLink: self.referrerLink,
2551
+ description: self.description
2542
2552
  };
2543
2553
  const res = await reqPost("/lead/update", payload);
2544
2554
  if (res.status === "success" && res.data) {
@@ -2606,6 +2616,7 @@ LeadModel.allowedColumns = [
2606
2616
  "source",
2607
2617
  "lead_type",
2608
2618
  "referrer_link",
2619
+ "description",
2609
2620
  "created_on",
2610
2621
  "modified_on"
2611
2622
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazeo.com/calendar-client",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Blazeo Calendar / Appointment API client with MobX State Tree models",
5
5
  "exports": {
6
6
  ".": {