@convertcom/js-sdk-rules 1.0.2 → 2.1.0
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/README.md +2 -2
- package/lib/enums/index.d.ts +26 -0
- package/lib/enums/src/bucketing-error.d.ts +9 -0
- package/lib/enums/src/conversion-setting-key.d.ts +9 -0
- package/lib/enums/src/data-enitites.d.ts +16 -0
- package/lib/enums/src/dictionary.d.ts +65 -0
- package/lib/enums/src/do-not-track.d.ts +12 -0
- package/lib/enums/src/entity-type.d.ts +15 -0
- package/lib/enums/src/feature-status.d.ts +10 -0
- package/lib/enums/src/goal-data-key.d.ts +11 -0
- package/lib/enums/src/log-level.d.ts +14 -0
- package/lib/enums/src/log-method.d.ts +14 -0
- package/lib/enums/src/project-type.d.ts +10 -0
- package/lib/enums/src/rule-error.d.ts +10 -0
- package/lib/enums/src/segments/browser-type.d.ts +17 -0
- package/lib/enums/src/segments/device-type.d.ts +16 -0
- package/lib/enums/src/segments/segments-keys.d.ts +15 -0
- package/lib/enums/src/segments/source-type.d.ts +12 -0
- package/lib/enums/src/segments/visitor-type.d.ts +10 -0
- package/lib/enums/src/system-events.d.ts +22 -0
- package/lib/enums/src/variable-types.d.ts +7 -0
- package/lib/enums/src/variation-change-type.d.ts +14 -0
- package/lib/index.d.ts +10 -10
- package/lib/index.js +731 -33
- package/lib/index.js.map +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.map +1 -1
- package/lib/index.min.mjs +1 -1
- package/lib/index.min.mjs.map +1 -1
- package/lib/index.mjs +707 -9
- package/lib/index.mjs.map +1 -1
- package/lib/legacy/index.js +759 -140
- package/lib/legacy/index.js.map +1 -1
- package/lib/legacy/index.min.js +1 -1
- package/lib/legacy/index.min.js.map +1 -1
- package/lib/logger/index.d.ts +8 -0
- package/lib/logger/src/interfaces/log-client.d.ts +13 -0
- package/lib/logger/src/interfaces/log-manager.d.ts +18 -0
- package/lib/logger/src/interfaces/log-method-map.d.ts +15 -0
- package/lib/logger/src/log-manager.d.ts +64 -0
- package/lib/package.json +6 -6
- package/lib/rules/index.d.ts +8 -0
- package/lib/rules/src/interfaces/rule-manager.d.ts +14 -0
- package/lib/rules/src/rule-manager.d.ts +82 -0
- package/lib/types/index.d.ts +27 -0
- package/lib/types/src/BucketedFeature.d.ts +29 -0
- package/lib/types/src/BucketedVariation.d.ts +13 -0
- package/lib/types/src/BucketingAllocation.d.ts +10 -0
- package/lib/types/src/BucketingAttributes.d.ts +17 -0
- package/lib/types/src/BucketingHash.d.ts +11 -0
- package/lib/types/src/Config.d.ts +60 -0
- package/lib/types/src/ConversionAttributes.d.ts +13 -0
- package/lib/types/src/Entity.d.ts +8 -0
- package/lib/types/src/GoalData.d.ts +11 -0
- package/lib/types/src/IndentityField.d.ts +7 -0
- package/lib/types/src/Integration.d.ts +8 -0
- package/lib/types/src/LocationAttributes.d.ts +12 -0
- package/lib/types/src/Path.d.ts +10 -0
- package/lib/types/src/RequireAtLeastOne.d.ts +3 -0
- package/lib/types/src/Rule.d.ts +13 -0
- package/lib/types/src/SegmentsAttributes.d.ts +9 -0
- package/lib/types/src/StoreData.d.ts +13 -0
- package/lib/types/src/TrackingEvent.d.ts +14 -0
- package/lib/types/src/VariableType.d.ts +8 -0
- package/lib/types/src/Visitor.d.ts +12 -0
- package/lib/types/src/VisitorsQueue.d.ts +14 -0
- package/lib/types/src/config/index.d.ts +192 -0
- package/lib/types/src/config/models/Base64Image.d.ts +6 -0
- package/lib/types/src/config/models/BaseMatch.d.ts +8 -0
- package/lib/types/src/config/models/BaseRule.d.ts +6 -0
- package/lib/types/src/config/models/BaseRuleWithBooleanValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithBrowserNameValue.d.ts +21 -0
- package/lib/types/src/config/models/BaseRuleWithCountryCodeValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithDayOfWeekValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithExperienceBucketedValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithGoalTriggeredValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithHourOfDayValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithJsCodeValue.d.ts +9 -0
- package/lib/types/src/config/models/BaseRuleWithLanguageCodeValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithMinuteOfHourValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithNumericValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithOsValue.d.ts +21 -0
- package/lib/types/src/config/models/BaseRuleWithSegmentBucketedValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithStringValue.d.ts +7 -0
- package/lib/types/src/config/models/BaseRuleWithVisitorTypeValue.d.ts +16 -0
- package/lib/types/src/config/models/BaseRuleWithWeatherConditionValue.d.ts +34 -0
- package/lib/types/src/config/models/BoolMatchRulesTypes.d.ts +6 -0
- package/lib/types/src/config/models/BrowserNameMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/BrowserNameMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/BucketingEvent.d.ts +15 -0
- package/lib/types/src/config/models/ChoiceContainsOptions.d.ts +3 -0
- package/lib/types/src/config/models/ChoiceMatchingOptions.d.ts +3 -0
- package/lib/types/src/config/models/ClicksElementGoal.d.ts +11 -0
- package/lib/types/src/config/models/ClicksElementGoalSettings.d.ts +6 -0
- package/lib/types/src/config/models/ClicksLinkGoal.d.ts +11 -0
- package/lib/types/src/config/models/ClicksLinkGoalSettings.d.ts +6 -0
- package/lib/types/src/config/models/ConfigAudience.d.ts +21 -0
- package/lib/types/src/config/models/ConfigAudienceTypes.d.ts +10 -0
- package/lib/types/src/config/models/ConfigExperience.d.ts +98 -0
- package/lib/types/src/config/models/ConfigFeature.d.ts +22 -0
- package/lib/types/src/config/models/ConfigGoal.d.ts +9 -0
- package/lib/types/src/config/models/ConfigGoalBase.d.ts +24 -0
- package/lib/types/src/config/models/ConfigLocation.d.ts +21 -0
- package/lib/types/src/config/models/ConfigProject.d.ts +151 -0
- package/lib/types/src/config/models/ConfigResponseData.d.ts +45 -0
- package/lib/types/src/config/models/ConfigSegment.d.ts +19 -0
- package/lib/types/src/config/models/ConversionEvent.d.ts +30 -0
- package/lib/types/src/config/models/CookieMatchRule.d.ts +14 -0
- package/lib/types/src/config/models/CookieMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/CountryMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/CountryMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/DayOfWeekMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/DayOfWeekMatchRulesTypes.d.ts +4 -0
- package/lib/types/src/config/models/DomInteractionGoal.d.ts +11 -0
- package/lib/types/src/config/models/DomInteractionGoalSettings.d.ts +15 -0
- package/lib/types/src/config/models/ErrorData.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceBucketedMatchRule.d.ts +9 -0
- package/lib/types/src/config/models/ExperienceChange.d.ts +10 -0
- package/lib/types/src/config/models/ExperienceChangeAdd.d.ts +10 -0
- package/lib/types/src/config/models/ExperienceChangeBase.d.ts +27 -0
- package/lib/types/src/config/models/ExperienceChangeCustomCodeData.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeCustomCodeDataAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeCustomCodeDataBase.d.ts +29 -0
- package/lib/types/src/config/models/ExperienceChangeCustomCodeDataUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeCustomCodeDataUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeData.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataBase.d.ts +29 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeDataUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageData.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataBase.d.ts +33 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultCodeMultipageDataUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultRedirectData.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataBase.d.ts +29 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeDefaultRedirectDataUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeFullStackFeature.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeFullStackFeatureAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeFullStackFeatureBase.d.ts +25 -0
- package/lib/types/src/config/models/ExperienceChangeFullStackFeatureUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeFullStackFeatureUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeId.d.ts +9 -0
- package/lib/types/src/config/models/ExperienceChangeIdReadOnly.d.ts +9 -0
- package/lib/types/src/config/models/ExperienceChangeRichStructureData.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeRichStructureDataAdd.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeRichStructureDataBase.d.ts +16 -0
- package/lib/types/src/config/models/ExperienceChangeRichStructureDataUpdate.d.ts +6 -0
- package/lib/types/src/config/models/ExperienceChangeRichStructureDataUpdateNoId.d.ts +5 -0
- package/lib/types/src/config/models/ExperienceChangeUpdate.d.ts +10 -0
- package/lib/types/src/config/models/ExperienceChangeUpdateNoId.d.ts +10 -0
- package/lib/types/src/config/models/ExperienceIntegrationBaidu.d.ts +7 -0
- package/lib/types/src/config/models/ExperienceIntegrationBase.d.ts +10 -0
- package/lib/types/src/config/models/ExperienceIntegrationClicktale.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationClicky.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationCnzz.d.ts +7 -0
- package/lib/types/src/config/models/ExperienceIntegrationCrazyegg.d.ts +9 -0
- package/lib/types/src/config/models/ExperienceIntegrationEconda.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationEulerian.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationGA3.d.ts +9 -0
- package/lib/types/src/config/models/ExperienceIntegrationGA4.d.ts +8 -0
- package/lib/types/src/config/models/ExperienceIntegrationGA4Base.d.ts +4 -0
- package/lib/types/src/config/models/ExperienceIntegrationGAServing.d.ts +3 -0
- package/lib/types/src/config/models/ExperienceIntegrationGoogleAnalytics.d.ts +3 -0
- package/lib/types/src/config/models/ExperienceIntegrationGosquared.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationHeapanalytics.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationHotjar.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationMixpanel.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationMouseflow.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationPiwik.d.ts +7 -0
- package/lib/types/src/config/models/ExperienceIntegrationSegmentio.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationSitecatalyst.d.ts +7 -0
- package/lib/types/src/config/models/ExperienceIntegrationWoopra.d.ts +2 -0
- package/lib/types/src/config/models/ExperienceIntegrationYsance.d.ts +7 -0
- package/lib/types/src/config/models/ExperienceTypes.d.ts +8 -0
- package/lib/types/src/config/models/ExperienceVariationConfig.d.ts +30 -0
- package/lib/types/src/config/models/Extra.d.ts +4 -0
- package/lib/types/src/config/models/FeatureVariableItemData.d.ts +25 -0
- package/lib/types/src/config/models/GA_Settings.d.ts +3 -0
- package/lib/types/src/config/models/GA_SettingsBase.d.ts +6 -0
- package/lib/types/src/config/models/GaGoal.d.ts +11 -0
- package/lib/types/src/config/models/GaGoalSettings.d.ts +6 -0
- package/lib/types/src/config/models/GenericBoolKeyValueMatchRule.d.ts +11 -0
- package/lib/types/src/config/models/GenericBoolKeyValueMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/GenericBoolMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/GenericKey.d.ts +6 -0
- package/lib/types/src/config/models/GenericNumericKeyValueMatchRule.d.ts +11 -0
- package/lib/types/src/config/models/GenericNumericKeyValueMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/GenericNumericMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/GenericSetMatchRule.d.ts +9 -0
- package/lib/types/src/config/models/GenericTextKeyValueMatchRule.d.ts +11 -0
- package/lib/types/src/config/models/GenericTextKeyValueMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/GenericTextMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/GoalTriggeredMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/GoalTriggeredMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/GoalTypes.d.ts +10 -0
- package/lib/types/src/config/models/HourOfDayMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/HourOfDayMatchRulesTypes.d.ts +4 -0
- package/lib/types/src/config/models/IntegrationGA3.d.ts +12 -0
- package/lib/types/src/config/models/IntegrationGA4.d.ts +7 -0
- package/lib/types/src/config/models/IntegrationGA4Base.d.ts +12 -0
- package/lib/types/src/config/models/IntegrationProvider.d.ts +23 -0
- package/lib/types/src/config/models/JsConditionMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/JsConditionMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/KeyValueMatchRulesTypes.d.ts +4 -0
- package/lib/types/src/config/models/LanguageMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/LanguageMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/LocationTrigger.d.ts +5 -0
- package/lib/types/src/config/models/LocationTriggerBase.d.ts +14 -0
- package/lib/types/src/config/models/LocationTriggerCallback.d.ts +13 -0
- package/lib/types/src/config/models/LocationTriggerDomChange.d.ts +17 -0
- package/lib/types/src/config/models/LocationTriggerManual.d.ts +9 -0
- package/lib/types/src/config/models/LocationTriggerUrlChange.d.ts +9 -0
- package/lib/types/src/config/models/MinuteOfHourMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/MinuteOfHourMatchRulesTypes.d.ts +4 -0
- package/lib/types/src/config/models/NoSettingsGoal.d.ts +11 -0
- package/lib/types/src/config/models/NumericMatchRulesTypes.d.ts +8 -0
- package/lib/types/src/config/models/NumericMatchingOptions.d.ts +5 -0
- package/lib/types/src/config/models/OnlyCount.d.ts +7 -0
- package/lib/types/src/config/models/OsMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/OsMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/PageNumber.d.ts +9 -0
- package/lib/types/src/config/models/Pagination.d.ts +18 -0
- package/lib/types/src/config/models/ProjectGASettingsBase.d.ts +7 -0
- package/lib/types/src/config/models/ProjectIntegrationGA3.d.ts +3 -0
- package/lib/types/src/config/models/ProjectIntegrationGA4.d.ts +8 -0
- package/lib/types/src/config/models/ResultsPerPage.d.ts +10 -0
- package/lib/types/src/config/models/RevenueGoal.d.ts +11 -0
- package/lib/types/src/config/models/RevenueGoalSettings.d.ts +25 -0
- package/lib/types/src/config/models/RuleElement.d.ts +20 -0
- package/lib/types/src/config/models/RuleElementNoUrl.d.ts +20 -0
- package/lib/types/src/config/models/RuleObject.d.ts +20 -0
- package/lib/types/src/config/models/RuleObjectNoUrl.d.ts +20 -0
- package/lib/types/src/config/models/RulesTypes.d.ts +17 -0
- package/lib/types/src/config/models/ScrollPercentageGoal.d.ts +11 -0
- package/lib/types/src/config/models/ScrollPercentageGoalSettings.d.ts +6 -0
- package/lib/types/src/config/models/SegmentBucketedMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/SegmentBucketedMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/SendTrackingEventsRequestData.d.ts +39 -0
- package/lib/types/src/config/models/SetMatchingOptions.d.ts +3 -0
- package/lib/types/src/config/models/SortDirection.d.ts +21 -0
- package/lib/types/src/config/models/SubmitsFormGoal.d.ts +11 -0
- package/lib/types/src/config/models/SubmitsFormGoalSettings.d.ts +6 -0
- package/lib/types/src/config/models/SuccessData.d.ts +4 -0
- package/lib/types/src/config/models/TextMatchRulesTypes.d.ts +23 -0
- package/lib/types/src/config/models/TextMatchingOptions.d.ts +7 -0
- package/lib/types/src/config/models/UTC_Offset.d.ts +4 -0
- package/lib/types/src/config/models/UpdateExperienceChangeRequestData.d.ts +2 -0
- package/lib/types/src/config/models/VariationStatuses.d.ts +7 -0
- package/lib/types/src/config/models/VisitorSegments.d.ts +78 -0
- package/lib/types/src/config/models/VisitorTrackingEvents.d.ts +21 -0
- package/lib/types/src/config/models/VisitorTypeMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/VisitorTypeMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/WeatherConditionMatchRule.d.ts +10 -0
- package/lib/types/src/config/models/WeatherConditionMatchRulesTypes.d.ts +3 -0
- package/lib/types/src/config/models/WeatherConditions.d.ts +30 -0
- package/lib/utils/index.d.ts +14 -0
- package/lib/utils/src/array-utils.d.ts +11 -0
- package/lib/utils/src/comparisons.d.ts +22 -0
- package/lib/utils/src/data-store.d.ts +39 -0
- package/lib/utils/src/file-logger.d.ts +40 -0
- package/lib/utils/src/http-client.d.ts +115 -0
- package/lib/utils/src/object-utils.d.ts +35 -0
- package/lib/utils/src/string-utils.d.ts +20 -0
- package/lib/utils/src/types-utils.d.ts +12 -0
- package/package.json +35 -31
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VisitorSegments } from './VisitorSegments';
|
|
2
|
+
import type { VisitorTrackingEvents } from './VisitorTrackingEvents';
|
|
3
|
+
/**
|
|
4
|
+
* Tracking Request's data
|
|
5
|
+
*/
|
|
6
|
+
export type SendTrackingEventsRequestData = {
|
|
7
|
+
/**
|
|
8
|
+
* ID of the account under which the project is setup
|
|
9
|
+
*/
|
|
10
|
+
accountId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* ID of the project under which the tracking occurs
|
|
13
|
+
*/
|
|
14
|
+
projectId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Flag to determine whether the data is gonna be enriched before the events are stored for reporting.
|
|
17
|
+
* For example, in case of a conversion event, if this flag is on and bucketing is not provided, the bucketing stored on the backend datastore for the given visitor
|
|
18
|
+
* ID would be used. Same applies for segments.
|
|
19
|
+
*
|
|
20
|
+
* *Note*: this flag is only available for some plans
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
enrichData?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* List of visitors tracked. Each visitor can have multiple events.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
visitors?: Array<{
|
|
29
|
+
segments?: VisitorSegments;
|
|
30
|
+
/**
|
|
31
|
+
* Id of the visitor tracked
|
|
32
|
+
*/
|
|
33
|
+
visitorId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* List of events fired for the given visitor
|
|
36
|
+
*/
|
|
37
|
+
events?: Array<VisitorTrackingEvents>;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type SortDirection = {
|
|
2
|
+
/**
|
|
3
|
+
* Data sorting direction using "sort_by" field. "asc" for ascending direction, "desc" for descending direction
|
|
4
|
+
*
|
|
5
|
+
* Defaults to **desc** when not sent in a request
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
sort_direction?: SortDirection.sort_direction | null;
|
|
9
|
+
};
|
|
10
|
+
export declare namespace SortDirection {
|
|
11
|
+
/**
|
|
12
|
+
* Data sorting direction using "sort_by" field. "asc" for ascending direction, "desc" for descending direction
|
|
13
|
+
*
|
|
14
|
+
* Defaults to **desc** when not sent in a request
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
enum sort_direction {
|
|
18
|
+
ASC = "asc",
|
|
19
|
+
DESC = "desc"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConfigGoalBase } from './ConfigGoalBase';
|
|
2
|
+
import type { SubmitsFormGoalSettings } from './SubmitsFormGoalSettings';
|
|
3
|
+
export type SubmitsFormGoal = (ConfigGoalBase & {
|
|
4
|
+
type?: SubmitsFormGoal.type;
|
|
5
|
+
settings?: SubmitsFormGoalSettings;
|
|
6
|
+
});
|
|
7
|
+
export declare namespace SubmitsFormGoal {
|
|
8
|
+
enum type {
|
|
9
|
+
SUBMITS_FORM = "submits_form"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum TextMatchRulesTypes {
|
|
2
|
+
URL = "url",
|
|
3
|
+
URL_WITH_QUERY = "url_with_query",
|
|
4
|
+
QUERY_STRING = "query_string",
|
|
5
|
+
CAMPAIGN = "campaign",
|
|
6
|
+
KEYWORD = "keyword",
|
|
7
|
+
MEDIUM = "medium",
|
|
8
|
+
SOURCE_NAME = "source_name",
|
|
9
|
+
CITY = "city",
|
|
10
|
+
REGION = "region",
|
|
11
|
+
BROWSER_VERSION = "browser_version",
|
|
12
|
+
USER_AGENT = "user_agent",
|
|
13
|
+
PAGE_TAG_PAGE_TYPE = "page_tag_page_type",
|
|
14
|
+
PAGE_TAG_CATEGORY_ID = "page_tag_category_id",
|
|
15
|
+
PAGE_TAG_CATEGORY_NAME = "page_tag_category_name",
|
|
16
|
+
PAGE_TAG_PRODUCT_SKU = "page_tag_product_sku",
|
|
17
|
+
PAGE_TAG_PRODUCT_NAME = "page_tag_product_name",
|
|
18
|
+
PAGE_TAG_CUSTOMER_ID = "page_tag_customer_id",
|
|
19
|
+
PAGE_TAG_CUSTOM_1 = "page_tag_custom_1",
|
|
20
|
+
PAGE_TAG_CUSTOM_2 = "page_tag_custom_2",
|
|
21
|
+
PAGE_TAG_CUSTOM_3 = "page_tag_custom_3",
|
|
22
|
+
PAGE_TAG_CUSTOM_4 = "page_tag_custom_4"
|
|
23
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Segments under which this visitor is placed. Some defaults keys are accepted and any other free field **key value** could be used
|
|
3
|
+
* for fullstack projects
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type VisitorSegments = {
|
|
7
|
+
/**
|
|
8
|
+
* Browser used:
|
|
9
|
+
* IE - Internet Explorer
|
|
10
|
+
* CH - Chrome
|
|
11
|
+
* FF - Firefox
|
|
12
|
+
* OP - Opera
|
|
13
|
+
* SF - Safari
|
|
14
|
+
* OTH - Other
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
browser?: VisitorSegments.browser;
|
|
18
|
+
/**
|
|
19
|
+
* List of device classes that the visitor device falls into
|
|
20
|
+
*/
|
|
21
|
+
devices?: Array<'ALLPH' | 'IPH' | 'OTHPH' | 'ALLTAB' | 'IPAD' | 'OTHTAB' | 'DESK' | 'OTHDEV'>;
|
|
22
|
+
/**
|
|
23
|
+
* Traffic source
|
|
24
|
+
*/
|
|
25
|
+
source?: VisitorSegments.source;
|
|
26
|
+
/**
|
|
27
|
+
* Campaign string
|
|
28
|
+
*/
|
|
29
|
+
campaign?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Type of the visitor
|
|
32
|
+
*/
|
|
33
|
+
visitorType?: VisitorSegments.visitorType;
|
|
34
|
+
/**
|
|
35
|
+
* Two ISO country code for visitor's country
|
|
36
|
+
*/
|
|
37
|
+
country?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom Segments as defined inside Convert app. This will be the list of segments' IDs
|
|
40
|
+
*/
|
|
41
|
+
customSegments?: Array<string>;
|
|
42
|
+
};
|
|
43
|
+
export declare namespace VisitorSegments {
|
|
44
|
+
/**
|
|
45
|
+
* Browser used:
|
|
46
|
+
* IE - Internet Explorer
|
|
47
|
+
* CH - Chrome
|
|
48
|
+
* FF - Firefox
|
|
49
|
+
* OP - Opera
|
|
50
|
+
* SF - Safari
|
|
51
|
+
* OTH - Other
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
enum browser {
|
|
55
|
+
IE = "IE",
|
|
56
|
+
CH = "CH",
|
|
57
|
+
FF = "FF",
|
|
58
|
+
OP = "OP",
|
|
59
|
+
SF = "SF",
|
|
60
|
+
OTH = "OTH"
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Traffic source
|
|
64
|
+
*/
|
|
65
|
+
enum source {
|
|
66
|
+
CAMPAIGN = "campaign",
|
|
67
|
+
SEARCH = "search",
|
|
68
|
+
REFERRAL = "referral",
|
|
69
|
+
DIRECT = "direct"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Type of the visitor
|
|
73
|
+
*/
|
|
74
|
+
enum visitorType {
|
|
75
|
+
NEW = "new",
|
|
76
|
+
RETURNING = "returning"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BucketingEvent } from './BucketingEvent';
|
|
2
|
+
import type { ConversionEvent } from './ConversionEvent';
|
|
3
|
+
/**
|
|
4
|
+
* Tracking events related to the same user ID
|
|
5
|
+
*/
|
|
6
|
+
export type VisitorTrackingEvents = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of the event. It can be a bucketing or a conversion event
|
|
9
|
+
*/
|
|
10
|
+
eventType?: VisitorTrackingEvents.eventType;
|
|
11
|
+
data?: (BucketingEvent | ConversionEvent);
|
|
12
|
+
};
|
|
13
|
+
export declare namespace VisitorTrackingEvents {
|
|
14
|
+
/**
|
|
15
|
+
* Type of the event. It can be a bucketing or a conversion event
|
|
16
|
+
*/
|
|
17
|
+
enum eventType {
|
|
18
|
+
BUCKETING = "bucketing",
|
|
19
|
+
CONVERSION = "conversion"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BaseMatch } from './BaseMatch';
|
|
2
|
+
import type { BaseRuleWithVisitorTypeValue } from './BaseRuleWithVisitorTypeValue';
|
|
3
|
+
import type { ChoiceMatchingOptions } from './ChoiceMatchingOptions';
|
|
4
|
+
import type { VisitorTypeMatchRulesTypes } from './VisitorTypeMatchRulesTypes';
|
|
5
|
+
export type VisitorTypeMatchRule = (BaseRuleWithVisitorTypeValue & {
|
|
6
|
+
rule_type: VisitorTypeMatchRulesTypes;
|
|
7
|
+
matching?: (BaseMatch & {
|
|
8
|
+
match_type?: ChoiceMatchingOptions;
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BaseMatch } from './BaseMatch';
|
|
2
|
+
import type { BaseRuleWithWeatherConditionValue } from './BaseRuleWithWeatherConditionValue';
|
|
3
|
+
import type { TextMatchingOptions } from './TextMatchingOptions';
|
|
4
|
+
import type { WeatherConditionMatchRulesTypes } from './WeatherConditionMatchRulesTypes';
|
|
5
|
+
export type WeatherConditionMatchRule = (BaseRuleWithWeatherConditionValue & {
|
|
6
|
+
rule_type: WeatherConditionMatchRulesTypes;
|
|
7
|
+
matching?: (BaseMatch & {
|
|
8
|
+
match_type?: TextMatchingOptions;
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weather Conditions
|
|
3
|
+
*/
|
|
4
|
+
export declare enum WeatherConditions {
|
|
5
|
+
BLIZZARD = "Blizzard",
|
|
6
|
+
BLOWING_SNOW = "Blowing snow",
|
|
7
|
+
CLOUDY = "Cloudy",
|
|
8
|
+
FOG = "Fog",
|
|
9
|
+
FREEZING_DRIZZLE = "Freezing drizzle",
|
|
10
|
+
FREEZING_FOG = "Freezing fog",
|
|
11
|
+
HEAVY_FREEZING_DRIZZLE = "Heavy freezing drizzle",
|
|
12
|
+
HEAVY_RAIN = "Heavy rain",
|
|
13
|
+
HEAVY_RAIN_AT_TIMES = "Heavy rain at times",
|
|
14
|
+
LIGHT_DRIZZLE = "Light drizzle",
|
|
15
|
+
LIGHT_FREEZING_RAIN = "Light freezing rain",
|
|
16
|
+
LIGHT_RAIN = "Light rain",
|
|
17
|
+
MIST = "Mist",
|
|
18
|
+
MODERATE_RAIN = "Moderate rain",
|
|
19
|
+
MODERATE_RAIN_AT_TIMES = "Moderate rain at times",
|
|
20
|
+
OVERCAST = "Overcast",
|
|
21
|
+
PARTLY_CLOUDY = "Partly cloudy",
|
|
22
|
+
PATCHY_FREEZING_DRIZZLE_POSSIBLE = "Patchy freezing drizzle possible",
|
|
23
|
+
PATCHY_LIGHT_DRIZZLE = "Patchy light drizzle",
|
|
24
|
+
PATCHY_LIGHT_RAIN = "Patchy light rain",
|
|
25
|
+
PATCHY_RAIN_POSSIBLE = "Patchy rain possible",
|
|
26
|
+
PATCHY_SLEET_POSSIBLE = "Patchy sleet possible",
|
|
27
|
+
PATCHY_SNOW_POSSIBLE = "Patchy snow possible",
|
|
28
|
+
SUNNY = "Sunny",
|
|
29
|
+
THUNDERY_OUTBREAKS_POSSIBLE = "Thundery outbreaks possible"
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK test
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
export * from './src/array-utils';
|
|
8
|
+
export * from './src/comparisons';
|
|
9
|
+
export * from './src/data-store';
|
|
10
|
+
export * from './src/file-logger';
|
|
11
|
+
export * from './src/http-client';
|
|
12
|
+
export * from './src/object-utils';
|
|
13
|
+
export * from './src/string-utils';
|
|
14
|
+
export * from './src/types-utils';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validates variable is array and not empty
|
|
9
|
+
* @param array
|
|
10
|
+
*/
|
|
11
|
+
export declare function arrayNotEmpty(array: Array<unknown>): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Comparison Processor. Provides comparison methods for rules validation
|
|
9
|
+
*/
|
|
10
|
+
export declare class Comparisons {
|
|
11
|
+
static equals(value: string | number | boolean | Array<string | number | boolean> | Record<string, string | number | boolean>, testAgainst: string | number | boolean, negation?: boolean): boolean;
|
|
12
|
+
static equalsNumber: typeof Comparisons.equals;
|
|
13
|
+
static matches: typeof Comparisons.equals;
|
|
14
|
+
static less(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
15
|
+
static lessEqual(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
16
|
+
static contains(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
17
|
+
static isIn(values: string | number, testAgainst: Array<string | number> | string, negation?: boolean, splitter?: string): boolean;
|
|
18
|
+
static startsWith(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
19
|
+
static endsWith(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
20
|
+
static regexMatches(value: string | number, testAgainst: string | number, negation?: boolean): boolean;
|
|
21
|
+
private static _returnNegationCheck;
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Example of Data Store implementation with simple database Based JSON file.
|
|
9
|
+
* It's not recommended to use it in production as it can be memory and CPU intensive.
|
|
10
|
+
* @param {string} file
|
|
11
|
+
* @param {module} fs
|
|
12
|
+
*/
|
|
13
|
+
declare class DataStore {
|
|
14
|
+
private _file;
|
|
15
|
+
private _fs;
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} file
|
|
18
|
+
* @param {module} fs
|
|
19
|
+
*/
|
|
20
|
+
constructor(file: string, fs: any);
|
|
21
|
+
/**
|
|
22
|
+
* Get value by key
|
|
23
|
+
* @param {string} key
|
|
24
|
+
* @return {any}
|
|
25
|
+
*/
|
|
26
|
+
get(key: string): any;
|
|
27
|
+
/**
|
|
28
|
+
* Store value by key
|
|
29
|
+
* @param {string} key
|
|
30
|
+
* @param {any} value
|
|
31
|
+
*/
|
|
32
|
+
set(key: string, value: any): void;
|
|
33
|
+
/**
|
|
34
|
+
* Delete value by key
|
|
35
|
+
* @param {string} key
|
|
36
|
+
*/
|
|
37
|
+
delete(key: string): void;
|
|
38
|
+
}
|
|
39
|
+
export { DataStore };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} file
|
|
3
|
+
* @param {module} fs
|
|
4
|
+
* @param {string=} appendMethod Defaults to 'appendFileSync'
|
|
5
|
+
* @example new FileLogger('./convert.log', require('fs'), 'appendFileSync')
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare class FileLogger {
|
|
9
|
+
private _file;
|
|
10
|
+
private _fs;
|
|
11
|
+
private _appendMethod;
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} file
|
|
14
|
+
* @param {module} fs
|
|
15
|
+
* @param {string=} appendMethod
|
|
16
|
+
*/
|
|
17
|
+
constructor(file: string, fs: any, appendMethod?: string);
|
|
18
|
+
private _write;
|
|
19
|
+
/**
|
|
20
|
+
* @param {Array<any>} args
|
|
21
|
+
*/
|
|
22
|
+
log(...args: any): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {Array<any>} args
|
|
25
|
+
*/
|
|
26
|
+
info(...args: any): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {Array<any>} args
|
|
29
|
+
*/
|
|
30
|
+
debug(...args: any): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* @param {Array<any>} args
|
|
33
|
+
*/
|
|
34
|
+
warn(...args: any): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* @param {Array<any>} args
|
|
37
|
+
*/
|
|
38
|
+
error(...args: any): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export { FileLogger };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="node" />
|
|
8
|
+
/// <reference types="node" />
|
|
9
|
+
/// <reference types="node" />
|
|
10
|
+
/// <reference types="node" />
|
|
11
|
+
export type HttpMethod = 'GET' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH';
|
|
12
|
+
export type HttpResponseType = 'json' | 'arraybuffer' | 'text';
|
|
13
|
+
export type HttpRequest = {
|
|
14
|
+
baseURL: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
method?: HttpMethod;
|
|
17
|
+
headers?: {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
};
|
|
20
|
+
responseType?: HttpResponseType;
|
|
21
|
+
data?: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
declare enum HttpStatusCode {
|
|
24
|
+
Continue = 100,
|
|
25
|
+
SwitchingProtocols = 101,
|
|
26
|
+
Processing = 102,
|
|
27
|
+
EarlyHints = 103,
|
|
28
|
+
Ok = 200,
|
|
29
|
+
Created = 201,
|
|
30
|
+
Accepted = 202,
|
|
31
|
+
NonAuthoritativeInformation = 203,
|
|
32
|
+
NoContent = 204,
|
|
33
|
+
ResetContent = 205,
|
|
34
|
+
PartialContent = 206,
|
|
35
|
+
MultiStatus = 207,
|
|
36
|
+
AlreadyReported = 208,
|
|
37
|
+
ImUsed = 226,
|
|
38
|
+
MultipleChoices = 300,
|
|
39
|
+
MovedPermanently = 301,
|
|
40
|
+
Found = 302,
|
|
41
|
+
SeeOther = 303,
|
|
42
|
+
NotModified = 304,
|
|
43
|
+
UseProxy = 305,
|
|
44
|
+
Unused = 306,
|
|
45
|
+
TemporaryRedirect = 307,
|
|
46
|
+
PermanentRedirect = 308,
|
|
47
|
+
BadRequest = 400,
|
|
48
|
+
Unauthorized = 401,
|
|
49
|
+
PaymentRequired = 402,
|
|
50
|
+
Forbidden = 403,
|
|
51
|
+
NotFound = 404,
|
|
52
|
+
MethodNotAllowed = 405,
|
|
53
|
+
NotAcceptable = 406,
|
|
54
|
+
ProxyAuthenticationRequired = 407,
|
|
55
|
+
RequestTimeout = 408,
|
|
56
|
+
Conflict = 409,
|
|
57
|
+
Gone = 410,
|
|
58
|
+
LengthRequired = 411,
|
|
59
|
+
PreconditionFailed = 412,
|
|
60
|
+
PayloadTooLarge = 413,
|
|
61
|
+
UriTooLong = 414,
|
|
62
|
+
UnsupportedMediaType = 415,
|
|
63
|
+
RangeNotSatisfiable = 416,
|
|
64
|
+
ExpectationFailed = 417,
|
|
65
|
+
ImATeapot = 418,
|
|
66
|
+
MisdirectedRequest = 421,
|
|
67
|
+
UnprocessableEntity = 422,
|
|
68
|
+
Locked = 423,
|
|
69
|
+
FailedDependency = 424,
|
|
70
|
+
TooEarly = 425,
|
|
71
|
+
UpgradeRequired = 426,
|
|
72
|
+
PreconditionRequired = 428,
|
|
73
|
+
TooManyRequests = 429,
|
|
74
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
75
|
+
UnavailableForLegalReasons = 451,
|
|
76
|
+
InternalServerError = 500,
|
|
77
|
+
NotImplemented = 501,
|
|
78
|
+
BadGateway = 502,
|
|
79
|
+
ServiceUnavailable = 503,
|
|
80
|
+
GatewayTimeout = 504,
|
|
81
|
+
HttpVersionNotSupported = 505,
|
|
82
|
+
VariantAlsoNegotiates = 506,
|
|
83
|
+
InsufficientStorage = 507,
|
|
84
|
+
LoopDetected = 508,
|
|
85
|
+
NotExtended = 510,
|
|
86
|
+
NetworkAuthenticationRequired = 511
|
|
87
|
+
}
|
|
88
|
+
export type HttpResponse = {
|
|
89
|
+
data: any;
|
|
90
|
+
status: HttpStatusCode;
|
|
91
|
+
statusText: string;
|
|
92
|
+
headers?: {
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
interface HttpClientInterface {
|
|
97
|
+
request(config: HttpRequest): Promise<HttpResponse>;
|
|
98
|
+
}
|
|
99
|
+
type RuntimeResult = {
|
|
100
|
+
runtime: 'browser' | 'server-with-fetch' | 'unknown';
|
|
101
|
+
} | {
|
|
102
|
+
runtime: 'old-nodejs';
|
|
103
|
+
url: typeof import('url');
|
|
104
|
+
http: typeof import('http');
|
|
105
|
+
https: typeof import('https');
|
|
106
|
+
queryString: typeof import('querystring');
|
|
107
|
+
};
|
|
108
|
+
export declare const serialize: (params: Record<string, any>, method: string, runtimeResult: RuntimeResult) => string;
|
|
109
|
+
/**
|
|
110
|
+
* Provide http client for newtork requests
|
|
111
|
+
* @param {HttpRequest}
|
|
112
|
+
* @returns {HttpClient}
|
|
113
|
+
*/
|
|
114
|
+
export declare const HttpClient: HttpClientInterface;
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns the value at path of object
|
|
9
|
+
* TODO: get this utility to work with the optional mapper() helper from config
|
|
10
|
+
* @param {Record<string, any>} object
|
|
11
|
+
* @param {string} path
|
|
12
|
+
* @param {any=} defaultValue
|
|
13
|
+
* @param {boolean=} truthy Should Number 0 number and Boolean false be considered as normal value
|
|
14
|
+
* @return {any}
|
|
15
|
+
*/
|
|
16
|
+
export declare function objectDeepValue(object: Record<string, any>, path: string, defaultValue?: any, truthy?: boolean): any;
|
|
17
|
+
/**
|
|
18
|
+
* Deep merge objects and their keys and nested objects
|
|
19
|
+
* Accepts arrays
|
|
20
|
+
*
|
|
21
|
+
* @param {...Record<any, any>} objects Objects to merge
|
|
22
|
+
* @return {Record<any, any>}
|
|
23
|
+
*/
|
|
24
|
+
export declare function objectDeepMerge(...objects: any[]): any;
|
|
25
|
+
/**
|
|
26
|
+
* Validates variable is object and not empty
|
|
27
|
+
* @param object
|
|
28
|
+
*/
|
|
29
|
+
export declare function objectNotEmpty(object: any): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Compare two objects
|
|
32
|
+
* @param a
|
|
33
|
+
* @param b
|
|
34
|
+
*/
|
|
35
|
+
export declare const objectDeepEqual: (a: any, b: any) => boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String formatter tool. Use %s for string %d for digit and %j for JSON formatting
|
|
3
|
+
* @param {string} template
|
|
4
|
+
* @param {Array<string>} args
|
|
5
|
+
* @return {string}
|
|
6
|
+
*/
|
|
7
|
+
export declare function stringFormat(template: string, ...args: any[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* String formatter tool. Transforms a space-separated string into camelCase
|
|
10
|
+
* @param {string} input
|
|
11
|
+
* @return {string}
|
|
12
|
+
*/
|
|
13
|
+
export declare function camelCase(input: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Generate numeric hash based on seed
|
|
16
|
+
* @param {string} value
|
|
17
|
+
* @param {number=} seed
|
|
18
|
+
* @return {number}
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateHash(value: string, seed?: number): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Transform value type. Does not do any JSON validation
|
|
9
|
+
* @param value
|
|
10
|
+
* @param type
|
|
11
|
+
*/
|
|
12
|
+
export declare function castType(value: any, type: string): any;
|