@blazeo.com/calendar-client 1.0.37 → 1.0.39
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 +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -295,7 +295,7 @@ export const LeadModel: {
|
|
|
295
295
|
phone?: string;
|
|
296
296
|
name?: string;
|
|
297
297
|
source?: string;
|
|
298
|
-
leadType?: 'sales' | 'service' | 'others' | number;
|
|
298
|
+
leadType?: 'sales' | 'service' | 'others' | number | null;
|
|
299
299
|
referrerLink?: string;
|
|
300
300
|
description?: string;
|
|
301
301
|
}): Promise<{ status: string; data?: unknown; message?: string } | null>;
|
|
@@ -306,7 +306,7 @@ export const LeadModel: {
|
|
|
306
306
|
name?: string;
|
|
307
307
|
phone?: string;
|
|
308
308
|
source?: string;
|
|
309
|
-
leadType?: 'sales' | 'service' | 'others' | number;
|
|
309
|
+
leadType?: 'sales' | 'service' | 'others' | number | null;
|
|
310
310
|
referrerLink?: string;
|
|
311
311
|
description?: string;
|
|
312
312
|
}): Promise<unknown>;
|
package/dist/index.js
CHANGED
|
@@ -789,16 +789,16 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
|
|
|
789
789
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
790
790
|
}
|
|
791
791
|
const pageSize = opts.page_size ?? opts.pageSize;
|
|
792
|
+
const take = opts.take;
|
|
792
793
|
const pageNum = opts.page != null ? Number(opts.page) : null;
|
|
793
|
-
|
|
794
|
-
const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
|
|
795
|
-
if (usePageMode) {
|
|
794
|
+
if (pageNum != null && pageNum >= 1) {
|
|
796
795
|
query.page = pageNum;
|
|
797
|
-
|
|
796
|
+
const size = pageSize ?? take;
|
|
797
|
+
if (size != null) query.page_size = size;
|
|
798
798
|
} else {
|
|
799
799
|
if (opts.skip != null) query.skip = opts.skip;
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
800
|
+
const limit = take ?? pageSize;
|
|
801
|
+
if (limit != null) query.take = limit;
|
|
802
802
|
}
|
|
803
803
|
const res = await reqGet(path, query, { headers: { offset: String(offset) } });
|
|
804
804
|
if (res.status !== "success") {
|
|
@@ -2499,7 +2499,7 @@ function mapLeadFromApi(d) {
|
|
|
2499
2499
|
if (!d) return d;
|
|
2500
2500
|
const pick2 = (...keys) => keys.reduce((v, k) => v ?? d[k], void 0);
|
|
2501
2501
|
const leadTypeRaw = pick2("leadType", "LeadType", "lead_type");
|
|
2502
|
-
let leadType =
|
|
2502
|
+
let leadType = null;
|
|
2503
2503
|
if (typeof leadTypeRaw === "number" && Number.isFinite(leadTypeRaw)) {
|
|
2504
2504
|
leadType = leadTypeRaw;
|
|
2505
2505
|
} else if (typeof leadTypeRaw === "string" && leadTypeRaw.trim() !== "") {
|
|
@@ -2532,7 +2532,7 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
|
|
|
2532
2532
|
phone: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2533
2533
|
companyKey: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2534
2534
|
source: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2535
|
-
leadType: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.number,
|
|
2535
|
+
leadType: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.maybeNull(import_mobx_state_tree20.types.number), null),
|
|
2536
2536
|
referrerLink: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2537
2537
|
description: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2538
2538
|
createdOn: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.maybeNull(import_mobx_state_tree20.types.string), null),
|
package/dist/index.mjs
CHANGED
|
@@ -715,16 +715,16 @@ async function getByFiltersInternal(path, companyKey, opts = {}, dateRange = nul
|
|
|
715
715
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
716
716
|
}
|
|
717
717
|
const pageSize = opts.page_size ?? opts.pageSize;
|
|
718
|
+
const take = opts.take;
|
|
718
719
|
const pageNum = opts.page != null ? Number(opts.page) : null;
|
|
719
|
-
|
|
720
|
-
const usePageMode = pageNum != null && pageNum >= 1 && !hasSkipTake;
|
|
721
|
-
if (usePageMode) {
|
|
720
|
+
if (pageNum != null && pageNum >= 1) {
|
|
722
721
|
query.page = pageNum;
|
|
723
|
-
|
|
722
|
+
const size = pageSize ?? take;
|
|
723
|
+
if (size != null) query.page_size = size;
|
|
724
724
|
} else {
|
|
725
725
|
if (opts.skip != null) query.skip = opts.skip;
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
726
|
+
const limit = take ?? pageSize;
|
|
727
|
+
if (limit != null) query.take = limit;
|
|
728
728
|
}
|
|
729
729
|
const res = await reqGet(path, query, { headers: { offset: String(offset) } });
|
|
730
730
|
if (res.status !== "success") {
|
|
@@ -2425,7 +2425,7 @@ function mapLeadFromApi(d) {
|
|
|
2425
2425
|
if (!d) return d;
|
|
2426
2426
|
const pick2 = (...keys) => keys.reduce((v, k) => v ?? d[k], void 0);
|
|
2427
2427
|
const leadTypeRaw = pick2("leadType", "LeadType", "lead_type");
|
|
2428
|
-
let leadType =
|
|
2428
|
+
let leadType = null;
|
|
2429
2429
|
if (typeof leadTypeRaw === "number" && Number.isFinite(leadTypeRaw)) {
|
|
2430
2430
|
leadType = leadTypeRaw;
|
|
2431
2431
|
} else if (typeof leadTypeRaw === "string" && leadTypeRaw.trim() !== "") {
|
|
@@ -2458,7 +2458,7 @@ var LeadModel = types20.model("Lead", {
|
|
|
2458
2458
|
phone: types20.optional(types20.string, ""),
|
|
2459
2459
|
companyKey: types20.optional(types20.string, ""),
|
|
2460
2460
|
source: types20.optional(types20.string, ""),
|
|
2461
|
-
leadType: types20.optional(types20.number,
|
|
2461
|
+
leadType: types20.optional(types20.maybeNull(types20.number), null),
|
|
2462
2462
|
referrerLink: types20.optional(types20.string, ""),
|
|
2463
2463
|
description: types20.optional(types20.string, ""),
|
|
2464
2464
|
createdOn: types20.optional(types20.maybeNull(types20.string), null),
|