akeyless-client-commons 1.1.119 → 1.1.121
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/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/helpers/index.d.mts +19 -3
- package/dist/helpers/index.d.ts +19 -3
- package/dist/helpers/index.js +54 -26
- package/dist/helpers/index.mjs +51 -27
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -7077,7 +7077,7 @@ var ModularForm = function(param) {
|
|
|
7077
7077
|
].includes(element2.type);
|
|
7078
7078
|
};
|
|
7079
7079
|
if (hasMinLengthType(element) && element.minLength) {
|
|
7080
|
-
var elementValue = getFormElementValue(form, element.name);
|
|
7080
|
+
var elementValue = getFormElementValue(form, element.name).trim();
|
|
7081
7081
|
if (elementValue.length < element.minLength) {
|
|
7082
7082
|
throw element.validationError || "".concat(element.labelContent || element.name, " must be at least ").concat(element.minLength, " characters");
|
|
7083
7083
|
}
|
|
@@ -6849,7 +6849,7 @@ var ModularForm = function(param) {
|
|
|
6849
6849
|
].includes(element2.type);
|
|
6850
6850
|
};
|
|
6851
6851
|
if (hasMinLengthType(element) && element.minLength) {
|
|
6852
|
-
var elementValue = getFormElementValue(form, element.name);
|
|
6852
|
+
var elementValue = getFormElementValue(form, element.name).trim();
|
|
6853
6853
|
if (elementValue.length < element.minLength) {
|
|
6854
6854
|
throw element.validationError || "".concat(element.labelContent || element.name, " must be at least ").concat(element.minLength, " characters");
|
|
6855
6855
|
}
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -291,11 +291,27 @@ declare const initializeUserPermissions: ({ phoneNumber, email, firstTimeArray,
|
|
|
291
291
|
interface EmailAttachment {
|
|
292
292
|
content: string;
|
|
293
293
|
filename: string;
|
|
294
|
-
type
|
|
295
|
-
disposition
|
|
294
|
+
type?: string;
|
|
295
|
+
disposition?: "attachment" | "inline";
|
|
296
|
+
content_id?: string;
|
|
296
297
|
}
|
|
297
298
|
declare const createAttachmentFromBlob: (blob: Blob, filename: string, mimeType?: string, disposition?: "attachment" | "inline") => Promise<EmailAttachment>;
|
|
298
299
|
declare const createAttachmentFromUrl: (url: string, filename?: string) => Promise<EmailAttachment>;
|
|
300
|
+
interface EmailData {
|
|
301
|
+
subject: string;
|
|
302
|
+
entity_for_audit: string;
|
|
303
|
+
to?: string | string[];
|
|
304
|
+
from?: string | {
|
|
305
|
+
email: string;
|
|
306
|
+
name?: string;
|
|
307
|
+
};
|
|
308
|
+
group_name?: string;
|
|
309
|
+
cc?: string | string[];
|
|
310
|
+
body_plain_text?: string;
|
|
311
|
+
body_html?: string;
|
|
312
|
+
attachments?: EmailAttachment[];
|
|
313
|
+
}
|
|
314
|
+
declare const sendEmail: (data: EmailData) => Promise<any>;
|
|
299
315
|
|
|
300
316
|
interface GetDataPayload<T = any> {
|
|
301
317
|
key: string;
|
|
@@ -338,4 +354,4 @@ declare const multiply: (a: number, b: number) => number;
|
|
|
338
354
|
declare const add: (a: number, b: number) => number;
|
|
339
355
|
declare const subtract: (a: number, b: number) => number;
|
|
340
356
|
|
|
341
|
-
export { type EmailAttachment, type ValidationType, add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
357
|
+
export { type EmailAttachment, type EmailData, type ValidationType, add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, sendEmail, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -291,11 +291,27 @@ declare const initializeUserPermissions: ({ phoneNumber, email, firstTimeArray,
|
|
|
291
291
|
interface EmailAttachment {
|
|
292
292
|
content: string;
|
|
293
293
|
filename: string;
|
|
294
|
-
type
|
|
295
|
-
disposition
|
|
294
|
+
type?: string;
|
|
295
|
+
disposition?: "attachment" | "inline";
|
|
296
|
+
content_id?: string;
|
|
296
297
|
}
|
|
297
298
|
declare const createAttachmentFromBlob: (blob: Blob, filename: string, mimeType?: string, disposition?: "attachment" | "inline") => Promise<EmailAttachment>;
|
|
298
299
|
declare const createAttachmentFromUrl: (url: string, filename?: string) => Promise<EmailAttachment>;
|
|
300
|
+
interface EmailData {
|
|
301
|
+
subject: string;
|
|
302
|
+
entity_for_audit: string;
|
|
303
|
+
to?: string | string[];
|
|
304
|
+
from?: string | {
|
|
305
|
+
email: string;
|
|
306
|
+
name?: string;
|
|
307
|
+
};
|
|
308
|
+
group_name?: string;
|
|
309
|
+
cc?: string | string[];
|
|
310
|
+
body_plain_text?: string;
|
|
311
|
+
body_html?: string;
|
|
312
|
+
attachments?: EmailAttachment[];
|
|
313
|
+
}
|
|
314
|
+
declare const sendEmail: (data: EmailData) => Promise<any>;
|
|
299
315
|
|
|
300
316
|
interface GetDataPayload<T = any> {
|
|
301
317
|
key: string;
|
|
@@ -338,4 +354,4 @@ declare const multiply: (a: number, b: number) => number;
|
|
|
338
354
|
declare const add: (a: number, b: number) => number;
|
|
339
355
|
declare const subtract: (a: number, b: number) => number;
|
|
340
356
|
|
|
341
|
-
export { type EmailAttachment, type ValidationType, add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
357
|
+
export { type EmailAttachment, type EmailData, type ValidationType, add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, sendEmail, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
package/dist/helpers/index.js
CHANGED
|
@@ -634,6 +634,9 @@ __export(index_exports, {
|
|
|
634
634
|
secondsToDuration: function() {
|
|
635
635
|
return secondsToDuration;
|
|
636
636
|
},
|
|
637
|
+
sendEmail: function() {
|
|
638
|
+
return sendEmail;
|
|
639
|
+
},
|
|
637
640
|
setFormElementValue: function() {
|
|
638
641
|
return setFormElementValue;
|
|
639
642
|
},
|
|
@@ -2591,70 +2594,73 @@ var chargeDomain = isLocal ? "http://localhost:9012/api/charge" : baseDomain + "
|
|
|
2591
2594
|
var akeylessOnlineDomain = mode === "qa" ? "https://akeyless-online.xyz" : "https://akeyless-online.info";
|
|
2592
2595
|
var nxApiCall = /*#__PURE__*/ function() {
|
|
2593
2596
|
var _ref = _async_to_generator(function(serverName, method, url, data) {
|
|
2594
|
-
var urlResult, headers, _tmp, _tmp1, _, response, error, _error_response, _error_response1, details;
|
|
2597
|
+
var fixedUrl, _auth_currentUser, urlResult, headers, _tmp, _tmp1, _, response, error, _error_response, _error_response1, details;
|
|
2595
2598
|
return _ts_generator(this, function(_state) {
|
|
2596
2599
|
switch(_state.label){
|
|
2597
2600
|
case 0:
|
|
2601
|
+
fixedUrl = url.startsWith("/") ? url.slice(1) : url;
|
|
2602
|
+
_state.label = 1;
|
|
2603
|
+
case 1:
|
|
2598
2604
|
_state.trys.push([
|
|
2599
|
-
|
|
2600
|
-
|
|
2605
|
+
1,
|
|
2606
|
+
6,
|
|
2601
2607
|
,
|
|
2602
|
-
|
|
2608
|
+
7
|
|
2603
2609
|
]);
|
|
2604
|
-
urlResult = "".concat(devicesDomain, "/").concat(
|
|
2610
|
+
urlResult = "".concat(devicesDomain, "/").concat(fixedUrl);
|
|
2605
2611
|
switch(serverName){
|
|
2606
2612
|
case "bi":
|
|
2607
|
-
urlResult = "".concat(biDomain, "/").concat(
|
|
2613
|
+
urlResult = "".concat(biDomain, "/").concat(fixedUrl);
|
|
2608
2614
|
break;
|
|
2609
2615
|
case "devices":
|
|
2610
|
-
urlResult = "".concat(devicesDomain, "/").concat(
|
|
2616
|
+
urlResult = "".concat(devicesDomain, "/").concat(fixedUrl);
|
|
2611
2617
|
break;
|
|
2612
2618
|
case "notifications":
|
|
2613
|
-
urlResult = "".concat(notificationsDomain, "/").concat(
|
|
2619
|
+
urlResult = "".concat(notificationsDomain, "/").concat(fixedUrl);
|
|
2614
2620
|
break;
|
|
2615
2621
|
case "call-center-events":
|
|
2616
|
-
urlResult = "".concat(callCenterEventsDomain, "/").concat(
|
|
2622
|
+
urlResult = "".concat(callCenterEventsDomain, "/").concat(fixedUrl);
|
|
2617
2623
|
break;
|
|
2618
2624
|
case "call-center-geo":
|
|
2619
|
-
urlResult = "".concat(callCenterGeoDomain, "/").concat(
|
|
2625
|
+
urlResult = "".concat(callCenterGeoDomain, "/").concat(fixedUrl);
|
|
2620
2626
|
break;
|
|
2621
2627
|
case "data-socket":
|
|
2622
|
-
urlResult = "".concat(dataSocketDomain, "/").concat(
|
|
2628
|
+
urlResult = "".concat(dataSocketDomain, "/").concat(fixedUrl);
|
|
2623
2629
|
break;
|
|
2624
2630
|
case "data-sync":
|
|
2625
|
-
urlResult = "".concat(dataSyncDomain, "/").concat(
|
|
2631
|
+
urlResult = "".concat(dataSyncDomain, "/").concat(fixedUrl);
|
|
2626
2632
|
break;
|
|
2627
2633
|
case "charge":
|
|
2628
|
-
urlResult = "".concat(chargeDomain, "/").concat(
|
|
2634
|
+
urlResult = "".concat(chargeDomain, "/").concat(fixedUrl);
|
|
2629
2635
|
break;
|
|
2630
2636
|
case "end-users":
|
|
2631
|
-
urlResult = "".concat(endUsersDomain, "/").concat(
|
|
2637
|
+
urlResult = "".concat(endUsersDomain, "/").concat(fixedUrl);
|
|
2632
2638
|
break;
|
|
2633
2639
|
default:
|
|
2634
2640
|
break;
|
|
2635
2641
|
}
|
|
2636
2642
|
_tmp = {};
|
|
2637
|
-
if (!data.ignoreAuth) return [
|
|
2643
|
+
if (!(data === null || data === void 0 ? void 0 : data.ignoreAuth)) return [
|
|
2638
2644
|
3,
|
|
2639
|
-
|
|
2645
|
+
2
|
|
2640
2646
|
];
|
|
2641
2647
|
_tmp1 = void 0;
|
|
2642
2648
|
return [
|
|
2643
2649
|
3,
|
|
2644
|
-
|
|
2650
|
+
4
|
|
2645
2651
|
];
|
|
2646
|
-
case
|
|
2652
|
+
case 2:
|
|
2647
2653
|
_ = "bearer ";
|
|
2648
2654
|
return [
|
|
2649
2655
|
4,
|
|
2650
|
-
auth.currentUser.getIdToken()
|
|
2656
|
+
auth === null || auth === void 0 ? void 0 : (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.getIdToken()
|
|
2651
2657
|
];
|
|
2652
|
-
case 2:
|
|
2653
|
-
_tmp1 = _ + _state.sent();
|
|
2654
|
-
_state.label = 3;
|
|
2655
2658
|
case 3:
|
|
2659
|
+
_tmp1 = _ + _state.sent();
|
|
2660
|
+
_state.label = 4;
|
|
2661
|
+
case 4:
|
|
2656
2662
|
headers = (_tmp.authorization = _tmp1, _tmp);
|
|
2657
|
-
if (data.ignoreAuth) {
|
|
2663
|
+
if (data === null || data === void 0 ? void 0 : data.ignoreAuth) {
|
|
2658
2664
|
delete data.ignoreAuth;
|
|
2659
2665
|
}
|
|
2660
2666
|
return [
|
|
@@ -2666,13 +2672,13 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2666
2672
|
data: data
|
|
2667
2673
|
})
|
|
2668
2674
|
];
|
|
2669
|
-
case
|
|
2675
|
+
case 5:
|
|
2670
2676
|
response = _state.sent();
|
|
2671
2677
|
return [
|
|
2672
2678
|
2,
|
|
2673
2679
|
(response === null || response === void 0 ? void 0 : response.data) || null
|
|
2674
2680
|
];
|
|
2675
|
-
case
|
|
2681
|
+
case 6:
|
|
2676
2682
|
error = _state.sent();
|
|
2677
2683
|
details = {
|
|
2678
2684
|
serverName: serverName,
|
|
@@ -2687,7 +2693,7 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2687
2693
|
error: (error === null || error === void 0 ? void 0 : (_error_response1 = error.response) === null || _error_response1 === void 0 ? void 0 : _error_response1.data) || error
|
|
2688
2694
|
}, details)
|
|
2689
2695
|
];
|
|
2690
|
-
case
|
|
2696
|
+
case 7:
|
|
2691
2697
|
return [
|
|
2692
2698
|
2
|
|
2693
2699
|
];
|
|
@@ -2802,6 +2808,27 @@ var createAttachmentFromUrl = /*#__PURE__*/ function() {
|
|
|
2802
2808
|
return _ref.apply(this, arguments);
|
|
2803
2809
|
};
|
|
2804
2810
|
}();
|
|
2811
|
+
var sendEmail = /*#__PURE__*/ function() {
|
|
2812
|
+
var _ref = _async_to_generator(function(data) {
|
|
2813
|
+
return _ts_generator(this, function(_state) {
|
|
2814
|
+
switch(_state.label){
|
|
2815
|
+
case 0:
|
|
2816
|
+
return [
|
|
2817
|
+
4,
|
|
2818
|
+
nxApiCall("notifications", "POST", "email/send", data)
|
|
2819
|
+
];
|
|
2820
|
+
case 1:
|
|
2821
|
+
return [
|
|
2822
|
+
2,
|
|
2823
|
+
_state.sent()
|
|
2824
|
+
];
|
|
2825
|
+
}
|
|
2826
|
+
});
|
|
2827
|
+
});
|
|
2828
|
+
return function sendEmail(data) {
|
|
2829
|
+
return _ref.apply(this, arguments);
|
|
2830
|
+
};
|
|
2831
|
+
}();
|
|
2805
2832
|
// src/helpers/socket.ts
|
|
2806
2833
|
var import_socket = require("socket.io-client");
|
|
2807
2834
|
var SESSION_STORAGE_KEY = "sessionId";
|
|
@@ -3226,6 +3253,7 @@ var subtract = function(a, b) {
|
|
|
3226
3253
|
query_documents_by_conditions: query_documents_by_conditions,
|
|
3227
3254
|
renderOnce: renderOnce,
|
|
3228
3255
|
secondsToDuration: secondsToDuration,
|
|
3256
|
+
sendEmail: sendEmail,
|
|
3229
3257
|
setFormElementValue: setFormElementValue,
|
|
3230
3258
|
setState: setState,
|
|
3231
3259
|
set_document: set_document,
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -2191,70 +2191,73 @@ var chargeDomain = isLocal ? "http://localhost:9012/api/charge" : baseDomain + "
|
|
|
2191
2191
|
var akeylessOnlineDomain = mode === "qa" ? "https://akeyless-online.xyz" : "https://akeyless-online.info";
|
|
2192
2192
|
var nxApiCall = /*#__PURE__*/ function() {
|
|
2193
2193
|
var _ref = _async_to_generator(function(serverName, method, url, data) {
|
|
2194
|
-
var urlResult, headers, _tmp, _tmp1, _, response, error, _error_response, _error_response1, details;
|
|
2194
|
+
var fixedUrl, _auth_currentUser, urlResult, headers, _tmp, _tmp1, _, response, error, _error_response, _error_response1, details;
|
|
2195
2195
|
return _ts_generator(this, function(_state) {
|
|
2196
2196
|
switch(_state.label){
|
|
2197
2197
|
case 0:
|
|
2198
|
+
fixedUrl = url.startsWith("/") ? url.slice(1) : url;
|
|
2199
|
+
_state.label = 1;
|
|
2200
|
+
case 1:
|
|
2198
2201
|
_state.trys.push([
|
|
2199
|
-
|
|
2200
|
-
|
|
2202
|
+
1,
|
|
2203
|
+
6,
|
|
2201
2204
|
,
|
|
2202
|
-
|
|
2205
|
+
7
|
|
2203
2206
|
]);
|
|
2204
|
-
urlResult = "".concat(devicesDomain, "/").concat(
|
|
2207
|
+
urlResult = "".concat(devicesDomain, "/").concat(fixedUrl);
|
|
2205
2208
|
switch(serverName){
|
|
2206
2209
|
case "bi":
|
|
2207
|
-
urlResult = "".concat(biDomain, "/").concat(
|
|
2210
|
+
urlResult = "".concat(biDomain, "/").concat(fixedUrl);
|
|
2208
2211
|
break;
|
|
2209
2212
|
case "devices":
|
|
2210
|
-
urlResult = "".concat(devicesDomain, "/").concat(
|
|
2213
|
+
urlResult = "".concat(devicesDomain, "/").concat(fixedUrl);
|
|
2211
2214
|
break;
|
|
2212
2215
|
case "notifications":
|
|
2213
|
-
urlResult = "".concat(notificationsDomain, "/").concat(
|
|
2216
|
+
urlResult = "".concat(notificationsDomain, "/").concat(fixedUrl);
|
|
2214
2217
|
break;
|
|
2215
2218
|
case "call-center-events":
|
|
2216
|
-
urlResult = "".concat(callCenterEventsDomain, "/").concat(
|
|
2219
|
+
urlResult = "".concat(callCenterEventsDomain, "/").concat(fixedUrl);
|
|
2217
2220
|
break;
|
|
2218
2221
|
case "call-center-geo":
|
|
2219
|
-
urlResult = "".concat(callCenterGeoDomain, "/").concat(
|
|
2222
|
+
urlResult = "".concat(callCenterGeoDomain, "/").concat(fixedUrl);
|
|
2220
2223
|
break;
|
|
2221
2224
|
case "data-socket":
|
|
2222
|
-
urlResult = "".concat(dataSocketDomain, "/").concat(
|
|
2225
|
+
urlResult = "".concat(dataSocketDomain, "/").concat(fixedUrl);
|
|
2223
2226
|
break;
|
|
2224
2227
|
case "data-sync":
|
|
2225
|
-
urlResult = "".concat(dataSyncDomain, "/").concat(
|
|
2228
|
+
urlResult = "".concat(dataSyncDomain, "/").concat(fixedUrl);
|
|
2226
2229
|
break;
|
|
2227
2230
|
case "charge":
|
|
2228
|
-
urlResult = "".concat(chargeDomain, "/").concat(
|
|
2231
|
+
urlResult = "".concat(chargeDomain, "/").concat(fixedUrl);
|
|
2229
2232
|
break;
|
|
2230
2233
|
case "end-users":
|
|
2231
|
-
urlResult = "".concat(endUsersDomain, "/").concat(
|
|
2234
|
+
urlResult = "".concat(endUsersDomain, "/").concat(fixedUrl);
|
|
2232
2235
|
break;
|
|
2233
2236
|
default:
|
|
2234
2237
|
break;
|
|
2235
2238
|
}
|
|
2236
2239
|
_tmp = {};
|
|
2237
|
-
if (!data.ignoreAuth) return [
|
|
2240
|
+
if (!(data === null || data === void 0 ? void 0 : data.ignoreAuth)) return [
|
|
2238
2241
|
3,
|
|
2239
|
-
|
|
2242
|
+
2
|
|
2240
2243
|
];
|
|
2241
2244
|
_tmp1 = void 0;
|
|
2242
2245
|
return [
|
|
2243
2246
|
3,
|
|
2244
|
-
|
|
2247
|
+
4
|
|
2245
2248
|
];
|
|
2246
|
-
case
|
|
2249
|
+
case 2:
|
|
2247
2250
|
_ = "bearer ";
|
|
2248
2251
|
return [
|
|
2249
2252
|
4,
|
|
2250
|
-
auth.currentUser.getIdToken()
|
|
2253
|
+
auth === null || auth === void 0 ? void 0 : (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.getIdToken()
|
|
2251
2254
|
];
|
|
2252
|
-
case 2:
|
|
2253
|
-
_tmp1 = _ + _state.sent();
|
|
2254
|
-
_state.label = 3;
|
|
2255
2255
|
case 3:
|
|
2256
|
+
_tmp1 = _ + _state.sent();
|
|
2257
|
+
_state.label = 4;
|
|
2258
|
+
case 4:
|
|
2256
2259
|
headers = (_tmp.authorization = _tmp1, _tmp);
|
|
2257
|
-
if (data.ignoreAuth) {
|
|
2260
|
+
if (data === null || data === void 0 ? void 0 : data.ignoreAuth) {
|
|
2258
2261
|
delete data.ignoreAuth;
|
|
2259
2262
|
}
|
|
2260
2263
|
return [
|
|
@@ -2266,13 +2269,13 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2266
2269
|
data: data
|
|
2267
2270
|
})
|
|
2268
2271
|
];
|
|
2269
|
-
case
|
|
2272
|
+
case 5:
|
|
2270
2273
|
response = _state.sent();
|
|
2271
2274
|
return [
|
|
2272
2275
|
2,
|
|
2273
2276
|
(response === null || response === void 0 ? void 0 : response.data) || null
|
|
2274
2277
|
];
|
|
2275
|
-
case
|
|
2278
|
+
case 6:
|
|
2276
2279
|
error = _state.sent();
|
|
2277
2280
|
details = {
|
|
2278
2281
|
serverName: serverName,
|
|
@@ -2287,7 +2290,7 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2287
2290
|
error: (error === null || error === void 0 ? void 0 : (_error_response1 = error.response) === null || _error_response1 === void 0 ? void 0 : _error_response1.data) || error
|
|
2288
2291
|
}, details)
|
|
2289
2292
|
];
|
|
2290
|
-
case
|
|
2293
|
+
case 7:
|
|
2291
2294
|
return [
|
|
2292
2295
|
2
|
|
2293
2296
|
];
|
|
@@ -2402,6 +2405,27 @@ var createAttachmentFromUrl = /*#__PURE__*/ function() {
|
|
|
2402
2405
|
return _ref.apply(this, arguments);
|
|
2403
2406
|
};
|
|
2404
2407
|
}();
|
|
2408
|
+
var sendEmail = /*#__PURE__*/ function() {
|
|
2409
|
+
var _ref = _async_to_generator(function(data) {
|
|
2410
|
+
return _ts_generator(this, function(_state) {
|
|
2411
|
+
switch(_state.label){
|
|
2412
|
+
case 0:
|
|
2413
|
+
return [
|
|
2414
|
+
4,
|
|
2415
|
+
nxApiCall("notifications", "POST", "email/send", data)
|
|
2416
|
+
];
|
|
2417
|
+
case 1:
|
|
2418
|
+
return [
|
|
2419
|
+
2,
|
|
2420
|
+
_state.sent()
|
|
2421
|
+
];
|
|
2422
|
+
}
|
|
2423
|
+
});
|
|
2424
|
+
});
|
|
2425
|
+
return function sendEmail(data) {
|
|
2426
|
+
return _ref.apply(this, arguments);
|
|
2427
|
+
};
|
|
2428
|
+
}();
|
|
2405
2429
|
// src/helpers/socket.ts
|
|
2406
2430
|
import { io } from "socket.io-client";
|
|
2407
2431
|
var SESSION_STORAGE_KEY = "sessionId";
|
|
@@ -2735,5 +2759,5 @@ var add = function(a, b) {
|
|
|
2735
2759
|
var subtract = function(a, b) {
|
|
2736
2760
|
return a - b;
|
|
2737
2761
|
};
|
|
2738
|
-
export { add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
2762
|
+
export { add, addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chargeDomain, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createAttachmentFromBlob, createAttachmentFromUrl, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, endUsersDomain, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFileUrlFromStorage, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_fixed_or_service_number, is_iccid, is_msisdn, local_israel_phone_format, mode, multiStringFormat, multiply, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, parseSnapshotAsObject, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, sendEmail, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, subtract, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
2739
2763
|
//# sourceMappingURL=index.mjs.map
|