@blazeo.com/calendar-client 1.0.52 → 1.0.55
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 +20 -0
- package/dist/index.js +35 -10
- package/dist/index.mjs +35 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -355,9 +355,13 @@ export const LeadModel: {
|
|
|
355
355
|
companyKey: string;
|
|
356
356
|
email?: string;
|
|
357
357
|
phone?: string;
|
|
358
|
+
/** Legacy alias for firstName. */
|
|
358
359
|
name?: string;
|
|
359
360
|
firstName?: string;
|
|
360
361
|
first_name?: string;
|
|
362
|
+
lastName?: string;
|
|
363
|
+
last_name?: string;
|
|
364
|
+
salutation?: string;
|
|
361
365
|
source?: string;
|
|
362
366
|
leadType: 'sales' | 'service' | 'others' | number;
|
|
363
367
|
referrerLink?: string;
|
|
@@ -368,9 +372,13 @@ export const LeadModel: {
|
|
|
368
372
|
leadId: string;
|
|
369
373
|
email?: string;
|
|
370
374
|
companyKey?: string;
|
|
375
|
+
/** Legacy alias for firstName. */
|
|
371
376
|
name?: string;
|
|
372
377
|
firstName?: string;
|
|
373
378
|
first_name?: string;
|
|
379
|
+
lastName?: string;
|
|
380
|
+
last_name?: string;
|
|
381
|
+
salutation?: string;
|
|
374
382
|
phone?: string;
|
|
375
383
|
source?: string;
|
|
376
384
|
leadType: 'sales' | 'service' | 'others' | number;
|
|
@@ -412,6 +420,16 @@ export const LeadModel: {
|
|
|
412
420
|
searchText?: string;
|
|
413
421
|
search_text?: string;
|
|
414
422
|
search?: string;
|
|
423
|
+
/** Multiple column filters, ANDed together (combined with the single searchColumn/searchText pair when both are set). */
|
|
424
|
+
filters?: Array<{
|
|
425
|
+
column?: string;
|
|
426
|
+
searchColumn?: string;
|
|
427
|
+
search_column?: string;
|
|
428
|
+
text?: string;
|
|
429
|
+
searchText?: string;
|
|
430
|
+
search_text?: string;
|
|
431
|
+
search?: string;
|
|
432
|
+
}>;
|
|
415
433
|
page?: number;
|
|
416
434
|
page_size?: number;
|
|
417
435
|
}
|
|
@@ -469,6 +487,8 @@ export type ParticipantData = {
|
|
|
469
487
|
createdOn?: string | null;
|
|
470
488
|
modifiedOn?: string | null;
|
|
471
489
|
isDeleted?: boolean;
|
|
490
|
+
/** Last stored authorization error; populated by Auth/IsAuthorized when not authorized. */
|
|
491
|
+
authorizationError?: string;
|
|
472
492
|
};
|
|
473
493
|
|
|
474
494
|
export const CALENDAR_AUTH_MESSAGE_TYPE: 'calendar-authorization';
|
package/dist/index.js
CHANGED
|
@@ -1635,7 +1635,8 @@ function mapParticipantFromApi(d) {
|
|
|
1635
1635
|
provider: n(pick2("provider", "Provider", "emailProvider", "EmailProvider", "email_provider")) ?? 0,
|
|
1636
1636
|
createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
|
|
1637
1637
|
modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null,
|
|
1638
|
-
isDeleted: Boolean(pick2("isDeleted", "IsDeleted", "is_deleted"))
|
|
1638
|
+
isDeleted: Boolean(pick2("isDeleted", "IsDeleted", "is_deleted")),
|
|
1639
|
+
authorizationError: pick2("authorizationError", "AuthorizationError", "authorization_error") ?? ""
|
|
1639
1640
|
};
|
|
1640
1641
|
}
|
|
1641
1642
|
function mapFromApi2(d) {
|
|
@@ -2638,7 +2639,10 @@ function mapLeadFromApi(d) {
|
|
|
2638
2639
|
id: pick2("id", "Id") ?? null,
|
|
2639
2640
|
leadId: pick2("leadId", "LeadId", "lead_id") ?? "",
|
|
2640
2641
|
email: pick2("email", "Email") ?? "",
|
|
2641
|
-
|
|
2642
|
+
salutation: pick2("salutation", "Salutation") ?? "",
|
|
2643
|
+
// name/Name fallbacks cover API instances not yet redeployed with first_name
|
|
2644
|
+
firstName: pick2("firstName", "FirstName", "first_name", "name", "Name") ?? "",
|
|
2645
|
+
lastName: pick2("lastName", "LastName", "last_name") ?? "",
|
|
2642
2646
|
phone: pick2("phone", "Phone") ?? "",
|
|
2643
2647
|
companyKey: pick2("companyKey", "CompanyKey", "company_key") ?? "",
|
|
2644
2648
|
source: pick2("source", "Source") ?? "",
|
|
@@ -2653,7 +2657,9 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
|
|
|
2653
2657
|
id: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.maybeNull(import_mobx_state_tree20.types.number), null),
|
|
2654
2658
|
leadId: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.identifier, "new"),
|
|
2655
2659
|
email: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2656
|
-
|
|
2660
|
+
salutation: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2661
|
+
firstName: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2662
|
+
lastName: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2657
2663
|
phone: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2658
2664
|
companyKey: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
2659
2665
|
source: import_mobx_state_tree20.types.optional(import_mobx_state_tree20.types.string, ""),
|
|
@@ -2715,13 +2721,15 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
|
|
|
2715
2721
|
email: self.email,
|
|
2716
2722
|
phone: self.phone,
|
|
2717
2723
|
companyKey: self.companyKey,
|
|
2718
|
-
firstName: self.
|
|
2724
|
+
firstName: self.firstName,
|
|
2719
2725
|
leadType: self.leadType
|
|
2720
2726
|
});
|
|
2721
2727
|
if (!validation.ok) return { status: "failure", message: validation.message };
|
|
2722
2728
|
const payload = {
|
|
2723
2729
|
email: self.email,
|
|
2724
|
-
|
|
2730
|
+
salutation: self.salutation,
|
|
2731
|
+
firstName: self.firstName,
|
|
2732
|
+
lastName: self.lastName,
|
|
2725
2733
|
phone: self.phone,
|
|
2726
2734
|
companyKey: self.companyKey,
|
|
2727
2735
|
source: self.source,
|
|
@@ -2744,14 +2752,16 @@ var LeadModel = import_mobx_state_tree20.types.model("Lead", {
|
|
|
2744
2752
|
leadId: self.leadId,
|
|
2745
2753
|
email: self.email,
|
|
2746
2754
|
phone: self.phone,
|
|
2747
|
-
firstName: self.
|
|
2755
|
+
firstName: self.firstName,
|
|
2748
2756
|
leadType: self.leadType
|
|
2749
2757
|
});
|
|
2750
2758
|
if (!validation.ok) return { status: "failure", message: validation.message };
|
|
2751
2759
|
const payload = {
|
|
2752
2760
|
leadId: self.leadId,
|
|
2753
2761
|
email: self.email,
|
|
2754
|
-
|
|
2762
|
+
salutation: self.salutation,
|
|
2763
|
+
firstName: self.firstName,
|
|
2764
|
+
lastName: self.lastName,
|
|
2755
2765
|
phone: self.phone,
|
|
2756
2766
|
companyKey: self.companyKey,
|
|
2757
2767
|
source: self.source,
|
|
@@ -2819,7 +2829,9 @@ LeadModel.allowedColumns = [
|
|
|
2819
2829
|
"id",
|
|
2820
2830
|
"lead_id",
|
|
2821
2831
|
"email",
|
|
2822
|
-
"
|
|
2832
|
+
"salutation",
|
|
2833
|
+
"first_name",
|
|
2834
|
+
"last_name",
|
|
2823
2835
|
"phone",
|
|
2824
2836
|
"company_key",
|
|
2825
2837
|
"source",
|
|
@@ -2857,10 +2869,23 @@ LeadModel.getByCompany = async (companyKey, opts = {}) => {
|
|
|
2857
2869
|
const u = String(sortOrderRaw).trim().toUpperCase();
|
|
2858
2870
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
2859
2871
|
}
|
|
2872
|
+
const filterPairs = [];
|
|
2860
2873
|
const searchColumn = opts.searchColumn ?? opts.search_column ?? opts.column;
|
|
2861
|
-
if (searchColumn != null && String(searchColumn).trim() !== "") query.search_column = String(searchColumn).trim();
|
|
2862
2874
|
const searchText = opts.searchText ?? opts.search_text ?? opts.search;
|
|
2863
|
-
|
|
2875
|
+
const singleColumn = searchColumn != null ? String(searchColumn).trim() : "";
|
|
2876
|
+
const singleText = searchText != null ? String(searchText).trim() : "";
|
|
2877
|
+
if (singleColumn && singleText) filterPairs.push({ column: singleColumn, text: singleText });
|
|
2878
|
+
if (Array.isArray(opts.filters)) {
|
|
2879
|
+
for (const f of opts.filters) {
|
|
2880
|
+
const column = String((f == null ? void 0 : f.column) ?? (f == null ? void 0 : f.searchColumn) ?? (f == null ? void 0 : f.search_column) ?? "").trim();
|
|
2881
|
+
const text = String((f == null ? void 0 : f.text) ?? (f == null ? void 0 : f.searchText) ?? (f == null ? void 0 : f.search_text) ?? (f == null ? void 0 : f.search) ?? "").trim();
|
|
2882
|
+
if (column && text) filterPairs.push({ column, text });
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
if (filterPairs.length) {
|
|
2886
|
+
query.search_column = filterPairs.map((f) => f.column);
|
|
2887
|
+
query.search_text = filterPairs.map((f) => f.text);
|
|
2888
|
+
}
|
|
2864
2889
|
if (opts.page != null) {
|
|
2865
2890
|
query.page = opts.page;
|
|
2866
2891
|
if (opts.page_size != null) query.page_size = opts.page_size;
|
package/dist/index.mjs
CHANGED
|
@@ -1560,7 +1560,8 @@ function mapParticipantFromApi(d) {
|
|
|
1560
1560
|
provider: n(pick2("provider", "Provider", "emailProvider", "EmailProvider", "email_provider")) ?? 0,
|
|
1561
1561
|
createdOn: pick2("createdOn", "CreatedOn", "created_on") ?? null,
|
|
1562
1562
|
modifiedOn: pick2("modifiedOn", "ModifiedOn", "modified_on") ?? null,
|
|
1563
|
-
isDeleted: Boolean(pick2("isDeleted", "IsDeleted", "is_deleted"))
|
|
1563
|
+
isDeleted: Boolean(pick2("isDeleted", "IsDeleted", "is_deleted")),
|
|
1564
|
+
authorizationError: pick2("authorizationError", "AuthorizationError", "authorization_error") ?? ""
|
|
1564
1565
|
};
|
|
1565
1566
|
}
|
|
1566
1567
|
function mapFromApi2(d) {
|
|
@@ -2563,7 +2564,10 @@ function mapLeadFromApi(d) {
|
|
|
2563
2564
|
id: pick2("id", "Id") ?? null,
|
|
2564
2565
|
leadId: pick2("leadId", "LeadId", "lead_id") ?? "",
|
|
2565
2566
|
email: pick2("email", "Email") ?? "",
|
|
2566
|
-
|
|
2567
|
+
salutation: pick2("salutation", "Salutation") ?? "",
|
|
2568
|
+
// name/Name fallbacks cover API instances not yet redeployed with first_name
|
|
2569
|
+
firstName: pick2("firstName", "FirstName", "first_name", "name", "Name") ?? "",
|
|
2570
|
+
lastName: pick2("lastName", "LastName", "last_name") ?? "",
|
|
2567
2571
|
phone: pick2("phone", "Phone") ?? "",
|
|
2568
2572
|
companyKey: pick2("companyKey", "CompanyKey", "company_key") ?? "",
|
|
2569
2573
|
source: pick2("source", "Source") ?? "",
|
|
@@ -2578,7 +2582,9 @@ var LeadModel = types20.model("Lead", {
|
|
|
2578
2582
|
id: types20.optional(types20.maybeNull(types20.number), null),
|
|
2579
2583
|
leadId: types20.optional(types20.identifier, "new"),
|
|
2580
2584
|
email: types20.optional(types20.string, ""),
|
|
2581
|
-
|
|
2585
|
+
salutation: types20.optional(types20.string, ""),
|
|
2586
|
+
firstName: types20.optional(types20.string, ""),
|
|
2587
|
+
lastName: types20.optional(types20.string, ""),
|
|
2582
2588
|
phone: types20.optional(types20.string, ""),
|
|
2583
2589
|
companyKey: types20.optional(types20.string, ""),
|
|
2584
2590
|
source: types20.optional(types20.string, ""),
|
|
@@ -2640,13 +2646,15 @@ var LeadModel = types20.model("Lead", {
|
|
|
2640
2646
|
email: self.email,
|
|
2641
2647
|
phone: self.phone,
|
|
2642
2648
|
companyKey: self.companyKey,
|
|
2643
|
-
firstName: self.
|
|
2649
|
+
firstName: self.firstName,
|
|
2644
2650
|
leadType: self.leadType
|
|
2645
2651
|
});
|
|
2646
2652
|
if (!validation.ok) return { status: "failure", message: validation.message };
|
|
2647
2653
|
const payload = {
|
|
2648
2654
|
email: self.email,
|
|
2649
|
-
|
|
2655
|
+
salutation: self.salutation,
|
|
2656
|
+
firstName: self.firstName,
|
|
2657
|
+
lastName: self.lastName,
|
|
2650
2658
|
phone: self.phone,
|
|
2651
2659
|
companyKey: self.companyKey,
|
|
2652
2660
|
source: self.source,
|
|
@@ -2669,14 +2677,16 @@ var LeadModel = types20.model("Lead", {
|
|
|
2669
2677
|
leadId: self.leadId,
|
|
2670
2678
|
email: self.email,
|
|
2671
2679
|
phone: self.phone,
|
|
2672
|
-
firstName: self.
|
|
2680
|
+
firstName: self.firstName,
|
|
2673
2681
|
leadType: self.leadType
|
|
2674
2682
|
});
|
|
2675
2683
|
if (!validation.ok) return { status: "failure", message: validation.message };
|
|
2676
2684
|
const payload = {
|
|
2677
2685
|
leadId: self.leadId,
|
|
2678
2686
|
email: self.email,
|
|
2679
|
-
|
|
2687
|
+
salutation: self.salutation,
|
|
2688
|
+
firstName: self.firstName,
|
|
2689
|
+
lastName: self.lastName,
|
|
2680
2690
|
phone: self.phone,
|
|
2681
2691
|
companyKey: self.companyKey,
|
|
2682
2692
|
source: self.source,
|
|
@@ -2744,7 +2754,9 @@ LeadModel.allowedColumns = [
|
|
|
2744
2754
|
"id",
|
|
2745
2755
|
"lead_id",
|
|
2746
2756
|
"email",
|
|
2747
|
-
"
|
|
2757
|
+
"salutation",
|
|
2758
|
+
"first_name",
|
|
2759
|
+
"last_name",
|
|
2748
2760
|
"phone",
|
|
2749
2761
|
"company_key",
|
|
2750
2762
|
"source",
|
|
@@ -2782,10 +2794,23 @@ LeadModel.getByCompany = async (companyKey, opts = {}) => {
|
|
|
2782
2794
|
const u = String(sortOrderRaw).trim().toUpperCase();
|
|
2783
2795
|
query.sort_dir = u.startsWith("DESC") ? "desc" : "asc";
|
|
2784
2796
|
}
|
|
2797
|
+
const filterPairs = [];
|
|
2785
2798
|
const searchColumn = opts.searchColumn ?? opts.search_column ?? opts.column;
|
|
2786
|
-
if (searchColumn != null && String(searchColumn).trim() !== "") query.search_column = String(searchColumn).trim();
|
|
2787
2799
|
const searchText = opts.searchText ?? opts.search_text ?? opts.search;
|
|
2788
|
-
|
|
2800
|
+
const singleColumn = searchColumn != null ? String(searchColumn).trim() : "";
|
|
2801
|
+
const singleText = searchText != null ? String(searchText).trim() : "";
|
|
2802
|
+
if (singleColumn && singleText) filterPairs.push({ column: singleColumn, text: singleText });
|
|
2803
|
+
if (Array.isArray(opts.filters)) {
|
|
2804
|
+
for (const f of opts.filters) {
|
|
2805
|
+
const column = String((f == null ? void 0 : f.column) ?? (f == null ? void 0 : f.searchColumn) ?? (f == null ? void 0 : f.search_column) ?? "").trim();
|
|
2806
|
+
const text = String((f == null ? void 0 : f.text) ?? (f == null ? void 0 : f.searchText) ?? (f == null ? void 0 : f.search_text) ?? (f == null ? void 0 : f.search) ?? "").trim();
|
|
2807
|
+
if (column && text) filterPairs.push({ column, text });
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
if (filterPairs.length) {
|
|
2811
|
+
query.search_column = filterPairs.map((f) => f.column);
|
|
2812
|
+
query.search_text = filterPairs.map((f) => f.text);
|
|
2813
|
+
}
|
|
2789
2814
|
if (opts.page != null) {
|
|
2790
2815
|
query.page = opts.page;
|
|
2791
2816
|
if (opts.page_size != null) query.page_size = opts.page_size;
|