@wandzai/utils 1.0.76 → 1.0.78-use-config-diff-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 +3 -2
- package/src/common.d.ts +1 -1
- package/src/dom.d.ts +1 -0
- package/src/dom.js +10 -0
- package/src/dom.js.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/wandz.d.ts +2 -1
- package/src/wandz.js +3 -4
- package/src/wandz.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wandzai/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78-use-config-diff-1",
|
|
4
4
|
"description": "Common used utilities library",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"crypto-js": "^4.2.0",
|
|
13
13
|
"dayjs": "^1.11.13",
|
|
14
14
|
"html-entities": "^2.6.0",
|
|
15
|
-
"querystring": "^0.2.1"
|
|
15
|
+
"querystring": "^0.2.1",
|
|
16
|
+
"jsdom": "^27.4.0"
|
|
16
17
|
}
|
|
17
18
|
}
|
package/src/common.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const upperCaseFirstCharOfEachWord: (str: string) => string;
|
|
|
12
12
|
export declare const upperCaseFirstCharOfEachWordSplitBySpace: (str: string) => string;
|
|
13
13
|
export declare const jsonToConsistentString: (jsonObj: any) => string;
|
|
14
14
|
export declare const booleanStringToBoolean: (value: string) => value is "true";
|
|
15
|
-
export declare const booleanStringToNumber: (value: string) =>
|
|
15
|
+
export declare const booleanStringToNumber: (value: string) => 0 | 1;
|
|
16
16
|
export declare const normalizeSfResponseObjKeys: (obj: Record<string, any>) => {
|
|
17
17
|
[k: string]: any;
|
|
18
18
|
};
|
package/src/dom.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const domTextExtractor: (html: string) => string;
|
package/src/dom.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.domTextExtractor = void 0;
|
|
4
|
+
const jsdom_1 = require("jsdom");
|
|
5
|
+
const domTextExtractor = (html) => {
|
|
6
|
+
const dom = new jsdom_1.JSDOM(html);
|
|
7
|
+
return dom.window.document.body.textContent.trim();
|
|
8
|
+
};
|
|
9
|
+
exports.domTextExtractor = domTextExtractor;
|
|
10
|
+
//# sourceMappingURL=dom.js.map
|
package/src/dom.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../../libs/utils/src/dom.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAEvB,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAU,EAAE;IACvD,MAAM,GAAG,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AACrD,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B"}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -32,4 +32,5 @@ __exportStar(require("./sentry"), exports);
|
|
|
32
32
|
__exportStar(require("./activations"), exports);
|
|
33
33
|
__exportStar(require("./bee-free"), exports);
|
|
34
34
|
__exportStar(require("./gen-ai"), exports);
|
|
35
|
+
__exportStar(require("./dom"), exports);
|
|
35
36
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/utils/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,6CAA2B;AAC3B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/utils/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,2CAAyB;AACzB,gDAA8B;AAC9B,6CAA2B;AAC3B,2CAAyB;AACzB,wCAAsB"}
|
package/src/wandz.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdaptiveSearchReplaceLabels, AiFeatureDistributionType, IAdaptiveSearch, IAffinityBasedCustomAiFeatureConfig, IAiFeaturesBasicConfig, IAudience, IClientCustomAffinity, ICustomAiFeature, ICustomAudience, IEntityCommonDetails, IEventBasedCustomAiFeatureConfig, IInteraction, IPredictionModel, IStorageBasedCustomAiFeatureConfig, IWandzAiFeaturesConfig, WandzAllEntities } from '@wandzai/wandz-interfaces';
|
|
1
|
+
import { AdaptiveSearchReplaceLabels, AiFeatureDistributionType, IAdaptiveSearch, IAffinityBasedCustomAiFeatureConfig, IAiFeaturesBasicConfig, IAudience, IClientCustomAffinity, ICustomAiFeature, ICustomAudience, IEntityCommonDetails, IEventBasedCustomAiFeatureConfig, IInteraction, IPredictionModel, IStorageBasedCustomAiFeatureConfig, IWandzAiFeaturesConfig, Variants, WandzActivations, WandzAllEntities } from '@wandzai/wandz-interfaces';
|
|
2
2
|
export declare const entityTechNameBuilder: (entityName: string) => string;
|
|
3
3
|
export declare function isStorageBasedCustomAiFeature(feature: ICustomAiFeature): feature is IStorageBasedCustomAiFeatureConfig;
|
|
4
4
|
export declare function isAffinityBasedCustomAiFeature(feature: ICustomAiFeature): feature is IAffinityBasedCustomAiFeatureConfig;
|
|
@@ -19,3 +19,4 @@ export declare const getEntityType: (entity: IEntityCommonDetails) => WandzAllEn
|
|
|
19
19
|
export declare const getEntityDisplayName: (entity: IEntityCommonDetails) => string;
|
|
20
20
|
export declare const getAdaptiveSearchDataByField: (search: IAdaptiveSearch, label: AdaptiveSearchReplaceLabels) => any;
|
|
21
21
|
export declare const entityKeyBuilder: (clientTag: string, domain: string, userName: string, identifier: string | number) => string;
|
|
22
|
+
export declare const comparedCampaignAliasBuilder: (type: WandzActivations, which: Variants) => string;
|
package/src/wandz.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityKeyBuilder = 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;
|
|
3
|
+
exports.comparedCampaignAliasBuilder = exports.entityKeyBuilder = 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
4
|
exports.isStorageBasedCustomAiFeature = isStorageBasedCustomAiFeature;
|
|
5
5
|
exports.isAffinityBasedCustomAiFeature = isAffinityBasedCustomAiFeature;
|
|
6
6
|
exports.isEventBasedCustomAiFeature = isEventBasedCustomAiFeature;
|
|
@@ -52,15 +52,12 @@ exports.isModel = isModel;
|
|
|
52
52
|
function isEvent(entity) {
|
|
53
53
|
return (0, exports.isAiFeature)(entity) && entity.entitySubType === wandz_interfaces_1.WandzEntities.EVENT;
|
|
54
54
|
}
|
|
55
|
-
;
|
|
56
55
|
function isCustomAffinity(entity) {
|
|
57
56
|
return entity.entityType === wandz_interfaces_1.AffinityTypes.CUSTOM;
|
|
58
57
|
}
|
|
59
|
-
;
|
|
60
58
|
function isInteraction(entity) {
|
|
61
59
|
return entity.entityType === wandz_interfaces_1.WandzEntities.INTERACTION;
|
|
62
60
|
}
|
|
63
|
-
;
|
|
64
61
|
const isCustomEntity = (entity) => {
|
|
65
62
|
return entity.isCustom;
|
|
66
63
|
};
|
|
@@ -119,4 +116,6 @@ const entityKeyBuilder = (clientTag, domain, userName, identifier) => {
|
|
|
119
116
|
return `${clientTag}_${domain}_${userName}_${identifier}`;
|
|
120
117
|
};
|
|
121
118
|
exports.entityKeyBuilder = entityKeyBuilder;
|
|
119
|
+
const comparedCampaignAliasBuilder = (type, which) => `${wandz_interfaces_1.ENTITIES_DISPLAY_NAME[type]} ${which}`;
|
|
120
|
+
exports.comparedCampaignAliasBuilder = comparedCampaignAliasBuilder;
|
|
122
121
|
//# 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":";;;AAuCA,sEAIC;AAED,wEAIC;AAED,kEAEC;AAqBD,0BAEC;AACD,4CAEC;AAED,sCAEC;AAnFD,gEAsBmC;AAG5B,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE;IAK1D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACZ,CA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