@wandzai/utils 1.0.65-design-tip-history → 1.0.65-sentry-errors-fixes-1
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/package.json +1 -1
- package/src/common.d.ts +1 -1
- package/src/gzip.js +1 -2
- package/src/gzip.js.map +1 -1
- package/src/http.js +4 -5
- package/src/http.js.map +1 -1
- package/src/interactions.d.ts +1 -1
- package/src/wandz.d.ts +0 -1
- package/src/wandz.js +10 -11
- package/src/wandz.js.map +1 -1
package/package.json
CHANGED
package/src/common.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const upperCaseFirstChar: (word: string) => string;
|
|
|
9
9
|
export declare const upperCaseFirstCharOfEachWord: (str: string) => string;
|
|
10
10
|
export declare const upperCaseFirstCharOfEachWordSplitBySpace: (str: string) => string;
|
|
11
11
|
export declare const jsonToConsistentString: (jsonObj: any) => string;
|
|
12
|
-
export declare const booleanStringToBoolean: (value: string) =>
|
|
12
|
+
export declare const booleanStringToBoolean: (value: string) => value is "true";
|
|
13
13
|
export declare const booleanStringToNumber: (value: string) => 1 | 0;
|
|
14
14
|
export declare const normalizeSfResponseObjKeys: (obj: Record<string, any>) => {
|
|
15
15
|
[k: string]: any;
|
package/src/gzip.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gzipFile =
|
|
3
|
+
exports.gzipFile = gzipFile;
|
|
4
4
|
const zlib_1 = require("zlib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
function gzipFile(fileIn, fileOut) {
|
|
@@ -19,5 +19,4 @@ function gzipFile(fileIn, fileOut) {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
exports.gzipFile = gzipFile;
|
|
23
22
|
//# sourceMappingURL=gzip.js.map
|
package/src/gzip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gzip.js","sourceRoot":"","sources":["../../../../libs/utils/src/gzip.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gzip.js","sourceRoot":"","sources":["../../../../libs/utils/src/gzip.ts"],"names":[],"mappings":";;AAaA,4BAgBC;AAxBD,+BAAgC;AAChC,2BAAuD;AAOvD,SAAgB,QAAQ,CAAC,MAAc,EAAE,OAAe;IACtD,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,GAAG,GAAG,IAAA,qBAAgB,EAAC,MAAM,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,IAAA,sBAAiB,EAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,IAAA,iBAAU,GAAE,CAAC;QAE1B,GAAG;aACA,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,CAAC,GAAG,CAAC;aACT,EAAE,CAAC,QAAQ,EAAE;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;aACD,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/src/http.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getIpFromHttpRequest = getIpFromHttpRequest;
|
|
4
|
+
exports.buildUriBodyString = buildUriBodyString;
|
|
5
|
+
exports.getEncodedQueryParams = getEncodedQueryParams;
|
|
6
|
+
exports.buildQueryString = buildQueryString;
|
|
4
7
|
const querystring = require("querystring");
|
|
5
8
|
function getIpFromHttpRequest(req) {
|
|
6
9
|
return req.headers['x-forwarded-for']
|
|
7
10
|
? String(req.headers['x-forwarded-for']).split(',')[0].trim()
|
|
8
11
|
: req.socket.remoteAddress;
|
|
9
12
|
}
|
|
10
|
-
exports.getIpFromHttpRequest = getIpFromHttpRequest;
|
|
11
13
|
function buildUriBodyString(queryParams) {
|
|
12
14
|
return Object.keys(queryParams)
|
|
13
15
|
.map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(JSON.stringify(queryParams[key]))}`)
|
|
14
16
|
.join('&');
|
|
15
17
|
}
|
|
16
|
-
exports.buildUriBodyString = buildUriBodyString;
|
|
17
18
|
function getEncodedQueryParams(fullUrl) {
|
|
18
19
|
const queryStringStartIndex = fullUrl.indexOf('?');
|
|
19
20
|
if (queryStringStartIndex === -1) {
|
|
@@ -31,7 +32,6 @@ function getEncodedQueryParams(fullUrl) {
|
|
|
31
32
|
return acc;
|
|
32
33
|
}, {});
|
|
33
34
|
}
|
|
34
|
-
exports.getEncodedQueryParams = getEncodedQueryParams;
|
|
35
35
|
function buildQueryString(params) {
|
|
36
36
|
const queryParams = new URLSearchParams();
|
|
37
37
|
Object.entries(params).forEach(([key, value]) => {
|
|
@@ -44,5 +44,4 @@ function buildQueryString(params) {
|
|
|
44
44
|
});
|
|
45
45
|
return queryParams.toString();
|
|
46
46
|
}
|
|
47
|
-
exports.buildQueryString = buildQueryString;
|
|
48
47
|
//# sourceMappingURL=http.js.map
|
package/src/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../libs/utils/src/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../libs/utils/src/http.ts"],"names":[],"mappings":";;AAOA,oDAIC;AAED,gDAIC;AAQD,sDAkBC;AAQD,4CAYC;AA9DD,2CAA2C;AAM3C,SAAgB,oBAAoB,CAAC,GAAY;IAC/C,OAAO,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACnC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAA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AAC;IAE1C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;AAChC,CAAC"}
|
package/src/interactions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CloseButtonHtml, IInteraction } from '@wandzai/wandz-interfaces';
|
|
2
|
-
export declare const getCloseButton: (interaction: IInteraction, deviceType:
|
|
2
|
+
export declare const getCloseButton: (interaction: IInteraction, deviceType: "desktop" | "mobile", btnClassName?: string, btnId?: string, tagType?: string) => CloseButtonHtml;
|
package/src/wandz.d.ts
CHANGED
|
@@ -18,4 +18,3 @@ export declare const getEntityID: (entity: IEntityCommonDetails) => string | num
|
|
|
18
18
|
export declare const getEntityType: (entity: IEntityCommonDetails) => WandzAllEntities;
|
|
19
19
|
export declare const getEntityDisplayName: (entity: IEntityCommonDetails) => string;
|
|
20
20
|
export declare const getAdaptiveSearchDataByField: (search: IAdaptiveSearch, label: AdaptiveSearchReplaceLabels) => any;
|
|
21
|
-
export declare const entityKeyBuilder: (clientTag: string, domain: string, userName: string, identifier: string | number) => string;
|
package/src/wandz.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAdaptiveSearchDataByField = exports.getEntityDisplayName = exports.getEntityType = exports.getEntityID = exports.isInHouseAiFeature = exports.isCustomAiFeature = exports.isCustomAudience = exports.isCustomEntity = exports.isModel = exports.isAudience = exports.isAiFeature = exports.getCustomAiFeatureType = exports.entityTechNameBuilder = void 0;
|
|
4
|
+
exports.isStorageBasedCustomAiFeature = isStorageBasedCustomAiFeature;
|
|
5
|
+
exports.isAffinityBasedCustomAiFeature = isAffinityBasedCustomAiFeature;
|
|
6
|
+
exports.isEventBasedCustomAiFeature = isEventBasedCustomAiFeature;
|
|
7
|
+
exports.isEvent = isEvent;
|
|
8
|
+
exports.isCustomAffinity = isCustomAffinity;
|
|
9
|
+
exports.isInteraction = isInteraction;
|
|
4
10
|
const wandz_interfaces_1 = require("@wandzai/wandz-interfaces");
|
|
5
11
|
const entityTechNameBuilder = (entityName) => {
|
|
12
|
+
if (!entityName) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
6
15
|
return entityName
|
|
7
16
|
.toLowerCase()
|
|
8
17
|
.replace(/ /g, '_')
|
|
@@ -12,15 +21,12 @@ exports.entityTechNameBuilder = entityTechNameBuilder;
|
|
|
12
21
|
function isStorageBasedCustomAiFeature(feature) {
|
|
13
22
|
return feature.storageLogic != null;
|
|
14
23
|
}
|
|
15
|
-
exports.isStorageBasedCustomAiFeature = isStorageBasedCustomAiFeature;
|
|
16
24
|
function isAffinityBasedCustomAiFeature(feature) {
|
|
17
25
|
return feature.entitySubType === wandz_interfaces_1.WandzEntities.AFFINITY;
|
|
18
26
|
}
|
|
19
|
-
exports.isAffinityBasedCustomAiFeature = isAffinityBasedCustomAiFeature;
|
|
20
27
|
function isEventBasedCustomAiFeature(feature) {
|
|
21
28
|
return feature.entitySubType === wandz_interfaces_1.WandzEntities.EVENT;
|
|
22
29
|
}
|
|
23
|
-
exports.isEventBasedCustomAiFeature = isEventBasedCustomAiFeature;
|
|
24
30
|
const getCustomAiFeatureType = (feature) => {
|
|
25
31
|
if (isEventBasedCustomAiFeature(feature)) {
|
|
26
32
|
return 'event';
|
|
@@ -46,17 +52,14 @@ exports.isModel = isModel;
|
|
|
46
52
|
function isEvent(entity) {
|
|
47
53
|
return (0, exports.isAiFeature)(entity) && entity.entitySubType === wandz_interfaces_1.WandzEntities.EVENT;
|
|
48
54
|
}
|
|
49
|
-
exports.isEvent = isEvent;
|
|
50
55
|
;
|
|
51
56
|
function isCustomAffinity(entity) {
|
|
52
57
|
return entity.entityType === wandz_interfaces_1.AffinityTypes.CUSTOM;
|
|
53
58
|
}
|
|
54
|
-
exports.isCustomAffinity = isCustomAffinity;
|
|
55
59
|
;
|
|
56
60
|
function isInteraction(entity) {
|
|
57
61
|
return entity.entityType === wandz_interfaces_1.WandzEntities.INTERACTION;
|
|
58
62
|
}
|
|
59
|
-
exports.isInteraction = isInteraction;
|
|
60
63
|
;
|
|
61
64
|
const isCustomEntity = (entity) => {
|
|
62
65
|
return entity.isCustom;
|
|
@@ -112,8 +115,4 @@ const getAdaptiveSearchDataByField = (search, label) => {
|
|
|
112
115
|
}
|
|
113
116
|
};
|
|
114
117
|
exports.getAdaptiveSearchDataByField = getAdaptiveSearchDataByField;
|
|
115
|
-
const entityKeyBuilder = (clientTag, domain, userName, identifier) => {
|
|
116
|
-
return `${clientTag}_${domain}_${userName}_${identifier}`;
|
|
117
|
-
};
|
|
118
|
-
exports.entityKeyBuilder = entityKeyBuilder;
|
|
119
118
|
//# sourceMappingURL=wandz.js.map
|
package/src/wandz.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wandz.js","sourceRoot":"","sources":["../../../../libs/utils/src/wandz.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"wandz.js","sourceRoot":"","sources":["../../../../libs/utils/src/wandz.ts"],"names":[],"mappings":";;;AAkCA,sEAIC;AAED,wEAIC;AAED,kEAEC;AAqBD,0BAEC;AACD,4CAEC;AAED,sCAEC;AA9ED,gEAiBmC;AAG5B,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE;IAK1D,IAAI,CAAC,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