@antelopejs/dms-marketing 0.2.4 → 0.3.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 +1 -2
- package/dist/data-api/tenant-scope.d.ts +0 -2
- package/dist/data-api/tenant-scope.js +0 -2
- package/dist/data-api/tenant-scope.js.map +1 -1
- package/dist/pages/module.d.ts +1 -1
- package/dist/pages/settings/form.d.ts +1 -1
- package/dist/pages/settings/page.d.ts +1 -1
- package/dist/services/experiments/assign.d.ts +1 -2
- package/dist/services/experiments/assign.js +0 -1
- package/dist/services/experiments/assign.js.map +1 -1
- package/dist/services/experiments/results.d.ts +2 -1
- package/dist/services/funnels/compute.d.ts +2 -1
- package/dist/services/ingest-guard.d.ts +2 -1
- package/dist/services/ingest-guard.js +1 -2
- package/dist/services/ingest-guard.js.map +1 -1
- package/dist/services/snapshots.d.ts +0 -1
- package/dist/services/snapshots.js +0 -1
- package/dist/services/snapshots.js.map +1 -1
- package/dist/types/constants.d.ts +0 -3
- package/dist/types/constants.js +7 -7
- package/dist/types/constants.js.map +1 -1
- package/dist/types/events.d.ts +21 -21
- package/dist/types/events.js +5 -5
- package/dist/types/events.js.map +1 -1
- package/dist/types/settings.d.ts +2 -2
- package/dist/types/snapshots.d.ts +20 -19
- package/dist/types/snapshots.js +3 -3
- package/dist/types/snapshots.js.map +1 -1
- package/dist/types/statistics.d.ts +3 -2
- package/dist/types/statistics.js +3 -4
- package/dist/types/statistics.js.map +1 -1
- package/dist/utils/experiment-type.d.ts +2 -2
- package/dist/utils/funnel-steps-type.d.ts +7 -7
- package/frontend-vue/app/components/OverviewView.vue +1 -1
- package/frontend-vue/app/composables/useMarketingPeriod.ts +1 -2
- package/frontend-vue/app/constants.ts +10 -0
- package/frontend-vue/tests/stubs/frontend-module.ts +1 -3
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -123,8 +123,7 @@ project whose root `dms.frontend.ts` registers every component under the
|
|
|
123
123
|
`DmsMarketing` prefix, plus its own i18n catalogs. It is a separate project
|
|
124
124
|
with a lockfile of its own, published inside this package's tarball and
|
|
125
125
|
materialized by the DMS frontend loader (`ajs dms`) into the console's Inertia
|
|
126
|
-
workspace.
|
|
127
|
-
the real loader — client bundle, SSR bundle and vue-tsc.
|
|
126
|
+
workspace. Its own vitest suite runs through `pnpm test`.
|
|
128
127
|
|
|
129
128
|
The interface this module implements is the workspace's other package,
|
|
130
129
|
`packages/interface-dms-marketing`, published under the same `@antelopejs`
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { RequestContext } from "@antelopejs/interface-api";
|
|
2
2
|
import type { DataControllerCallback } from "@antelopejs/interface-data-api";
|
|
3
3
|
export type TenantGate = (ctx: RequestContext, id: string) => Promise<unknown>;
|
|
4
|
-
export declare function withTenantScope(base: DataControllerCallback): DataControllerCallback;
|
|
5
|
-
export declare function withTenantGate(gate: TenantGate): (base: DataControllerCallback) => DataControllerCallback;
|
|
6
4
|
export declare function tenantScopedReadRoutes(gate: TenantGate): {
|
|
7
5
|
get: DataControllerCallback;
|
|
8
6
|
list: DataControllerCallback;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withTenantScope = withTenantScope;
|
|
4
|
-
exports.withTenantGate = withTenantGate;
|
|
5
3
|
exports.tenantScopedReadRoutes = tenantScopedReadRoutes;
|
|
6
4
|
const base_1 = require("@antelopejs/interface-dms/base");
|
|
7
5
|
const request_tenant_1 = require("@antelopejs/interface-dms/request-tenant");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-scope.js","sourceRoot":"","sources":["../../src/data-api/tenant-scope.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tenant-scope.js","sourceRoot":"","sources":["../../src/data-api/tenant-scope.ts"],"names":[],"mappings":";;AA8EA,wDAUC;AApFD,yDAAiE;AACjE,6EAA8E;AAkB9E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.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const marketingModule: import("@antelopejs/interface-dms
|
|
1
|
+
export declare const marketingModule: import("@antelopejs/interface-dms").CategoryInfo;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { formSchema } from "@antelopejs/interface-dms/base";
|
|
2
|
-
export declare const marketingSettingsForm: import("@antelopejs/interface-dms/
|
|
2
|
+
export declare const marketingSettingsForm: import("@antelopejs/interface-dms/base").FormBuilder;
|
|
3
3
|
export declare const marketingSettingsFormSchema: ReturnType<typeof formSchema>;
|
|
@@ -4,6 +4,6 @@ declare const MarketingSettingsPage_base: {
|
|
|
4
4
|
location: string;
|
|
5
5
|
};
|
|
6
6
|
export declare class MarketingSettingsPage extends MarketingSettingsPage_base {
|
|
7
|
-
static content: import("@antelopejs/interface-dms/
|
|
7
|
+
static content: import("@antelopejs/interface-dms/base").FormBuilder;
|
|
8
8
|
}
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ExperimentVariation, Funnel
|
|
1
|
+
import type { ExperimentVariation, Funnel } from "@/db/tables/funnels.table";
|
|
2
2
|
export type AssignmentMap = Record<string, string>;
|
|
3
3
|
export declare function normalizedWeights(variations: ExperimentVariation[]): number[];
|
|
4
|
-
export declare function assignVariation(visitorId: string, experiment: FunnelExperiment): string | undefined;
|
|
5
4
|
export declare function assignAll(visitorId: string, funnels: Funnel[]): AssignmentMap;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizedWeights = normalizedWeights;
|
|
4
|
-
exports.assignVariation = assignVariation;
|
|
5
4
|
exports.assignAll = assignAll;
|
|
6
5
|
const node_crypto_1 = require("node:crypto");
|
|
7
6
|
const constants_1 = require("@/types/constants");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assign.js","sourceRoot":"","sources":["../../../src/services/experiments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AS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtD,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,MAAM,GAAG,UAAU,EAAE,CAAC;YACxB,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACrE,CAAC;AAED,SAAgB,SAAS,CAAC,SAAiB,EAAE,OAAiB;IAC5D,MAAM,WAAW,GAAkB,EAAE,CAAC;IACtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,SAAS;QACX,CAAC;QACD,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACzD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;QAC1C,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FunnelExperiment } from "@/db/tables/funnels.table";
|
|
|
2
2
|
import type { MarketingEvent } from "@/db/tables/marketing_events.table";
|
|
3
3
|
import { type FunnelComputation, type FunnelDefinition, type FunnelEvent } from "@/services/funnels/compute";
|
|
4
4
|
import { type SrmCheck } from "./stats";
|
|
5
|
-
|
|
5
|
+
interface VariationResult {
|
|
6
6
|
key: string;
|
|
7
7
|
exposedSessions: number;
|
|
8
8
|
computation: FunnelComputation;
|
|
@@ -18,3 +18,4 @@ export interface ExperimentResults {
|
|
|
18
18
|
}
|
|
19
19
|
export type ResultEvent = FunnelEvent & Pick<MarketingEvent, "data">;
|
|
20
20
|
export declare function computeExperimentResults(events: ResultEvent[], goal: FunnelDefinition, experiment: FunnelExperiment, truncated: boolean): ExperimentResults;
|
|
21
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Funnel, FunnelStep } from "@/db/tables/funnels.table";
|
|
2
2
|
import type { MarketingEvent } from "@/db/tables/marketing_events.table";
|
|
3
3
|
export type FunnelDefinition = Pick<Funnel, "steps" | "conversionWindowMs">;
|
|
4
|
-
|
|
4
|
+
interface FunnelStepResult {
|
|
5
5
|
step: FunnelStep;
|
|
6
6
|
sessions: number;
|
|
7
7
|
conversionRate: number;
|
|
@@ -13,3 +13,4 @@ export interface FunnelComputation {
|
|
|
13
13
|
export type FunnelEvent = Pick<MarketingEvent, "sessionId" | "kind" | "url" | "name" | "timestamp">;
|
|
14
14
|
export declare function groupBySession<T extends Pick<MarketingEvent, "sessionId">>(events: T[]): Map<string, T[]>;
|
|
15
15
|
export declare function computeFunnelOverSessions(funnel: FunnelDefinition, sessions: Iterable<FunnelEvent[]>): FunnelComputation;
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function isAutomatedClient(userAgent: string): boolean;
|
|
2
|
-
|
|
2
|
+
declare class FixedWindowRateLimiter {
|
|
3
3
|
private readonly windowMs;
|
|
4
4
|
private readonly maxPerWindow;
|
|
5
5
|
private readonly maxSources;
|
|
@@ -9,3 +9,4 @@ export declare class FixedWindowRateLimiter {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const collectRateLimiter: FixedWindowRateLimiter;
|
|
11
11
|
export declare const snapshotRateLimiter: FixedWindowRateLimiter;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snapshotRateLimiter = exports.collectRateLimiter =
|
|
3
|
+
exports.snapshotRateLimiter = exports.collectRateLimiter = void 0;
|
|
4
4
|
exports.isAutomatedClient = isAutomatedClient;
|
|
5
5
|
const helpers_1 = require("ua-parser-js/helpers");
|
|
6
6
|
const constants_1 = require("@/types/constants");
|
|
@@ -38,7 +38,6 @@ class FixedWindowRateLimiter {
|
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
exports.FixedWindowRateLimiter = FixedWindowRateLimiter;
|
|
42
41
|
exports.collectRateLimiter = new FixedWindowRateLimiter(constants_1.COLLECT_RATE_LIMIT_WINDOW_MS, constants_1.MAX_EVENTS_PER_WINDOW_PER_SOURCE, constants_1.RATE_LIMIT_MAX_SOURCES);
|
|
43
42
|
exports.snapshotRateLimiter = new FixedWindowRateLimiter(constants_1.COLLECT_RATE_LIMIT_WINDOW_MS, constants_1.MAX_SNAPSHOTS_PER_WINDOW_PER_SOURCE, constants_1.RATE_LIMIT_MAX_SOURCES);
|
|
44
43
|
//# sourceMappingURL=ingest-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-guard.js","sourceRoot":"","sources":["../../src/services/ingest-guard.ts"],"names":[],"mappings":";;;AAWA,8CAMC;AAjBD,kDAA6C;AAC7C,iDAK2B;AAC3B,mDAA6C;AAE7C,MAAM,qBAAqB,GAAG,8BAA8B,CAAC;AAE7D,SAAgB,iBAAiB,CAAC,SAAiB;IACjD,OAAO,CACL,SAAS,KAAK,EAAE;QAChB,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC;QACrC,IAAA,eAAK,EAAC,SAAS,CAAC,CACjB,CAAC;AACJ,CAAC;A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G,EACH,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EACnC,IAAI,CAAC,UAAU,CAChB,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAEY,QAAA,kBAAkB,GAAG,IAAI,sBAAsB,CAC1D,wCAA4B,EAC5B,4CAAgC,EAChC,kCAAsB,CACvB,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAI,sBAAsB,CAC3D,wCAA4B,EAC5B,+CAAmC,EACnC,kCAAsB,CACvB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Website } from "@/db/tables/websites.table";
|
|
2
2
|
import { type SnapshotColorScheme, type SnapshotLayout, type SnapshotRequestInput } from "@/types";
|
|
3
|
-
export declare function snapshotId(websiteId: string, layout: SnapshotLayout, url: string): string;
|
|
4
3
|
export declare function wantsSnapshot(website: Website, url: string, viewportWidth: number): Promise<boolean>;
|
|
5
4
|
export declare function storeSnapshot(website: Website, input: SnapshotRequestInput): Promise<boolean>;
|
|
6
5
|
export interface PageSnapshotPayload {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../src/services/snapshots.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../src/services/snapshots.ts"],"names":[],"mappings":";;AAgEA,sCAYC;AAaD,sCAiDC;AA+BD,4CA2BC;AAMD,0CAiBC;AA3ND,6CAAyC;AACzC,yCAAiD;AACjD,6FAAqE;AACrE,6BAA0C;AAG1C,mCAMiB;AACjB,iDAK2B;AAC3B,mDAA+C;AAC/C,+BAAwC;AAExC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAI3C,MAAM,YAAY,GAAG,IAAI,4BAAY,CACnC,mCAAuB,EACvB,sCAA0B,CAC3B,CAAC;AAGF,MAAM,QAAQ,GAAG,IAAI,4BAAY,CAC/B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KAAK;QAChB,IAAI,EAAE,GAAG,CAAC,IAAI;YACZ,CAAC,CAAC,IAAA,sBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC9D,CAAC,CAAC,IAAI;KACT,CAAC;AACJ,CAAC;AAMM,KAAK,UAAU,eAAe,CACnC,QAAgB,EAChB,SAAiB,EACjB,GAAY;IAEZ,MAAM,OAAO,GAAG,MAAM,IAAA,wCAAQ,EAAC,uBAAkB,EAAE,QAAQ,CAAC,CAAC,eAAe,CAC1E,SAAS,EACT,GAAG,CACJ,CAAC;IACF,IAAI,GAAG,EAAE,CAAC;QACR,KAAK,MAAM,MAAM,IAAI,wBAAgB,EAAE,CAAC;YACtC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export declare const MARKETING_MODULE_ID = "marketing";
|
|
2
2
|
export declare const OVERVIEW_PAGE_ID = "overview";
|
|
3
3
|
export declare const FRONTEND_MODULE_NAME = "@antelopejs/dms-marketing-frontend-vue";
|
|
4
|
-
export declare const MS_PER_SECOND = 1000;
|
|
5
4
|
export declare const MS_PER_MINUTE: number;
|
|
6
5
|
export declare const MS_PER_HOUR: number;
|
|
7
6
|
export declare const MS_PER_DAY: number;
|
|
8
|
-
export declare const DAYS_PER_MONTH = 30;
|
|
9
|
-
export declare const DAYS_PER_YEAR = 365;
|
|
10
7
|
export declare const MAX_QUERY_PERIOD_DAYS = 90;
|
|
11
8
|
export declare const DEFAULT_QUERY_PERIOD_DAYS = 7;
|
|
12
9
|
export declare const DEFAULT_SESSION_IDLE_TIMEOUT_MS: number;
|
package/dist/types/constants.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_SNAPSHOT_BYTES = exports.MAX_ANCHORED_HEATMAP_CELLS = exports.SCROLL_DEPTH_SCALE = exports.HEATMAP_DIVISIONS_PER_AXIS = exports.MAX_HEATMAP_EVENTS = exports.MAX_FUNNEL_EVENTS = exports.MAX_PAGES_LIST_LIMIT = exports.DEFAULT_PAGES_LIST_LIMIT = exports.TOP_MAPS_RETENTION_DAYS = exports.CAMPAIGN_KEY_SEPARATOR = exports.MAX_ENTRIES_PER_TOP_MAP = exports.MIN_OUTCOMES_PER_CELL = exports.EXPERIMENT_SRM_P_THRESHOLD = exports.EXPERIMENT_SIGNIFICANCE_LEVEL = exports.ASSIGNMENT_HASH_HEX_CHARS = exports.MAX_EXPERIMENT_KEY_LENGTH = exports.MAX_EXPERIMENT_VARIATIONS = exports.MIN_EXPERIMENT_VARIATIONS = exports.DEFAULT_CONVERSION_WINDOW_HOURS = exports.MAX_CONVERSION_WINDOW_HOURS = exports.MAX_FUNNEL_STEP_VALUE_LENGTH = exports.MAX_FUNNEL_STEPS = exports.MIN_FUNNEL_STEPS = exports.MAX_SCREEN_AND_LANGUAGE_CHARS = exports.MAX_EXTRA_DOMAINS = exports.MAX_DOMAIN_LENGTH = exports.MAX_NAME_LENGTH = exports.MAX_WEBSITE_ID_LENGTH = exports.MAX_EVENT_DATA_BYTES = exports.MAX_EVENT_NAME_LENGTH = exports.MAX_TITLE_LENGTH = exports.MAX_URL_LENGTH = exports.MAX_TRUSTED_CLIENT_CLOCK_SKEW_MS = exports.MAX_COLLECT_BATCH_SIZE = exports.DEFAULT_HEATMAP_SAMPLE_RATIO = exports.MAX_STATISTICS_RETENTION_DAYS = exports.DEFAULT_STATISTICS_RETENTION_MS = exports.DEFAULT_RAW_EVENTS_RETENTION_MS = exports.DEFAULT_SESSION_IDLE_TIMEOUT_MS = exports.DEFAULT_QUERY_PERIOD_DAYS = exports.MAX_QUERY_PERIOD_DAYS = exports.
|
|
4
|
-
exports.HTTP_PAYLOAD_TOO_LARGE = exports.HTTP_NOT_FOUND = exports.HTTP_FORBIDDEN = exports.HTTP_BAD_REQUEST = exports.API_BASE_PATH = exports.TRACKER_CACHE_MAX_AGE_SECONDS = exports.MAX_SNAPSHOTS_PER_WINDOW_PER_SOURCE = exports.RATE_LIMIT_MAX_SOURCES = exports.MAX_EVENTS_PER_WINDOW_PER_SOURCE = exports.COLLECT_RATE_LIMIT_WINDOW_MS = exports.EXPERIMENT_DEFINITIONS_CACHE_TTL_MS = exports.WEBSITE_CACHE_TTL_MS = exports.MAX_CACHE_ENTRIES = exports.SESSION_CACHE_MAX_ENTRIES = exports.VISITOR_SECRET_BYTES = exports.VISITOR_ID_HEX_LENGTH = exports.SNAPSHOT_CACHE_MAX_ENTRIES = exports.SNAPSHOT_PROMISE_TTL_MS = exports.SNAPSHOT_REFRESH_AGE_MS = exports.DEFAULT_SNAPSHOT_RETENTION_MS = exports.MAX_SNAPSHOT_DOCUMENT_PX =
|
|
3
|
+
exports.MAX_SNAPSHOT_VIEWPORT_PX = exports.MAX_REPORTED_SNAPSHOT_BYTES = exports.MAX_SNAPSHOTS_PER_WEBSITE = exports.MAX_SNAPSHOT_BYTES = exports.MAX_ANCHORED_HEATMAP_CELLS = exports.SCROLL_DEPTH_SCALE = exports.HEATMAP_DIVISIONS_PER_AXIS = exports.MAX_HEATMAP_EVENTS = exports.MAX_FUNNEL_EVENTS = exports.MAX_PAGES_LIST_LIMIT = exports.DEFAULT_PAGES_LIST_LIMIT = exports.TOP_MAPS_RETENTION_DAYS = exports.CAMPAIGN_KEY_SEPARATOR = exports.MAX_ENTRIES_PER_TOP_MAP = exports.MIN_OUTCOMES_PER_CELL = exports.EXPERIMENT_SRM_P_THRESHOLD = exports.EXPERIMENT_SIGNIFICANCE_LEVEL = exports.ASSIGNMENT_HASH_HEX_CHARS = exports.MAX_EXPERIMENT_KEY_LENGTH = exports.MAX_EXPERIMENT_VARIATIONS = exports.MIN_EXPERIMENT_VARIATIONS = exports.DEFAULT_CONVERSION_WINDOW_HOURS = exports.MAX_CONVERSION_WINDOW_HOURS = exports.MAX_FUNNEL_STEP_VALUE_LENGTH = exports.MAX_FUNNEL_STEPS = exports.MIN_FUNNEL_STEPS = exports.MAX_SCREEN_AND_LANGUAGE_CHARS = exports.MAX_EXTRA_DOMAINS = exports.MAX_DOMAIN_LENGTH = exports.MAX_NAME_LENGTH = exports.MAX_WEBSITE_ID_LENGTH = exports.MAX_EVENT_DATA_BYTES = exports.MAX_EVENT_NAME_LENGTH = exports.MAX_TITLE_LENGTH = exports.MAX_URL_LENGTH = exports.MAX_TRUSTED_CLIENT_CLOCK_SKEW_MS = exports.MAX_COLLECT_BATCH_SIZE = exports.DEFAULT_HEATMAP_SAMPLE_RATIO = exports.MAX_STATISTICS_RETENTION_DAYS = exports.DEFAULT_STATISTICS_RETENTION_MS = exports.DEFAULT_RAW_EVENTS_RETENTION_MS = exports.DEFAULT_SESSION_IDLE_TIMEOUT_MS = exports.DEFAULT_QUERY_PERIOD_DAYS = exports.MAX_QUERY_PERIOD_DAYS = exports.MS_PER_DAY = exports.MS_PER_HOUR = exports.MS_PER_MINUTE = exports.FRONTEND_MODULE_NAME = exports.OVERVIEW_PAGE_ID = exports.MARKETING_MODULE_ID = void 0;
|
|
4
|
+
exports.HTTP_PAYLOAD_TOO_LARGE = exports.HTTP_NOT_FOUND = exports.HTTP_FORBIDDEN = exports.HTTP_BAD_REQUEST = exports.API_BASE_PATH = exports.TRACKER_CACHE_MAX_AGE_SECONDS = exports.MAX_SNAPSHOTS_PER_WINDOW_PER_SOURCE = exports.RATE_LIMIT_MAX_SOURCES = exports.MAX_EVENTS_PER_WINDOW_PER_SOURCE = exports.COLLECT_RATE_LIMIT_WINDOW_MS = exports.EXPERIMENT_DEFINITIONS_CACHE_TTL_MS = exports.WEBSITE_CACHE_TTL_MS = exports.MAX_CACHE_ENTRIES = exports.SESSION_CACHE_MAX_ENTRIES = exports.VISITOR_SECRET_BYTES = exports.VISITOR_ID_HEX_LENGTH = exports.SNAPSHOT_CACHE_MAX_ENTRIES = exports.SNAPSHOT_PROMISE_TTL_MS = exports.SNAPSHOT_REFRESH_AGE_MS = exports.DEFAULT_SNAPSHOT_RETENTION_MS = exports.MAX_SNAPSHOT_DOCUMENT_PX = void 0;
|
|
5
5
|
exports.MARKETING_MODULE_ID = "marketing";
|
|
6
6
|
exports.OVERVIEW_PAGE_ID = "overview";
|
|
7
7
|
exports.FRONTEND_MODULE_NAME = "@antelopejs/dms-marketing-frontend-vue";
|
|
8
|
-
|
|
9
|
-
exports.MS_PER_MINUTE = 60 *
|
|
8
|
+
const MS_PER_SECOND = 1_000;
|
|
9
|
+
exports.MS_PER_MINUTE = 60 * MS_PER_SECOND;
|
|
10
10
|
exports.MS_PER_HOUR = 60 * exports.MS_PER_MINUTE;
|
|
11
11
|
exports.MS_PER_DAY = 24 * exports.MS_PER_HOUR;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const DAYS_PER_MONTH = 30;
|
|
13
|
+
const DAYS_PER_YEAR = 365;
|
|
14
14
|
exports.MAX_QUERY_PERIOD_DAYS = 90;
|
|
15
15
|
exports.DEFAULT_QUERY_PERIOD_DAYS = 7;
|
|
16
16
|
exports.DEFAULT_SESSION_IDLE_TIMEOUT_MS = 30 * exports.MS_PER_MINUTE;
|
|
17
17
|
exports.DEFAULT_RAW_EVENTS_RETENTION_MS = 90 * exports.MS_PER_DAY;
|
|
18
|
-
exports.DEFAULT_STATISTICS_RETENTION_MS = (
|
|
18
|
+
exports.DEFAULT_STATISTICS_RETENTION_MS = (DAYS_PER_YEAR + DAYS_PER_MONTH) * exports.MS_PER_DAY;
|
|
19
19
|
exports.MAX_STATISTICS_RETENTION_DAYS = 760;
|
|
20
20
|
exports.DEFAULT_HEATMAP_SAMPLE_RATIO = 0.1;
|
|
21
21
|
exports.MAX_COLLECT_BATCH_SIZE = 25;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/types/constants.ts"],"names":[],"mappings":";;;;AAIa,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,gBAAgB,GAAG,UAAU,CAAC;AAG9B,QAAA,oBAAoB,GAAG,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/types/constants.ts"],"names":[],"mappings":";;;;AAIa,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,gBAAgB,GAAG,UAAU,CAAC;AAG9B,QAAA,oBAAoB,GAAG,wCAAwC,CAAC;AAM7E,MAAM,aAAa,GAAG,KAAK,CAAC;AACf,QAAA,aAAa,GAAG,EAAE,GAAG,aAAa,CAAC;AACnC,QAAA,WAAW,GAAG,EAAE,GAAG,qBAAa,CAAC;AACjC,QAAA,UAAU,GAAG,EAAE,GAAG,mBAAW,CAAC;AAC3C,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,GAAG,CAAC;AACb,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAC3B,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAM9B,QAAA,+BAA+B,GAAG,EAAE,GAAG,qBAAa,CAAC;AACrD,QAAA,+BAA+B,GAAG,EAAE,GAAG,kBAAU,CAAC;AAClD,QAAA,+BAA+B,GAC1C,CAAC,aAAa,GAAG,cAAc,CAAC,GAAG,kBAAU,CAAC;AAMnC,QAAA,6BAA6B,GAAG,GAAG,CAAC;AACpC,QAAA,4BAA4B,GAAG,GAAG,CAAC;AACnC,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAC5B,QAAA,gCAAgC,GAAG,CAAC,GAAG,qBAAa,CAAC;AAMrD,QAAA,cAAc,GAAG,GAAG,CAAC;AACrB,QAAA,gBAAgB,GAAG,GAAG,CAAC;AACvB,QAAA,qBA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A2B,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAClC,QAAA,wBAAwB,GAAG,OAAO,CAAC;AACnC,QAAA,6BAA6B,GAAG,EAAE,GAAG,kBAAU,CAAC;AAEhD,QAAA,uBAAuB,GAAG,kBAAU,CAAC;AAErC,QAAA,uBAAuB,GAAG,qBAAa,CAAC;AACxC,QAAA,0BAA0B,GAAG,MAAM,CAAC;AAMpC,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAC3B,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAC1B,QAAA,yBAAyB,GAAG,MAAM,CAAC;AAOnC,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAC1B,QAAA,oBAAoB,GAAG,MAAM,CAAC;AAC9B,QAAA,mCAAmC,GAAG,MAAM,CAAC;AAM7C,QAAA,4BAA4B,GAAG,qBAAa,CAAC;AAG7C,QAAA,gCAAgC,GAAG,GAAG,CAAC;AACvC,QAAA,sBAAsB,GAAG,MAAM,CAAC;AAEhC,QAAA,mCAAmC,GAAG,CAAC,CAAC;AACxC,QAAA,6BAA6B,GAAG,IAAI,CAAC;AAMrC,QAAA,aAAa,GAAG,gBAAgB,CAAC;AAEjC,QAAA,gBAAgB,GAAG,GAAG,CAAC;AACvB,QAAA,cAAc,GAAG,GAAG,CAAC;AACrB,QAAA,cAAc,GAAG,GAAG,CAAC;AACrB,QAAA,sBAAsB,GAAG,GAAG,CAAC"}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
declare const EVENT_KINDS: readonly ["pageview", "custom", "exposure", "click", "scroll"];
|
|
3
3
|
export type EventKind = (typeof EVENT_KINDS)[number];
|
|
4
4
|
export declare const HEATMAP_EVENT_KINDS: EventKind[];
|
|
5
|
-
|
|
5
|
+
declare const trackedEventSchema: z.ZodObject<{
|
|
6
6
|
kind: z.ZodEnum<["pageview", "custom", "exposure", "click", "scroll"]>;
|
|
7
7
|
url: z.ZodString;
|
|
8
8
|
referrer: z.ZodOptional<z.ZodString>;
|
|
@@ -13,25 +13,25 @@ export declare const trackedEventSchema: z.ZodObject<{
|
|
|
13
13
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
14
|
at: z.ZodOptional<z.ZodNumber>;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
16
17
|
url: string;
|
|
17
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
18
18
|
at?: number | undefined;
|
|
19
19
|
name?: string | undefined;
|
|
20
|
-
data?: Record<string, unknown> | undefined;
|
|
21
20
|
referrer?: string | undefined;
|
|
22
|
-
screen?: string | undefined;
|
|
23
21
|
title?: string | undefined;
|
|
22
|
+
screen?: string | undefined;
|
|
24
23
|
language?: string | undefined;
|
|
24
|
+
data?: Record<string, unknown> | undefined;
|
|
25
25
|
}, {
|
|
26
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
26
27
|
url: string;
|
|
27
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
28
28
|
at?: number | undefined;
|
|
29
29
|
name?: string | undefined;
|
|
30
|
-
data?: Record<string, unknown> | undefined;
|
|
31
30
|
referrer?: string | undefined;
|
|
32
|
-
screen?: string | undefined;
|
|
33
31
|
title?: string | undefined;
|
|
32
|
+
screen?: string | undefined;
|
|
34
33
|
language?: string | undefined;
|
|
34
|
+
data?: Record<string, unknown> | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
export declare const collectRequestSchema: z.ZodObject<{
|
|
37
37
|
website: z.ZodString;
|
|
@@ -46,55 +46,54 @@ export declare const collectRequestSchema: z.ZodObject<{
|
|
|
46
46
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
47
|
at: z.ZodOptional<z.ZodNumber>;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
49
50
|
url: string;
|
|
50
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
51
51
|
at?: number | undefined;
|
|
52
52
|
name?: string | undefined;
|
|
53
|
-
data?: Record<string, unknown> | undefined;
|
|
54
53
|
referrer?: string | undefined;
|
|
55
|
-
screen?: string | undefined;
|
|
56
54
|
title?: string | undefined;
|
|
55
|
+
screen?: string | undefined;
|
|
57
56
|
language?: string | undefined;
|
|
57
|
+
data?: Record<string, unknown> | undefined;
|
|
58
58
|
}, {
|
|
59
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
59
60
|
url: string;
|
|
60
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
61
61
|
at?: number | undefined;
|
|
62
62
|
name?: string | undefined;
|
|
63
|
-
data?: Record<string, unknown> | undefined;
|
|
64
63
|
referrer?: string | undefined;
|
|
65
|
-
screen?: string | undefined;
|
|
66
64
|
title?: string | undefined;
|
|
65
|
+
screen?: string | undefined;
|
|
67
66
|
language?: string | undefined;
|
|
67
|
+
data?: Record<string, unknown> | undefined;
|
|
68
68
|
}>, "many">;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
70
|
website: string;
|
|
71
71
|
events: {
|
|
72
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
72
73
|
url: string;
|
|
73
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
74
74
|
at?: number | undefined;
|
|
75
75
|
name?: string | undefined;
|
|
76
|
-
data?: Record<string, unknown> | undefined;
|
|
77
76
|
referrer?: string | undefined;
|
|
78
|
-
screen?: string | undefined;
|
|
79
77
|
title?: string | undefined;
|
|
78
|
+
screen?: string | undefined;
|
|
80
79
|
language?: string | undefined;
|
|
80
|
+
data?: Record<string, unknown> | undefined;
|
|
81
81
|
}[];
|
|
82
82
|
}, {
|
|
83
83
|
website: string;
|
|
84
84
|
events: {
|
|
85
|
+
kind: "custom" | "pageview" | "exposure" | "click" | "scroll";
|
|
85
86
|
url: string;
|
|
86
|
-
kind: "custom" | "click" | "scroll" | "pageview" | "exposure";
|
|
87
87
|
at?: number | undefined;
|
|
88
88
|
name?: string | undefined;
|
|
89
|
-
data?: Record<string, unknown> | undefined;
|
|
90
89
|
referrer?: string | undefined;
|
|
91
|
-
screen?: string | undefined;
|
|
92
90
|
title?: string | undefined;
|
|
91
|
+
screen?: string | undefined;
|
|
93
92
|
language?: string | undefined;
|
|
93
|
+
data?: Record<string, unknown> | undefined;
|
|
94
94
|
}[];
|
|
95
95
|
}>;
|
|
96
96
|
export type TrackedEventInput = z.infer<typeof trackedEventSchema>;
|
|
97
|
-
export type CollectRequestInput = z.infer<typeof collectRequestSchema>;
|
|
98
97
|
export interface ClickEventData {
|
|
99
98
|
x: number;
|
|
100
99
|
y: number;
|
|
@@ -112,3 +111,4 @@ export interface ExposureEventData {
|
|
|
112
111
|
experiment: string;
|
|
113
112
|
variation: string;
|
|
114
113
|
}
|
|
114
|
+
export {};
|
package/dist/types/events.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.collectRequestSchema = exports.
|
|
3
|
+
exports.collectRequestSchema = exports.HEATMAP_EVENT_KINDS = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
|
-
|
|
6
|
+
const EVENT_KINDS = [
|
|
7
7
|
"pageview",
|
|
8
8
|
"custom",
|
|
9
9
|
"exposure",
|
|
@@ -11,8 +11,8 @@ exports.EVENT_KINDS = [
|
|
|
11
11
|
"scroll",
|
|
12
12
|
];
|
|
13
13
|
exports.HEATMAP_EVENT_KINDS = ["click", "scroll"];
|
|
14
|
-
|
|
15
|
-
kind: zod_1.z.enum(
|
|
14
|
+
const trackedEventSchema = zod_1.z.object({
|
|
15
|
+
kind: zod_1.z.enum(EVENT_KINDS),
|
|
16
16
|
url: zod_1.z.string().min(1).max(constants_1.MAX_URL_LENGTH),
|
|
17
17
|
referrer: zod_1.z.string().max(constants_1.MAX_URL_LENGTH).optional(),
|
|
18
18
|
title: zod_1.z.string().max(constants_1.MAX_TITLE_LENGTH).optional(),
|
|
@@ -24,6 +24,6 @@ exports.trackedEventSchema = zod_1.z.object({
|
|
|
24
24
|
});
|
|
25
25
|
exports.collectRequestSchema = zod_1.z.object({
|
|
26
26
|
website: zod_1.z.string().min(1).max(constants_1.MAX_WEBSITE_ID_LENGTH),
|
|
27
|
-
events: zod_1.z.array(
|
|
27
|
+
events: zod_1.z.array(trackedEventSchema).min(1).max(constants_1.MAX_COLLECT_BATCH_SIZE),
|
|
28
28
|
});
|
|
29
29
|
//# sourceMappingURL=events.js.map
|
package/dist/types/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAOqB;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAOqB;AAWrB,MAAM,WAAW,GAAG;IAClB,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;IACP,QAAQ;CACA,CAAC;AAKE,QAAA,mBAAmB,GAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEpE,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAEzB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAAc,CAAC;IAC1C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC,QAAQ,EAAE;IACnD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,4BAAgB,CAAC,CAAC,QAAQ,EAAE;IAClD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,yCAA6B,CAAC,CAAC,QAAQ,EAAE;IAChE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,yCAA6B,CAAC,CAAC,QAAQ,EAAE;IAElE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,iCAAqB,CAAC,CAAC,QAAQ,EAAE;IACtD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAEtC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,iCAAqB,CAAC;IACrD,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,kCAAsB,CAAC;CACvE,CAAC,CAAC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { DmsMarketingConfig } from "@/config";
|
|
|
2
2
|
type ConfigKeysOfType<T> = {
|
|
3
3
|
[K in keyof DmsMarketingConfig]: DmsMarketingConfig[K] extends T ? K : never;
|
|
4
4
|
}[keyof DmsMarketingConfig];
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type NumericConfigKey = ConfigKeysOfType<number>;
|
|
6
|
+
type BooleanConfigKey = ConfigKeysOfType<boolean>;
|
|
7
7
|
interface SettingBase {
|
|
8
8
|
id: string;
|
|
9
9
|
labelKey: string;
|
|
@@ -3,7 +3,7 @@ export declare const SNAPSHOT_LAYOUTS: readonly ["desktop", "tablet", "phone"];
|
|
|
3
3
|
export type SnapshotLayout = (typeof SNAPSHOT_LAYOUTS)[number];
|
|
4
4
|
export declare function layoutOfWidth(width: number): SnapshotLayout;
|
|
5
5
|
export declare function isSnapshotLayout(value: unknown): value is SnapshotLayout;
|
|
6
|
-
|
|
6
|
+
declare const SNAPSHOT_COLOR_SCHEMES: readonly ["light", "dark"];
|
|
7
7
|
export type SnapshotColorScheme = (typeof SNAPSHOT_COLOR_SCHEMES)[number];
|
|
8
8
|
export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
9
9
|
website: z.ZodString;
|
|
@@ -12,11 +12,11 @@ export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
12
12
|
width: z.ZodNumber;
|
|
13
13
|
height: z.ZodNumber;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
height: number;
|
|
16
15
|
width: number;
|
|
17
|
-
}, {
|
|
18
16
|
height: number;
|
|
17
|
+
}, {
|
|
19
18
|
width: number;
|
|
19
|
+
height: number;
|
|
20
20
|
}>;
|
|
21
21
|
colorScheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
22
22
|
} & {
|
|
@@ -24,38 +24,38 @@ export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
24
24
|
width: z.ZodNumber;
|
|
25
25
|
height: z.ZodNumber;
|
|
26
26
|
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
height: number;
|
|
28
27
|
width: number;
|
|
29
|
-
}, {
|
|
30
28
|
height: number;
|
|
29
|
+
}, {
|
|
31
30
|
width: number;
|
|
31
|
+
height: number;
|
|
32
32
|
}>;
|
|
33
33
|
html: z.ZodString;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
35
|
url: string;
|
|
36
|
-
html: string;
|
|
37
|
-
document: {
|
|
38
|
-
height: number;
|
|
39
|
-
width: number;
|
|
40
|
-
};
|
|
41
36
|
website: string;
|
|
42
37
|
viewport: {
|
|
38
|
+
width: number;
|
|
43
39
|
height: number;
|
|
40
|
+
};
|
|
41
|
+
document: {
|
|
44
42
|
width: number;
|
|
43
|
+
height: number;
|
|
45
44
|
};
|
|
45
|
+
html: string;
|
|
46
46
|
colorScheme?: "light" | "dark" | undefined;
|
|
47
47
|
}, {
|
|
48
48
|
url: string;
|
|
49
|
-
html: string;
|
|
50
|
-
document: {
|
|
51
|
-
height: number;
|
|
52
|
-
width: number;
|
|
53
|
-
};
|
|
54
49
|
website: string;
|
|
55
50
|
viewport: {
|
|
51
|
+
width: number;
|
|
56
52
|
height: number;
|
|
53
|
+
};
|
|
54
|
+
document: {
|
|
57
55
|
width: number;
|
|
56
|
+
height: number;
|
|
58
57
|
};
|
|
58
|
+
html: string;
|
|
59
59
|
colorScheme?: "light" | "dark" | undefined;
|
|
60
60
|
}>, z.ZodObject<{
|
|
61
61
|
website: z.ZodString;
|
|
@@ -64,11 +64,11 @@ export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
64
64
|
width: z.ZodNumber;
|
|
65
65
|
height: z.ZodNumber;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
height: number;
|
|
68
67
|
width: number;
|
|
69
|
-
}, {
|
|
70
68
|
height: number;
|
|
69
|
+
}, {
|
|
71
70
|
width: number;
|
|
71
|
+
height: number;
|
|
72
72
|
}>;
|
|
73
73
|
colorScheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
74
74
|
} & {
|
|
@@ -77,8 +77,8 @@ export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
77
77
|
url: string;
|
|
78
78
|
website: string;
|
|
79
79
|
viewport: {
|
|
80
|
-
height: number;
|
|
81
80
|
width: number;
|
|
81
|
+
height: number;
|
|
82
82
|
};
|
|
83
83
|
oversizeBytes: number;
|
|
84
84
|
colorScheme?: "light" | "dark" | undefined;
|
|
@@ -86,10 +86,11 @@ export declare const snapshotRequestSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
86
86
|
url: string;
|
|
87
87
|
website: string;
|
|
88
88
|
viewport: {
|
|
89
|
-
height: number;
|
|
90
89
|
width: number;
|
|
90
|
+
height: number;
|
|
91
91
|
};
|
|
92
92
|
oversizeBytes: number;
|
|
93
93
|
colorScheme?: "light" | "dark" | undefined;
|
|
94
94
|
}>]>;
|
|
95
95
|
export type SnapshotRequestInput = z.infer<typeof snapshotRequestSchema>;
|
|
96
|
+
export {};
|
package/dist/types/snapshots.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snapshotRequestSchema = exports.
|
|
3
|
+
exports.snapshotRequestSchema = exports.SNAPSHOT_LAYOUTS = void 0;
|
|
4
4
|
exports.layoutOfWidth = layoutOfWidth;
|
|
5
5
|
exports.isSnapshotLayout = isSnapshotLayout;
|
|
6
6
|
const zod_1 = require("zod");
|
|
@@ -18,7 +18,7 @@ function layoutOfWidth(width) {
|
|
|
18
18
|
function isSnapshotLayout(value) {
|
|
19
19
|
return exports.SNAPSHOT_LAYOUTS.includes(value);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const SNAPSHOT_COLOR_SCHEMES = ["light", "dark"];
|
|
22
22
|
const dimensionSchema = (max) => zod_1.z.object({
|
|
23
23
|
width: zod_1.z.number().int().min(1).max(max),
|
|
24
24
|
height: zod_1.z.number().int().min(1).max(max),
|
|
@@ -27,7 +27,7 @@ const snapshotPageSchema = zod_1.z.object({
|
|
|
27
27
|
website: zod_1.z.string().min(1).max(constants_1.MAX_WEBSITE_ID_LENGTH),
|
|
28
28
|
url: zod_1.z.string().min(1).max(constants_1.MAX_URL_LENGTH),
|
|
29
29
|
viewport: dimensionSchema(constants_1.MAX_SNAPSHOT_VIEWPORT_PX),
|
|
30
|
-
colorScheme: zod_1.z.enum(
|
|
30
|
+
colorScheme: zod_1.z.enum(SNAPSHOT_COLOR_SCHEMES).optional(),
|
|
31
31
|
});
|
|
32
32
|
exports.snapshotRequestSchema = zod_1.z.union([
|
|
33
33
|
snapshotPageSchema.extend({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../src/types/snapshots.ts"],"names":[],"mappings":";;;AAwBA,sCAKC;AAED,4CAEC;AAjCD,6BAAwB;AACxB,2CAOqB;AAMR,QAAA,gBAAgB,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAIxE,MAAM,iBAAiB,GAAmC;IACxD,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,SAAgB,aAAa,CAAC,KAAa;IACzC,OAAO,CACL,wBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACrE,OAAO,CACR,CAAC;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc;IAC7C,OAAO,wBAAgB,CAAC,QAAQ,CAAC,KAAuB,CAAC,CAAC;AAC5D,CAAC;
|
|
1
|
+
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../src/types/snapshots.ts"],"names":[],"mappings":";;;AAwBA,sCAKC;AAED,4CAEC;AAjCD,6BAAwB;AACxB,2CAOqB;AAMR,QAAA,gBAAgB,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAIxE,MAAM,iBAAiB,GAAmC;IACxD,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,SAAgB,aAAa,CAAC,KA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CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,8BAAkB,CAAC;KAChD,CAAC;IACF,kBAAkB,CAAC,MAAM,CAAC;QACxB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,uCAA2B,CAAC;KAC5E,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const TOP_DIMENSIONS: readonly ["topPages", "topEntryPages", "topExitPages", "topReferrers", "topUtmSources", "topUtmMediums", "topUtmCampaigns", "topUtmTerms", "topUtmContents", "topCampaigns", "topChannels", "topDevices", "topBrowsers", "topCountries", "topEvents", "topLanguages"];
|
|
2
|
+
declare const MARKETING_CHANNELS: readonly ["direct", "organic", "social", "referral", "paid"];
|
|
3
3
|
export type MarketingChannel = (typeof MARKETING_CHANNELS)[number];
|
|
4
4
|
export type TopDimension = (typeof TOP_DIMENSIONS)[number];
|
|
5
5
|
export declare function byDimension<T>(make: (dimension: TopDimension) => T): Record<TopDimension, T>;
|
|
@@ -36,3 +36,4 @@ export interface DeviceInfo {
|
|
|
36
36
|
os?: string;
|
|
37
37
|
deviceType?: string;
|
|
38
38
|
}
|
|
39
|
+
export {};
|
package/dist/types/statistics.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MARKETING_CHANNELS = exports.TOP_DIMENSIONS = void 0;
|
|
4
3
|
exports.byDimension = byDimension;
|
|
5
|
-
|
|
4
|
+
const TOP_DIMENSIONS = [
|
|
6
5
|
"topPages",
|
|
7
6
|
"topEntryPages",
|
|
8
7
|
"topExitPages",
|
|
@@ -20,7 +19,7 @@ exports.TOP_DIMENSIONS = [
|
|
|
20
19
|
"topEvents",
|
|
21
20
|
"topLanguages",
|
|
22
21
|
];
|
|
23
|
-
|
|
22
|
+
const MARKETING_CHANNELS = [
|
|
24
23
|
"direct",
|
|
25
24
|
"organic",
|
|
26
25
|
"social",
|
|
@@ -28,6 +27,6 @@ exports.MARKETING_CHANNELS = [
|
|
|
28
27
|
"paid",
|
|
29
28
|
];
|
|
30
29
|
function byDimension(make) {
|
|
31
|
-
return Object.fromEntries(
|
|
30
|
+
return Object.fromEntries(TOP_DIMENSIONS.map((dimension) => [dimension, make(dimension)]));
|
|
32
31
|
}
|
|
33
32
|
//# sourceMappingURL=statistics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../src/types/statistics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../src/types/statistics.ts"],"names":[],"mappings":";;AAqDA,kCAMC;AAhDD,MAAM,cAAc,GAAG;IACrB,UAAU;IACV,eAAe;IACf,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,YAAY;IACZ,aAAa;IACb,cAAc;IACd,WAAW;IACX,cAAc;CACN,CAAC;AAQX,MAAM,kBAAkB,GAAG;IACzB,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,UAAU;IACV,MAAM;CACE,CAAC;AAWX,SAAgB,WAAW,CACzB,IAAoC;IAEpC,OAAO,MAAM,CAAC,WAAW,CACvB,cAAc,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CACrC,CAAC;AAC/B,CAAC"}
|
|
@@ -31,14 +31,14 @@ declare const experimentSchema: z.ZodObject<{
|
|
|
31
31
|
key: string;
|
|
32
32
|
weight: number;
|
|
33
33
|
}[];
|
|
34
|
-
status?: "
|
|
34
|
+
status?: "draft" | "running" | "stopped" | undefined;
|
|
35
35
|
}, {
|
|
36
36
|
key: string;
|
|
37
37
|
variations: {
|
|
38
38
|
key: string;
|
|
39
39
|
weight: number;
|
|
40
40
|
}[];
|
|
41
|
-
status?: "
|
|
41
|
+
status?: "draft" | "running" | "stopped" | undefined;
|
|
42
42
|
}>;
|
|
43
43
|
export type ExperimentInput = z.output<typeof experimentSchema>;
|
|
44
44
|
export declare function parseExperimentInput(raw: unknown): ExperimentInput | null;
|
|
@@ -4,11 +4,11 @@ declare const stepSchema: z.ZodObject<{
|
|
|
4
4
|
kind: z.ZodEnum<["url", "custom"]>;
|
|
5
5
|
value: z.ZodString;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
kind: "url" | "custom";
|
|
7
8
|
value: string;
|
|
8
|
-
kind: "custom" | "url";
|
|
9
9
|
}, {
|
|
10
|
+
kind: "url" | "custom";
|
|
10
11
|
value: string;
|
|
11
|
-
kind: "custom" | "url";
|
|
12
12
|
}>;
|
|
13
13
|
export type FunnelStepInput = z.output<typeof stepSchema>;
|
|
14
14
|
export declare function parseFunnelSteps(raw: unknown): FunnelStepInput[];
|
|
@@ -20,23 +20,23 @@ export declare class FunnelStepsType extends DataType {
|
|
|
20
20
|
kind: z.ZodEnum<["url", "custom"]>;
|
|
21
21
|
value: z.ZodString;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
kind: "url" | "custom";
|
|
23
24
|
value: string;
|
|
24
|
-
kind: "custom" | "url";
|
|
25
25
|
}, {
|
|
26
|
+
kind: "url" | "custom";
|
|
26
27
|
value: string;
|
|
27
|
-
kind: "custom" | "url";
|
|
28
28
|
}>, "many">]>, any, string | {
|
|
29
|
+
kind: "url" | "custom";
|
|
29
30
|
value: string;
|
|
30
|
-
kind: "custom" | "url";
|
|
31
31
|
}[]>, z.ZodArray<z.ZodObject<{
|
|
32
32
|
kind: z.ZodEnum<["url", "custom"]>;
|
|
33
33
|
value: z.ZodString;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
kind: "url" | "custom";
|
|
35
36
|
value: string;
|
|
36
|
-
kind: "custom" | "url";
|
|
37
37
|
}, {
|
|
38
|
+
kind: "url" | "custom";
|
|
38
39
|
value: string;
|
|
39
|
-
kind: "custom" | "url";
|
|
40
40
|
}>, "many">>;
|
|
41
41
|
}
|
|
42
42
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onMounted, watch } from 'vue'
|
|
3
3
|
import { useI18n } from '#dms/frontend-module'
|
|
4
|
+
import { MS_PER_DAY } from '../constants'
|
|
4
5
|
import { useChildId } from '../composables/useChildId'
|
|
5
6
|
import { useLatestRequest } from '../composables/useLatestRequest'
|
|
6
7
|
import {
|
|
@@ -10,7 +11,6 @@ import {
|
|
|
10
11
|
import {
|
|
11
12
|
DEFAULT_PERIOD_PRESET,
|
|
12
13
|
MARKETING_PERIOD_PRESETS,
|
|
13
|
-
MS_PER_DAY,
|
|
14
14
|
periodDays,
|
|
15
15
|
useMarketingPeriod,
|
|
16
16
|
} from '../composables/useMarketingPeriod'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, type ComputedRef } from 'vue'
|
|
2
|
+
import { MS_PER_DAY } from '../constants'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Bridge between the DMS period selector and the marketing endpoints.
|
|
@@ -9,8 +10,6 @@ import { computed, type ComputedRef } from 'vue'
|
|
|
9
10
|
* carry the window as a query parameter and have to map it back onto a preset.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
|
-
export const MS_PER_DAY = 86_400_000
|
|
13
|
-
|
|
14
13
|
export const DEFAULT_PERIOD_DAYS = 7
|
|
15
14
|
export const DEFAULT_PERIOD = `${DEFAULT_PERIOD_DAYS}d`
|
|
16
15
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-wide constants, imported explicitly.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately outside `app/composables`, `app/types` and `app/utils`: the DMS
|
|
5
|
+
* frontend builder auto-imports everything those directories export into the
|
|
6
|
+
* shared namespace, where a generic name silently shadows the core's. This
|
|
7
|
+
* file is never scanned, so anything here has to be imported by hand.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const MS_PER_DAY = 86_400_000
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The real module only exists inside the Vue workspace the DMS frontend
|
|
5
5
|
* loader generates; these tests run the module's own sources directly, so the
|
|
6
|
-
* few SDK helpers they reach are stubbed with the same shapes.
|
|
7
|
-
* contract is checked by `pnpm test:frontend`, which builds this module
|
|
8
|
-
* through the loader for real.
|
|
6
|
+
* few SDK helpers they reach are stubbed with the same shapes.
|
|
9
7
|
*/
|
|
10
8
|
import type { Component, Plugin } from 'vue'
|
|
11
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-marketing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"LICENSE",
|
|
11
11
|
"dist",
|
|
12
|
+
"!dist/.tsbuildinfo",
|
|
12
13
|
"frontend-vue",
|
|
13
14
|
"static"
|
|
14
15
|
],
|
|
@@ -29,12 +30,12 @@
|
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"@antelopejs/interface-api": ">=0.0.13 <1.0.0",
|
|
31
32
|
"@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
|
|
32
|
-
"@antelopejs/interface-core": ">=0.
|
|
33
|
+
"@antelopejs/interface-core": ">=0.1.1 <1.0.0",
|
|
33
34
|
"@antelopejs/interface-data-api": ">=0.1.9 <1.0.0",
|
|
34
35
|
"@antelopejs/interface-database": ">=0.1.7 <1.0.0",
|
|
35
36
|
"@antelopejs/interface-database-decorators": ">=0.1.6 <1.0.0",
|
|
36
|
-
"@antelopejs/interface-dms": ">=0.
|
|
37
|
-
"@antelopejs/interface-dms-marketing": ">=0.
|
|
37
|
+
"@antelopejs/interface-dms": ">=0.2.0 <1.0.0",
|
|
38
|
+
"@antelopejs/interface-dms-marketing": ">=0.3.0 <1.0.0",
|
|
38
39
|
"defu": "^6.1.4",
|
|
39
40
|
"maxmind": "^5.0.7",
|
|
40
41
|
"node-cron": "^4.2.1",
|
|
@@ -42,11 +43,9 @@
|
|
|
42
43
|
"zod": "~3.24.4"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@antelopejs/core": ">=1.
|
|
46
|
-
"@antelopejs/
|
|
47
|
-
"@antelopejs/
|
|
48
|
-
"@antelopejs/interface-mongodb": ">=0.0.3 <1.0.0",
|
|
49
|
-
"@antelopejs/mongodb": "1.3.0",
|
|
46
|
+
"@antelopejs/core": ">=1.9.1 <2",
|
|
47
|
+
"@antelopejs/interface-mongodb": ">=0.0.5 <1.0.0",
|
|
48
|
+
"@antelopejs/mongodb": "1.3.1",
|
|
50
49
|
"@antelopejs/tooling-configs": ">=0.0.6 <1.0.0",
|
|
51
50
|
"@types/node": "^22.19.15",
|
|
52
51
|
"knip": "^6.34.0",
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"release-it": "^19.2.4",
|
|
59
58
|
"release-it-changelogen": "^0.1.0",
|
|
60
59
|
"rimraf": "^6.1.3",
|
|
61
|
-
"typescript": "^
|
|
60
|
+
"typescript": "^6.0.3"
|
|
62
61
|
},
|
|
63
62
|
"antelopeJs": {
|
|
64
63
|
"baseUrl": "dist",
|
|
@@ -73,18 +72,17 @@
|
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
74
|
"scripts": {
|
|
76
|
-
"build": "pnpm --filter @antelopejs/interface-dms-marketing build && rimraf dist && tsc
|
|
75
|
+
"build": "pnpm --filter @antelopejs/interface-dms-marketing build && rimraf dist && tsc",
|
|
77
76
|
"test": "pnpm run test:backend && pnpm run test:layer",
|
|
78
77
|
"test:backend": "pnpm run build && ajs module test .",
|
|
79
78
|
"test:layer": "cd frontend-vue && pnpm test",
|
|
80
|
-
"test:frontend": "node scripts/check-frontend.mjs",
|
|
81
79
|
"dev": "ajs project run -w -p playground",
|
|
82
80
|
"frontend:dev": "cd playground && pnpm frontend:dev",
|
|
83
81
|
"lint": "oxlint && oxfmt --check . && cd frontend-vue && pnpm lint",
|
|
84
82
|
"lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && cd frontend-vue && pnpm lint:fix",
|
|
85
83
|
"format": "oxfmt . && cd frontend-vue && pnpm format",
|
|
86
84
|
"release": "pnpm --filter @antelopejs/interface-dms-marketing build && pnpm --dir frontend-vue install --frozen-lockfile && pnpm run lint && release-it",
|
|
87
|
-
"typecheck": "tsc
|
|
85
|
+
"typecheck": "tsc --noEmit",
|
|
88
86
|
"knip": "knip --dependencies",
|
|
89
87
|
"knip:all": "knip"
|
|
90
88
|
}
|