@convertcom/js-sdk-rules 0.0.1 → 1.0.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/LICENSE.txt +202 -0
- package/lib/enums/index.d.ts +29 -0
- package/lib/enums/src/audience-type.d.ts +11 -0
- package/lib/enums/src/data-enitites.d.ts +7 -0
- package/lib/enums/src/dictionary.d.ts +60 -0
- package/lib/enums/src/do-not-track.d.ts +12 -0
- package/lib/enums/src/event-type.d.ts +10 -0
- package/lib/enums/src/experience-type.d.ts +16 -0
- package/lib/enums/src/feature-status.d.ts +10 -0
- package/lib/enums/src/ga-type.d.ts +10 -0
- package/lib/enums/src/goal-data-key.d.ts +11 -0
- package/lib/enums/src/goal-type.d.ts +22 -0
- package/lib/enums/src/integration-provider.d.ts +27 -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.js +227 -0
- package/lib/index.js.map +1 -0
- package/lib/index.min.js +2 -0
- package/lib/index.min.js.map +1 -0
- package/lib/index.min.mjs +1 -0
- package/lib/index.min.mjs.map +1 -0
- package/lib/index.mjs +227 -0
- package/lib/index.mjs.map +1 -0
- package/lib/legacy/enums/index.d.ts +29 -0
- package/lib/legacy/enums/src/audience-type.d.ts +11 -0
- package/lib/legacy/enums/src/data-enitites.d.ts +7 -0
- package/lib/legacy/enums/src/dictionary.d.ts +60 -0
- package/lib/legacy/enums/src/do-not-track.d.ts +12 -0
- package/lib/legacy/enums/src/event-type.d.ts +10 -0
- package/lib/legacy/enums/src/experience-type.d.ts +16 -0
- package/lib/legacy/enums/src/feature-status.d.ts +10 -0
- package/lib/legacy/enums/src/ga-type.d.ts +10 -0
- package/lib/legacy/enums/src/goal-data-key.d.ts +11 -0
- package/lib/legacy/enums/src/goal-type.d.ts +22 -0
- package/lib/legacy/enums/src/integration-provider.d.ts +27 -0
- package/lib/legacy/enums/src/log-level.d.ts +14 -0
- package/lib/legacy/enums/src/log-method.d.ts +14 -0
- package/lib/legacy/enums/src/project-type.d.ts +10 -0
- package/lib/legacy/enums/src/rule-error.d.ts +10 -0
- package/lib/legacy/enums/src/segments/browser-type.d.ts +17 -0
- package/lib/legacy/enums/src/segments/device-type.d.ts +16 -0
- package/lib/legacy/enums/src/segments/segments-keys.d.ts +15 -0
- package/lib/legacy/enums/src/segments/source-type.d.ts +12 -0
- package/lib/legacy/enums/src/segments/visitor-type.d.ts +10 -0
- package/lib/legacy/enums/src/system-events.d.ts +22 -0
- package/lib/legacy/enums/src/variable-types.d.ts +7 -0
- package/lib/legacy/enums/src/variation-change-type.d.ts +14 -0
- package/lib/legacy/index.js +291 -0
- package/lib/legacy/index.js.map +1 -0
- package/lib/legacy/index.min.js +8 -0
- package/lib/legacy/index.min.js.map +1 -0
- package/lib/legacy/logger/index.d.ts +8 -0
- package/lib/legacy/logger/src/interfaces/log-client.d.ts +13 -0
- package/lib/legacy/logger/src/interfaces/log-manager.d.ts +18 -0
- package/lib/legacy/logger/src/interfaces/log-method-map.d.ts +15 -0
- package/lib/legacy/logger/src/log-manager.d.ts +64 -0
- package/lib/legacy/rules/index.d.ts +8 -0
- package/lib/legacy/rules/src/interfaces/rule-manager.d.ts +14 -0
- package/lib/legacy/rules/src/rule-manager.d.ts +75 -0
- package/lib/legacy/types/index.d.ts +36 -0
- package/lib/legacy/types/src/Audience.d.ts +16 -0
- package/lib/legacy/types/src/BucketedFeature.d.ts +30 -0
- package/lib/legacy/types/src/BucketedVariation.d.ts +13 -0
- package/lib/legacy/types/src/BucketingAttributes.d.ts +13 -0
- package/lib/legacy/types/src/Config.d.ts +62 -0
- package/lib/legacy/types/src/ConversionAttributes.d.ts +11 -0
- package/lib/legacy/types/src/Entity.d.ts +13 -0
- package/lib/legacy/types/src/Experience.d.ts +37 -0
- package/lib/legacy/types/src/Feature.d.ts +18 -0
- package/lib/legacy/types/src/Goal.d.ts +30 -0
- package/lib/legacy/types/src/Id.d.ts +10 -0
- package/lib/{index.d.ts → legacy/types/src/IndentityField.d.ts} +2 -1
- package/lib/legacy/types/src/Integration.d.ts +16 -0
- package/lib/legacy/types/src/Location.d.ts +14 -0
- package/lib/legacy/types/src/Path.d.ts +10 -0
- package/lib/legacy/types/src/Project.d.ts +37 -0
- package/lib/legacy/types/src/RequireAtLeastOne.d.ts +3 -0
- package/lib/legacy/types/src/Rule.d.ts +24 -0
- package/lib/legacy/types/src/Segments.d.ts +14 -0
- package/lib/legacy/types/src/SegmentsAttributes.d.ts +9 -0
- package/lib/legacy/types/src/SegmentsData.d.ts +16 -0
- package/lib/legacy/types/src/StoreData.d.ts +14 -0
- package/lib/legacy/types/src/TrackingEvent.d.ts +14 -0
- package/lib/legacy/types/src/VariableType.d.ts +8 -0
- package/lib/legacy/types/src/Variation.d.ts +49 -0
- package/lib/legacy/types/src/VisitorsQueue.d.ts +16 -0
- package/lib/legacy/types/src/tracking/BucketingEvent.d.ts +11 -0
- package/lib/legacy/types/src/tracking/ConversionEvent.d.ts +16 -0
- package/lib/legacy/types/src/tracking/Visitor.d.ts +14 -0
- package/lib/legacy/types/src/tracking/VisitorEvent.d.ts +13 -0
- package/lib/legacy/utils/index.d.ts +14 -0
- package/lib/legacy/utils/src/array-utils.d.ts +11 -0
- package/lib/legacy/utils/src/comparisons.d.ts +22 -0
- package/lib/legacy/utils/src/data-store.d.ts +39 -0
- package/lib/legacy/utils/src/file-logger.d.ts +40 -0
- package/lib/legacy/utils/src/http-client.d.ts +102 -0
- package/lib/legacy/utils/src/object-utils.d.ts +28 -0
- package/lib/legacy/utils/src/string-utils.d.ts +20 -0
- package/lib/legacy/utils/src/types-utils.d.ts +12 -0
- 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 +18 -0
- 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 +75 -0
- package/lib/types/index.d.ts +36 -0
- package/lib/types/src/Audience.d.ts +16 -0
- package/lib/types/src/BucketedFeature.d.ts +30 -0
- package/lib/types/src/BucketedVariation.d.ts +13 -0
- package/lib/types/src/BucketingAttributes.d.ts +13 -0
- package/lib/types/src/Config.d.ts +62 -0
- package/lib/types/src/ConversionAttributes.d.ts +11 -0
- package/lib/types/src/Entity.d.ts +13 -0
- package/lib/types/src/Experience.d.ts +37 -0
- package/lib/types/src/Feature.d.ts +18 -0
- package/lib/types/src/Goal.d.ts +30 -0
- package/lib/types/src/Id.d.ts +10 -0
- package/lib/types/src/IndentityField.d.ts +7 -0
- package/lib/types/src/Integration.d.ts +16 -0
- package/lib/types/src/Location.d.ts +14 -0
- package/lib/types/src/Path.d.ts +10 -0
- package/lib/types/src/Project.d.ts +37 -0
- package/lib/types/src/RequireAtLeastOne.d.ts +3 -0
- package/lib/types/src/Rule.d.ts +24 -0
- package/lib/types/src/Segments.d.ts +14 -0
- package/lib/types/src/SegmentsAttributes.d.ts +9 -0
- package/lib/types/src/SegmentsData.d.ts +16 -0
- package/lib/types/src/StoreData.d.ts +14 -0
- package/lib/types/src/TrackingEvent.d.ts +14 -0
- package/lib/types/src/VariableType.d.ts +8 -0
- package/lib/types/src/Variation.d.ts +49 -0
- package/lib/types/src/VisitorsQueue.d.ts +16 -0
- package/lib/types/src/tracking/BucketingEvent.d.ts +11 -0
- package/lib/types/src/tracking/ConversionEvent.d.ts +16 -0
- package/lib/types/src/tracking/Visitor.d.ts +14 -0
- package/lib/types/src/tracking/VisitorEvent.d.ts +13 -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 +102 -0
- package/lib/utils/src/object-utils.d.ts +28 -0
- package/lib/utils/src/string-utils.d.ts +20 -0
- package/lib/utils/src/types-utils.d.ts +12 -0
- package/package.json +60 -1
|
@@ -0,0 +1,36 @@
|
|
|
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/Audience';
|
|
8
|
+
export * from './src/BucketedFeature';
|
|
9
|
+
export * from './src/BucketedVariation';
|
|
10
|
+
export * from './src/BucketingAttributes';
|
|
11
|
+
export * from './src/Config';
|
|
12
|
+
export * from './src/ConversionAttributes';
|
|
13
|
+
export * from './src/Entity';
|
|
14
|
+
export * from './src/Experience';
|
|
15
|
+
export * from './src/Feature';
|
|
16
|
+
export * from './src/Goal';
|
|
17
|
+
export * from './src/Id';
|
|
18
|
+
export * from './src/IndentityField';
|
|
19
|
+
export * from './src/Integration';
|
|
20
|
+
export * from './src/Location';
|
|
21
|
+
export * from './src/Path';
|
|
22
|
+
export * from './src/Project';
|
|
23
|
+
export * from './src/RequireAtLeastOne';
|
|
24
|
+
export * from './src/Rule';
|
|
25
|
+
export * from './src/Segments';
|
|
26
|
+
export * from './src/SegmentsAttributes';
|
|
27
|
+
export * from './src/SegmentsData';
|
|
28
|
+
export * from './src/StoreData';
|
|
29
|
+
export * from './src/TrackingEvent';
|
|
30
|
+
export * from './src/VariableType';
|
|
31
|
+
export * from './src/Variation';
|
|
32
|
+
export * from './src/VisitorsQueue';
|
|
33
|
+
export * from './src/tracking/BucketingEvent';
|
|
34
|
+
export * from './src/tracking/ConversionEvent';
|
|
35
|
+
export * from './src/tracking/Visitor';
|
|
36
|
+
export * from './src/tracking/VisitorEvent';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { AudienceType } from '@convertcom/js-sdk-enums';
|
|
8
|
+
import { RuleSet } from './Rule';
|
|
9
|
+
import { Id } from './Id';
|
|
10
|
+
export type Audience = {
|
|
11
|
+
id: Id;
|
|
12
|
+
name: string;
|
|
13
|
+
key: string;
|
|
14
|
+
rules: RuleSet;
|
|
15
|
+
type: AudienceType;
|
|
16
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { FeatureStatus } from '@convertcom/js-sdk-enums';
|
|
9
|
+
import { RequireAtLeastOne } from './RequireAtLeastOne';
|
|
10
|
+
type NotEnabledFeature = RequireAtLeastOne<{
|
|
11
|
+
experienceId?: Id;
|
|
12
|
+
experienceKey?: string;
|
|
13
|
+
experienceName?: string;
|
|
14
|
+
id?: Id;
|
|
15
|
+
key?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
status: FeatureStatus.DISABLED;
|
|
18
|
+
variables?: Record<string, any>;
|
|
19
|
+
}, 'id' | 'key'>;
|
|
20
|
+
export type BucketedFeature = {
|
|
21
|
+
experienceId?: Id;
|
|
22
|
+
experienceKey?: string;
|
|
23
|
+
experienceName?: string;
|
|
24
|
+
id?: Id;
|
|
25
|
+
key?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
status: FeatureStatus;
|
|
28
|
+
variables?: Record<string, any>;
|
|
29
|
+
} | NotEnabledFeature;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { Variation } from './Variation';
|
|
9
|
+
export type BucketedVariation = Variation & {
|
|
10
|
+
experienceId?: Id;
|
|
11
|
+
experienceKey?: string;
|
|
12
|
+
experienceName?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
export type BucketingAttributes = {
|
|
8
|
+
environment?: string;
|
|
9
|
+
locationProperties?: Record<any, any>;
|
|
10
|
+
visitorProperties?: Record<any, any>;
|
|
11
|
+
typeCasting?: boolean;
|
|
12
|
+
experienceKeys?: Array<string>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Experience } from './Experience';
|
|
8
|
+
import { Feature } from './Feature';
|
|
9
|
+
import { Id } from './Id';
|
|
10
|
+
import { Project } from './Project';
|
|
11
|
+
import { Goal } from './Goal';
|
|
12
|
+
import { Audience } from './Audience';
|
|
13
|
+
import { Location } from './Location';
|
|
14
|
+
import { LogLevel } from '@convertcom/js-sdk-enums';
|
|
15
|
+
import { Segments } from './Segments';
|
|
16
|
+
export type ConfigData = {
|
|
17
|
+
account_id: Id;
|
|
18
|
+
project: Project;
|
|
19
|
+
goals?: Array<Goal>;
|
|
20
|
+
locations?: Array<Location>;
|
|
21
|
+
audiences?: Array<Audience>;
|
|
22
|
+
experiences?: Array<Experience>;
|
|
23
|
+
archived_experiences?: Array<Id>;
|
|
24
|
+
features?: Array<Feature>;
|
|
25
|
+
segments?: Array<Segments>;
|
|
26
|
+
};
|
|
27
|
+
export type Config = {
|
|
28
|
+
environment: string;
|
|
29
|
+
api?: {
|
|
30
|
+
endpoint?: {
|
|
31
|
+
config?: string;
|
|
32
|
+
track?: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
bucketing?: {
|
|
36
|
+
hash_seed?: number;
|
|
37
|
+
max_traffic?: number;
|
|
38
|
+
};
|
|
39
|
+
data: ConfigData;
|
|
40
|
+
dataStore?: object;
|
|
41
|
+
dataRefreshInterval?: number;
|
|
42
|
+
tracking?: boolean;
|
|
43
|
+
events?: {
|
|
44
|
+
batch_size?: number;
|
|
45
|
+
release_interval?: number;
|
|
46
|
+
};
|
|
47
|
+
rules?: {
|
|
48
|
+
comparisonProcessor?: Record<string, any>;
|
|
49
|
+
negation?: string;
|
|
50
|
+
keys_case_sensitive?: boolean;
|
|
51
|
+
};
|
|
52
|
+
sdkKey: string;
|
|
53
|
+
logger?: {
|
|
54
|
+
logLevel?: LogLevel;
|
|
55
|
+
file?: {
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
path?: string;
|
|
58
|
+
logLevel?: LogLevel;
|
|
59
|
+
};
|
|
60
|
+
customLoggers: Array<Record<string, any>>;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -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
|
+
import { GoalDataKey } from '@convertcom/js-sdk-enums';
|
|
8
|
+
export type ConversionAttributes = {
|
|
9
|
+
ruleData?: Record<string, any>;
|
|
10
|
+
conversionData?: Array<Record<GoalDataKey, number>>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Experience } from './Experience';
|
|
8
|
+
import { Feature } from './Feature';
|
|
9
|
+
import { Audience } from './Audience';
|
|
10
|
+
import { Location } from './Location';
|
|
11
|
+
import { Segments } from './Segments';
|
|
12
|
+
import { Goal } from './Goal';
|
|
13
|
+
export type Entity = Experience | Feature | Audience | Location | Segments | Goal;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { ExperienceType } from '@convertcom/js-sdk-enums';
|
|
8
|
+
import { Id } from './Id';
|
|
9
|
+
import { RuleSet } from './Rule';
|
|
10
|
+
import { Variation } from './Variation';
|
|
11
|
+
import { Integration } from './Integration';
|
|
12
|
+
export type MultipagePages = {
|
|
13
|
+
id: Id;
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
export type Experience = {
|
|
17
|
+
id: Id;
|
|
18
|
+
name: string;
|
|
19
|
+
key: string;
|
|
20
|
+
site_area?: RuleSet;
|
|
21
|
+
locations?: Array<Id>;
|
|
22
|
+
audiences?: Array<Id>;
|
|
23
|
+
goals?: Array<Id>;
|
|
24
|
+
type: ExperienceType;
|
|
25
|
+
version: number;
|
|
26
|
+
url: string;
|
|
27
|
+
global_js?: string;
|
|
28
|
+
global_css?: string;
|
|
29
|
+
multipage_pages?: Array<MultipagePages>;
|
|
30
|
+
variations: Array<Variation>;
|
|
31
|
+
environments: Array<string>;
|
|
32
|
+
settings?: {
|
|
33
|
+
min_order_value?: number;
|
|
34
|
+
max_order_value?: number;
|
|
35
|
+
};
|
|
36
|
+
integrations?: Array<Integration>;
|
|
37
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { VariableType } from './VariableType';
|
|
9
|
+
export type FeatureVariableDefinition = {
|
|
10
|
+
key: string;
|
|
11
|
+
type?: VariableType;
|
|
12
|
+
};
|
|
13
|
+
export type Feature = {
|
|
14
|
+
id: Id;
|
|
15
|
+
name: string;
|
|
16
|
+
key: string;
|
|
17
|
+
variables: Array<FeatureVariableDefinition>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { RuleSet } from './Rule';
|
|
8
|
+
import { Id } from './Id';
|
|
9
|
+
import { GoalType, GoalRevenueTriggeringType } from '@convertcom/js-sdk-enums';
|
|
10
|
+
export type GoalTrackedItem = {
|
|
11
|
+
event: string;
|
|
12
|
+
selector: string;
|
|
13
|
+
};
|
|
14
|
+
export type GoalSettings = {
|
|
15
|
+
percentage?: number;
|
|
16
|
+
tracked_items?: Array<GoalTrackedItem>;
|
|
17
|
+
triggering_type?: GoalRevenueTriggeringType;
|
|
18
|
+
selector?: string;
|
|
19
|
+
href?: string;
|
|
20
|
+
action?: string;
|
|
21
|
+
ga_event?: string;
|
|
22
|
+
};
|
|
23
|
+
export type Goal = {
|
|
24
|
+
id: Id;
|
|
25
|
+
rules?: RuleSet;
|
|
26
|
+
type: GoalType;
|
|
27
|
+
settings?: GoalSettings;
|
|
28
|
+
name: string;
|
|
29
|
+
key: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { GoogleAnalyticsType, IntegrationProvider } from '@convertcom/js-sdk-enums';
|
|
8
|
+
export type Integration = {
|
|
9
|
+
provider: IntegrationProvider;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
custom_dimension?: string;
|
|
12
|
+
type?: GoogleAnalyticsType;
|
|
13
|
+
measurementId?: string;
|
|
14
|
+
property_UA?: string;
|
|
15
|
+
evar?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { RuleSet } from './Rule';
|
|
8
|
+
import { Id } from './Id';
|
|
9
|
+
export type Location = {
|
|
10
|
+
id: Id;
|
|
11
|
+
name: string;
|
|
12
|
+
key: string;
|
|
13
|
+
rules: RuleSet;
|
|
14
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { DoNotTrack, GoogleAnalyticsType, ProjectType } from '@convertcom/js-sdk-enums';
|
|
9
|
+
export type Project = {
|
|
10
|
+
id: Id;
|
|
11
|
+
name: string;
|
|
12
|
+
type: ProjectType;
|
|
13
|
+
environments: Record<string, string>;
|
|
14
|
+
utc_offset: number;
|
|
15
|
+
domains: Array<Record<string, any>>;
|
|
16
|
+
global_javascript?: string | ((...args: any) => any | undefined);
|
|
17
|
+
settings: {
|
|
18
|
+
auto_link: boolean;
|
|
19
|
+
data_anonymization: boolean;
|
|
20
|
+
do_not_track: DoNotTrack;
|
|
21
|
+
include_jquery: boolean;
|
|
22
|
+
min_order_value?: number;
|
|
23
|
+
max_order_value?: number;
|
|
24
|
+
integrations?: {
|
|
25
|
+
google_analytics?: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
type: GoogleAnalyticsType;
|
|
28
|
+
measurementId?: string;
|
|
29
|
+
property_UA?: string;
|
|
30
|
+
auto_revenue_tracking: boolean;
|
|
31
|
+
};
|
|
32
|
+
kissmetrics?: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
export type Rule = {
|
|
8
|
+
rule_type?: string;
|
|
9
|
+
key?: string;
|
|
10
|
+
matching: {
|
|
11
|
+
match_type: string;
|
|
12
|
+
negated?: boolean;
|
|
13
|
+
};
|
|
14
|
+
value: string | number | boolean | ((...args: any) => any | undefined);
|
|
15
|
+
};
|
|
16
|
+
export type RuleOrWhen = {
|
|
17
|
+
OR_WHEN: Array<Rule>;
|
|
18
|
+
};
|
|
19
|
+
export type RuleAnd = {
|
|
20
|
+
AND: Array<RuleOrWhen>;
|
|
21
|
+
};
|
|
22
|
+
export type RuleSet = {
|
|
23
|
+
OR: Array<RuleAnd>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { RuleSet } from './Rule';
|
|
8
|
+
import { Id } from './Id';
|
|
9
|
+
export type Segments = {
|
|
10
|
+
id: Id;
|
|
11
|
+
rules: RuleSet;
|
|
12
|
+
name: string;
|
|
13
|
+
key: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { BrowserType, DeviceType, SegmentsKeys, SourceType, VisitorType } from '@convertcom/js-sdk-enums';
|
|
8
|
+
export type SegmentsData = {
|
|
9
|
+
[SegmentsKeys.COUNTRY]?: string;
|
|
10
|
+
[SegmentsKeys.BROWSER]?: BrowserType;
|
|
11
|
+
[SegmentsKeys.DEVICES]?: Array<DeviceType>;
|
|
12
|
+
[SegmentsKeys.SOURCE]?: SourceType;
|
|
13
|
+
[SegmentsKeys.CAMPAIGN]?: string;
|
|
14
|
+
[SegmentsKeys.VISITOR_TYPE]?: VisitorType;
|
|
15
|
+
[SegmentsKeys.CUSTOM_SEGMENTS]?: Array<string>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { SegmentsData } from './SegmentsData';
|
|
9
|
+
export type StoreData = {
|
|
10
|
+
bucketing?: Record<string, Id>;
|
|
11
|
+
locations?: Array<Id>;
|
|
12
|
+
segments?: SegmentsData;
|
|
13
|
+
goals?: Record<string, boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { Visitor } from './tracking/Visitor';
|
|
9
|
+
export type TrackingEvent = {
|
|
10
|
+
accountId?: Id;
|
|
11
|
+
projectId?: Id;
|
|
12
|
+
enrichData?: boolean;
|
|
13
|
+
visitors: Array<Visitor>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { VariationChangeType } from '@convertcom/js-sdk-enums';
|
|
8
|
+
import { Id } from './Id';
|
|
9
|
+
export type RichStructureChange = {
|
|
10
|
+
js?: string;
|
|
11
|
+
selector: string;
|
|
12
|
+
page_id: string;
|
|
13
|
+
};
|
|
14
|
+
export type CustomCodeChange = {
|
|
15
|
+
css?: string;
|
|
16
|
+
js?: string;
|
|
17
|
+
page_id: string;
|
|
18
|
+
};
|
|
19
|
+
export type DefaultCodeChange = {
|
|
20
|
+
css?: string;
|
|
21
|
+
js?: string;
|
|
22
|
+
custom_js?: string;
|
|
23
|
+
};
|
|
24
|
+
export type DefaultCodeMultipageChange = {
|
|
25
|
+
css?: string;
|
|
26
|
+
js?: string;
|
|
27
|
+
custom_js?: string;
|
|
28
|
+
page_id: string;
|
|
29
|
+
};
|
|
30
|
+
export type DefaultRedirectChange = {
|
|
31
|
+
original_pattern: string;
|
|
32
|
+
variation_pattern: string;
|
|
33
|
+
};
|
|
34
|
+
export type FullStackFeatureChange = {
|
|
35
|
+
feature_id: Id;
|
|
36
|
+
variables_data: Record<string, any>;
|
|
37
|
+
};
|
|
38
|
+
export type VariationChange = {
|
|
39
|
+
id: Id;
|
|
40
|
+
type: VariationChangeType;
|
|
41
|
+
data: RichStructureChange | CustomCodeChange | DefaultCodeChange | DefaultCodeMultipageChange | DefaultRedirectChange | FullStackFeatureChange;
|
|
42
|
+
};
|
|
43
|
+
export type Variation = {
|
|
44
|
+
id: Id;
|
|
45
|
+
key: string;
|
|
46
|
+
name: string;
|
|
47
|
+
changes: Array<VariationChange>;
|
|
48
|
+
traffic_allocation?: number;
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from './Id';
|
|
8
|
+
import { SegmentsData } from './SegmentsData';
|
|
9
|
+
import { Visitor } from './tracking/Visitor';
|
|
10
|
+
import { VisitorEvent } from './tracking/VisitorEvent';
|
|
11
|
+
export type VisitorsQueue = {
|
|
12
|
+
length: number;
|
|
13
|
+
items: Array<Visitor>;
|
|
14
|
+
push: (visitorId: Id, eventRequest: VisitorEvent, segments?: SegmentsData) => void;
|
|
15
|
+
reset: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { GoalDataKey } from '@convertcom/js-sdk-enums';
|
|
8
|
+
import { Id } from '../Id';
|
|
9
|
+
export type GoalData = {
|
|
10
|
+
[key in GoalDataKey]?: Id;
|
|
11
|
+
};
|
|
12
|
+
export type ConversionEvent = {
|
|
13
|
+
goalId: Id;
|
|
14
|
+
goalData?: Array<GoalData>;
|
|
15
|
+
bucketingData?: Record<string, Id>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Id } from '../Id';
|
|
8
|
+
import { SegmentsData } from '../SegmentsData';
|
|
9
|
+
import { VisitorEvent } from './VisitorEvent';
|
|
10
|
+
export type Visitor = {
|
|
11
|
+
visitorId: Id;
|
|
12
|
+
segments?: SegmentsData;
|
|
13
|
+
events: Array<VisitorEvent>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Convert JS SDK
|
|
3
|
+
* Version 1.0.0
|
|
4
|
+
* Copyright(c) 2020 Convert Insights, Inc
|
|
5
|
+
* License Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { EventType } from '@convertcom/js-sdk-enums';
|
|
8
|
+
import { BucketingEvent } from './BucketingEvent';
|
|
9
|
+
import { ConversionEvent } from './ConversionEvent';
|
|
10
|
+
export type VisitorEvent = {
|
|
11
|
+
eventType: EventType;
|
|
12
|
+
data?: BucketingEvent | ConversionEvent;
|
|
13
|
+
};
|
|
@@ -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;
|