@blazeo.com/calendar-client 1.0.16 → 1.0.18
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 +10 -0
- package/dist/index.js +38 -1
- package/dist/index.mjs +38 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const CalendarModel: {
|
|
|
32
32
|
getTimeZones(): Promise<unknown>;
|
|
33
33
|
getTimeZone(timezoneId: string): Promise<unknown>;
|
|
34
34
|
getParticipants(calendarId: string): Promise<unknown>;
|
|
35
|
+
getAllParticipantOpeningHours(calendarId: string): Promise<unknown[] | null>;
|
|
35
36
|
getCalendarParticipant(calendarId: string): Promise<unknown>;
|
|
36
37
|
getParticipantsInfo(calendarId: string): Promise<unknown>;
|
|
37
38
|
getMonth(calendarId: string, year: number, month: number): Promise<unknown>;
|
|
@@ -158,6 +159,15 @@ export const LeadModel: {
|
|
|
158
159
|
referrerLink?: string;
|
|
159
160
|
}): Promise<unknown>;
|
|
160
161
|
deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
162
|
+
requestExport(
|
|
163
|
+
companyKey: string,
|
|
164
|
+
opts?: {
|
|
165
|
+
notifyPath?: string;
|
|
166
|
+
notify_path?: string;
|
|
167
|
+
consumer?: string;
|
|
168
|
+
Consumer?: string;
|
|
169
|
+
}
|
|
170
|
+
): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
161
171
|
getByCompany(
|
|
162
172
|
companyKey: string,
|
|
163
173
|
opts?: {
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ async function request(baseUrl, fetchFn, path, options = {}) {
|
|
|
147
147
|
}
|
|
148
148
|
function mergeConsumerHeader(env, opts) {
|
|
149
149
|
const headers = { ...opts.headers || {} };
|
|
150
|
-
if (env == null ? void 0 : env.consumer) headers["Consumer"] = env.consumer;
|
|
150
|
+
if (!headers["Consumer"] && (env == null ? void 0 : env.consumer)) headers["Consumer"] = env.consumer;
|
|
151
151
|
return { ...opts, headers };
|
|
152
152
|
}
|
|
153
153
|
function createRequestHelpers(self, getEnv9) {
|
|
@@ -907,6 +907,12 @@ var CalendarModel = import_mobx_state_tree8.types.model("Calendar", {
|
|
|
907
907
|
else if (self.calendarId) q.calendar_id = self.calendarId;
|
|
908
908
|
return reqGet("/Calendar/Participant/OpeningHours/Get", q);
|
|
909
909
|
},
|
|
910
|
+
/** GET Calendar/Participant/OpeningHours/All/Get */
|
|
911
|
+
async getAllParticipantOpeningHours(calendarId) {
|
|
912
|
+
const resolvedCalendarId = calendarId || self.calendarId;
|
|
913
|
+
if (!resolvedCalendarId) return { status: "failure", message: "calendarId required" };
|
|
914
|
+
return reqGet("/Calendar/Participant/OpeningHours/All/Get", { calendar_id: resolvedCalendarId });
|
|
915
|
+
},
|
|
910
916
|
/** POST Calendar/Participant/Availability/OpeningHour/Save */
|
|
911
917
|
async saveOpeningHour(payload) {
|
|
912
918
|
return reqPost("/Calendar/Participant/Availability/OpeningHour/Save", payload);
|
|
@@ -1103,6 +1109,11 @@ CalendarModel.getParticipants = async (calendarId) => {
|
|
|
1103
1109
|
}
|
|
1104
1110
|
return null;
|
|
1105
1111
|
};
|
|
1112
|
+
CalendarModel.getAllParticipantOpeningHours = async (calendarId) => {
|
|
1113
|
+
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
1114
|
+
const res = await reqGet("/Calendar/Participant/OpeningHours/All/Get", { calendar_id: calendarId });
|
|
1115
|
+
return res.status === "success" && Array.isArray(res.data) ? res.data : null;
|
|
1116
|
+
};
|
|
1106
1117
|
CalendarModel.getCalendarParticipant = async (calendarId) => {
|
|
1107
1118
|
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
1108
1119
|
const res = await reqGet("/Calendar/Participant/Get", { calendar_id: calendarId });
|
|
@@ -2072,6 +2083,16 @@ var LeadModel = import_mobx_state_tree17.types.model("Lead", {
|
|
|
2072
2083
|
return { status: "failure", message: "leadId required" };
|
|
2073
2084
|
}
|
|
2074
2085
|
return reqGet("/lead/delete", { lead_id: self.leadId });
|
|
2086
|
+
},
|
|
2087
|
+
/**
|
|
2088
|
+
* POST /lead/export/request – queue async full CSV export for self.companyKey (no list filters).
|
|
2089
|
+
* @param {object} [opts] – { notifyPath?, consumer? } consumer = Consumer header for completion webhook
|
|
2090
|
+
*/
|
|
2091
|
+
async requestLeadExport(opts = {}) {
|
|
2092
|
+
if (!self.companyKey || String(self.companyKey).trim() === "") {
|
|
2093
|
+
return { status: "failure", message: "companyKey required on model" };
|
|
2094
|
+
}
|
|
2095
|
+
return LeadModel.requestExport(self.companyKey, opts);
|
|
2075
2096
|
}
|
|
2076
2097
|
};
|
|
2077
2098
|
});
|
|
@@ -2146,6 +2167,22 @@ LeadModel.deleteLead = async (leadId) => {
|
|
|
2146
2167
|
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
2147
2168
|
return reqGet("/lead/delete", { lead_id: leadId });
|
|
2148
2169
|
};
|
|
2170
|
+
LeadModel.requestExport = async (companyKey, opts = {}) => {
|
|
2171
|
+
const ck = companyKey != null ? String(companyKey).trim() : "";
|
|
2172
|
+
if (!ck) return { status: "failure", message: "companyKey required" };
|
|
2173
|
+
const { reqPost } = createRequestHelpersFromEnv(getConfig());
|
|
2174
|
+
const body = { company_key: ck };
|
|
2175
|
+
const np = opts.notifyPath ?? opts.notify_path;
|
|
2176
|
+
if (np != null && String(np).trim() !== "") {
|
|
2177
|
+
body.notify_path = String(np).trim();
|
|
2178
|
+
}
|
|
2179
|
+
const headers = {};
|
|
2180
|
+
const consumer = opts.consumer ?? opts.Consumer;
|
|
2181
|
+
if (consumer != null && String(consumer).trim() !== "") {
|
|
2182
|
+
headers.Consumer = String(consumer).trim();
|
|
2183
|
+
}
|
|
2184
|
+
return reqPost("/lead/export/request", body, void 0, { headers });
|
|
2185
|
+
};
|
|
2149
2186
|
LeadModel.getSources = async (companyKey) => {
|
|
2150
2187
|
var _a;
|
|
2151
2188
|
if (!companyKey || String(companyKey).trim() === "") return [];
|
package/dist/index.mjs
CHANGED
|
@@ -94,7 +94,7 @@ async function request(baseUrl, fetchFn, path, options = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
function mergeConsumerHeader(env, opts) {
|
|
96
96
|
const headers = { ...opts.headers || {} };
|
|
97
|
-
if (env == null ? void 0 : env.consumer) headers["Consumer"] = env.consumer;
|
|
97
|
+
if (!headers["Consumer"] && (env == null ? void 0 : env.consumer)) headers["Consumer"] = env.consumer;
|
|
98
98
|
return { ...opts, headers };
|
|
99
99
|
}
|
|
100
100
|
function createRequestHelpers(self, getEnv9) {
|
|
@@ -854,6 +854,12 @@ var CalendarModel = types8.model("Calendar", {
|
|
|
854
854
|
else if (self.calendarId) q.calendar_id = self.calendarId;
|
|
855
855
|
return reqGet("/Calendar/Participant/OpeningHours/Get", q);
|
|
856
856
|
},
|
|
857
|
+
/** GET Calendar/Participant/OpeningHours/All/Get */
|
|
858
|
+
async getAllParticipantOpeningHours(calendarId) {
|
|
859
|
+
const resolvedCalendarId = calendarId || self.calendarId;
|
|
860
|
+
if (!resolvedCalendarId) return { status: "failure", message: "calendarId required" };
|
|
861
|
+
return reqGet("/Calendar/Participant/OpeningHours/All/Get", { calendar_id: resolvedCalendarId });
|
|
862
|
+
},
|
|
857
863
|
/** POST Calendar/Participant/Availability/OpeningHour/Save */
|
|
858
864
|
async saveOpeningHour(payload) {
|
|
859
865
|
return reqPost("/Calendar/Participant/Availability/OpeningHour/Save", payload);
|
|
@@ -1050,6 +1056,11 @@ CalendarModel.getParticipants = async (calendarId) => {
|
|
|
1050
1056
|
}
|
|
1051
1057
|
return null;
|
|
1052
1058
|
};
|
|
1059
|
+
CalendarModel.getAllParticipantOpeningHours = async (calendarId) => {
|
|
1060
|
+
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
1061
|
+
const res = await reqGet("/Calendar/Participant/OpeningHours/All/Get", { calendar_id: calendarId });
|
|
1062
|
+
return res.status === "success" && Array.isArray(res.data) ? res.data : null;
|
|
1063
|
+
};
|
|
1053
1064
|
CalendarModel.getCalendarParticipant = async (calendarId) => {
|
|
1054
1065
|
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
1055
1066
|
const res = await reqGet("/Calendar/Participant/Get", { calendar_id: calendarId });
|
|
@@ -2019,6 +2030,16 @@ var LeadModel = types17.model("Lead", {
|
|
|
2019
2030
|
return { status: "failure", message: "leadId required" };
|
|
2020
2031
|
}
|
|
2021
2032
|
return reqGet("/lead/delete", { lead_id: self.leadId });
|
|
2033
|
+
},
|
|
2034
|
+
/**
|
|
2035
|
+
* POST /lead/export/request – queue async full CSV export for self.companyKey (no list filters).
|
|
2036
|
+
* @param {object} [opts] – { notifyPath?, consumer? } consumer = Consumer header for completion webhook
|
|
2037
|
+
*/
|
|
2038
|
+
async requestLeadExport(opts = {}) {
|
|
2039
|
+
if (!self.companyKey || String(self.companyKey).trim() === "") {
|
|
2040
|
+
return { status: "failure", message: "companyKey required on model" };
|
|
2041
|
+
}
|
|
2042
|
+
return LeadModel.requestExport(self.companyKey, opts);
|
|
2022
2043
|
}
|
|
2023
2044
|
};
|
|
2024
2045
|
});
|
|
@@ -2093,6 +2114,22 @@ LeadModel.deleteLead = async (leadId) => {
|
|
|
2093
2114
|
const { reqGet } = createRequestHelpersFromEnv(getConfig());
|
|
2094
2115
|
return reqGet("/lead/delete", { lead_id: leadId });
|
|
2095
2116
|
};
|
|
2117
|
+
LeadModel.requestExport = async (companyKey, opts = {}) => {
|
|
2118
|
+
const ck = companyKey != null ? String(companyKey).trim() : "";
|
|
2119
|
+
if (!ck) return { status: "failure", message: "companyKey required" };
|
|
2120
|
+
const { reqPost } = createRequestHelpersFromEnv(getConfig());
|
|
2121
|
+
const body = { company_key: ck };
|
|
2122
|
+
const np = opts.notifyPath ?? opts.notify_path;
|
|
2123
|
+
if (np != null && String(np).trim() !== "") {
|
|
2124
|
+
body.notify_path = String(np).trim();
|
|
2125
|
+
}
|
|
2126
|
+
const headers = {};
|
|
2127
|
+
const consumer = opts.consumer ?? opts.Consumer;
|
|
2128
|
+
if (consumer != null && String(consumer).trim() !== "") {
|
|
2129
|
+
headers.Consumer = String(consumer).trim();
|
|
2130
|
+
}
|
|
2131
|
+
return reqPost("/lead/export/request", body, void 0, { headers });
|
|
2132
|
+
};
|
|
2096
2133
|
LeadModel.getSources = async (companyKey) => {
|
|
2097
2134
|
var _a;
|
|
2098
2135
|
if (!companyKey || String(companyKey).trim() === "") return [];
|