@ninetailed/experience.js-shared
Advanced tools
Comparing version 7.5.0 to 7.6.0-beta.1
27
index.js
@@ -605,3 +605,3 @@ import { z } from 'zod'; | ||
name: 'Ninetailed React Analytics SDK', | ||
version: "7.5.0" | ||
version: "7.6.0-beta.1" | ||
}, | ||
@@ -654,2 +654,12 @@ userAgent: ctx.userAgent, | ||
const buildComponentViewEvent = data => { | ||
return Object.assign(Object.assign({}, buildEvent(Object.assign(Object.assign({}, data), { | ||
type: 'component' | ||
}))), { | ||
componentId: data.componentId, | ||
experienceId: data.experienceId, | ||
variantIndex: data.variantIndex | ||
}); | ||
}; | ||
const isBrowser = () => typeof window !== 'undefined'; | ||
@@ -691,2 +701,15 @@ | ||
const isPageViewEvent = event => { | ||
return event.type === 'page'; | ||
}; | ||
const isTrackEvent = event => { | ||
return event.type === 'track'; | ||
}; | ||
const isIdentifyEvent = event => { | ||
return event.type === 'identify'; | ||
}; | ||
const isComponentViewEvent = event => { | ||
return event.type === 'component'; | ||
}; | ||
const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_'; | ||
@@ -831,2 +854,2 @@ | ||
export { ANONYMOUS_ID, Alias, Alpha2Code, CONSENT, Campaign, Component, ConsoleLogSink, CreateProfileRequestBody, CreateProfileResponse, DEBUG_FLAG, EMPTY_MERGE_ID, EXPERIENCES_FALLBACK_CACHE, EXPERIENCE_TRAIT_PREFIX, FEATURES, GeoLocation, Group, Identify, Json, JsonLiteral, JsonLiteralObject, JsonObject, LEGACY_ANONYMOUS_ID, Logger, NINETAILED_ANONYMOUS_ID_COOKIE, NinetailedApiClient, OnErrorLogSink, OnLogLogSink, PROFILE_CHANGE, PROFILE_FALLBACK_CACHE, PROFILE_RESET, Page, Pageview, PageviewProperties, Profile, JsonObject as Properties, Query, RequestBodyOptions, SET_ENABLED_FEATURES, Screen, SelectedVariantInfo, SessionStatistics, Track, JsonObject as Traits, UpdateProfileRequestBody, UpdateProfileResponse, UpsertManyProfilesRequestBody, UpsertManyProfilesResponse, buildCampaign, buildEvent, buildIdentifyEvent, buildPage, buildPageEvent, buildQuery, buildTrackEvent, fetchTimeout, getDistributionRandom, getTrafficRandom, isBrowser, isExperienceMatch, logger, pickBy, pickExperimentTraits, pipe, selectActiveExperiments, selectBaselineWithVariants, selectDistribution, selectExperience, selectHasVariants, selectVariant, selectVariants, template, unionBy }; | ||
export { ANONYMOUS_ID, Alias, Alpha2Code, CONSENT, Campaign, Component, ConsoleLogSink, CreateProfileRequestBody, CreateProfileResponse, DEBUG_FLAG, EMPTY_MERGE_ID, EXPERIENCES_FALLBACK_CACHE, EXPERIENCE_TRAIT_PREFIX, FEATURES, GeoLocation, Group, Identify, Json, JsonLiteral, JsonLiteralObject, JsonObject, LEGACY_ANONYMOUS_ID, Logger, NINETAILED_ANONYMOUS_ID_COOKIE, NinetailedApiClient, OnErrorLogSink, OnLogLogSink, PROFILE_CHANGE, PROFILE_FALLBACK_CACHE, PROFILE_RESET, Page, Pageview, PageviewProperties, Profile, JsonObject as Properties, Query, RequestBodyOptions, SET_ENABLED_FEATURES, Screen, SelectedVariantInfo, SessionStatistics, Track, JsonObject as Traits, UpdateProfileRequestBody, UpdateProfileResponse, UpsertManyProfilesRequestBody, UpsertManyProfilesResponse, buildCampaign, buildComponentViewEvent, buildEvent, buildIdentifyEvent, buildPage, buildPageEvent, buildQuery, buildTrackEvent, fetchTimeout, getDistributionRandom, getTrafficRandom, isBrowser, isComponentViewEvent, isExperienceMatch, isIdentifyEvent, isPageViewEvent, isTrackEvent, logger, pickBy, pickExperimentTraits, pipe, selectActiveExperiments, selectBaselineWithVariants, selectDistribution, selectExperience, selectHasVariants, selectVariant, selectVariants, template, unionBy }; |
{ | ||
"name": "@ninetailed/experience.js-shared", | ||
"version": "7.5.0", | ||
"version": "7.6.0-beta.1", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "@ninetailed/testing-utils": "*" |
@@ -12,2 +12,3 @@ export * from './lib/types/Endpoints/CreateProfile'; | ||
export * from './lib/types/Event/AliasEvent'; | ||
export * from './lib/types/Event/ComponentViewEvent'; | ||
export * from './lib/types/Event/Campaign'; | ||
@@ -49,2 +50,3 @@ export * from './lib/types/Event/Page'; | ||
export * from './lib/event/build-identify-event'; | ||
export * from './lib/event/build-component-view-event'; | ||
export * from './lib/utils/isBrowser'; | ||
@@ -55,2 +57,3 @@ export * from './lib/utils/pipe'; | ||
export * from './lib/utils/template'; | ||
export * from './lib/utils/events'; | ||
export * from './lib/utils/experiences/constants'; | ||
@@ -57,0 +60,0 @@ export * from './lib/utils/experiences/isExperienceMatch'; |
@@ -5,3 +5,3 @@ import { Object } from 'ts-toolbelt'; | ||
import { BuildEventArgs } from './build-event'; | ||
type IdentifyEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
export type IdentifyEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
userId: string; | ||
@@ -11,2 +11,1 @@ traits: Traits; | ||
export declare const buildIdentifyEvent: (data: IdentifyEventArgs) => IdentifyEvent; | ||
export {}; |
@@ -5,6 +5,5 @@ import { Object } from 'ts-toolbelt'; | ||
import { BuildEventArgs } from './build-event'; | ||
type BuildPageEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
export type BuildPageEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
properties: Properties; | ||
}, 'deep'>, 'type'>; | ||
export declare const buildPageEvent: (data: BuildPageEventArgs) => PageviewEvent; | ||
export {}; |
@@ -5,3 +5,3 @@ import { Object } from 'ts-toolbelt'; | ||
import { BuildEventArgs } from './build-event'; | ||
type BuildTrackEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
export type BuildTrackEventArgs = Object.Omit<Object.Merge<BuildEventArgs, { | ||
event: string; | ||
@@ -11,2 +11,1 @@ properties: Properties; | ||
export declare const buildTrackEvent: (data: BuildTrackEventArgs) => TrackEvent; | ||
export {}; |
@@ -7,2 +7,3 @@ import type { PageviewEvent } from './PageviewEvent'; | ||
import type { AliasEvent } from './AliasEvent'; | ||
export type Event = PageviewEvent | TrackEvent | IdentifyEvent | ScreenEvent | GroupEvent | AliasEvent; | ||
import type { ComponentViewEvent } from './ComponentViewEvent'; | ||
export type Event = PageviewEvent | TrackEvent | IdentifyEvent | ScreenEvent | GroupEvent | AliasEvent | ComponentViewEvent; |
import { Baseline, BaselineWithVariants, ExperienceConfiguration, Reference } from '../../types/ExperienceDefinition'; | ||
export declare const selectBaselineWithVariants: <Variant extends Reference>(experience: ExperienceConfiguration<Variant>, baseline: Baseline) => BaselineWithVariants<Variant> | null; | ||
export declare const selectBaselineWithVariants: <TVariant extends Reference>(experience: ExperienceConfiguration<TVariant>, baseline: Baseline) => BaselineWithVariants<TVariant> | null; |
import { Baseline, ExperienceConfiguration, Reference, VariantRef } from '../../types/ExperienceDefinition'; | ||
export declare const selectVariants: <Variant extends Reference>(experience: ExperienceConfiguration<Variant>, baseline: Baseline) => (Variant | VariantRef)[]; | ||
export declare const selectVariants: <TVariant extends Reference>(experience: ExperienceConfiguration<TVariant>, baseline: Baseline) => (TVariant | VariantRef)[]; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166366
75
4417
2