@rudderstack/analytics-js 3.0.3 → 3.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/CHANGELOG.md +20 -0
- package/dist/npm/index.d.ts +1 -314
- package/dist/npm/legacy/cjs/index.js +27 -25
- package/dist/npm/legacy/esm/index.js +27 -25
- package/dist/npm/legacy/umd/index.js +27 -25
- package/dist/npm/modern/bundled/cjs/index.js +21 -19
- package/dist/npm/modern/bundled/esm/index.js +21 -19
- package/dist/npm/modern/bundled/umd/index.js +21 -19
- package/dist/npm/modern/cjs/index.js +21 -19
- package/dist/npm/modern/content-script/cjs/index.js +20 -18
- package/dist/npm/modern/content-script/esm/index.js +20 -18
- package/dist/npm/modern/content-script/umd/index.js +20 -18
- package/dist/npm/modern/esm/index.js +21 -19
- package/dist/npm/modern/umd/index.js +21 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,26 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [3.1.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.4...@rudderstack/analytics-js@3.1.0) (2024-04-26)
|
6
|
+
|
7
|
+
### Dependency Updates
|
8
|
+
|
9
|
+
* `@rudderstack/analytics-js-common` updated to version `3.0.4`
|
10
|
+
* `@rudderstack/analytics-js-plugins` updated to version `3.0.4`
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* add a patch for storejs to expose length of the store ([#1694](https://github.com/rudderlabs/rudder-sdk-js/issues/1694)) ([36a13b0](https://github.com/rudderlabs/rudder-sdk-js/commit/36a13b017b3f95fab0aa9dfb73ec1e446ac7bb96))
|
15
|
+
* warn users on missing plugins ([#1691](https://github.com/rudderlabs/rudder-sdk-js/issues/1691)) ([c57cf82](https://github.com/rudderlabs/rudder-sdk-js/commit/c57cf820346a7fede352f2f346db37ad51413cf8))
|
16
|
+
|
17
|
+
## [3.0.4](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.3...@rudderstack/analytics-js@3.0.4) (2024-04-12)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* remove MutationObserver and make polyfill checks consistent ([#1688](https://github.com/rudderlabs/rudder-sdk-js/issues/1688)) ([51b42fe](https://github.com/rudderlabs/rudder-sdk-js/commit/51b42fe51a5fbfa79df23b9b36095cc494dbcaa1))
|
23
|
+
* remove unnecessary window globals declarations ([#1687](https://github.com/rudderlabs/rudder-sdk-js/issues/1687)) ([09e5ab8](https://github.com/rudderlabs/rudder-sdk-js/commit/09e5ab89965a0b0dc5070891288a08358c103c0e))
|
24
|
+
|
5
25
|
## [3.0.3](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.2...@rudderstack/analytics-js@3.0.3) (2024-03-22)
|
6
26
|
|
7
27
|
### Dependency Updates
|
package/dist/npm/index.d.ts
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
/// <reference types="../node_modules/user-agent-data-types/index.d.ts" />
|
2
|
-
import { Signal } from '@preact/signals-core';
|
3
|
-
|
4
1
|
type LoggerProvider$1 = Record<Exclude<Lowercase<LogLevel>, Lowercase<'NONE'>>, (...data: any[]) => void>;
|
5
2
|
interface ILogger {
|
6
3
|
minLogLevel: number;
|
@@ -63,7 +60,6 @@ type IntegrationOpts = {
|
|
63
60
|
[index: string]: DestinationIntgConfig;
|
64
61
|
};
|
65
62
|
|
66
|
-
type Traits = Nullable<ApiObject>;
|
67
63
|
type ApiCallback = (data?: any) => void;
|
68
64
|
/**
|
69
65
|
* Represents the options parameter in the APIs
|
@@ -88,12 +84,7 @@ type APIEvent = {
|
|
88
84
|
groupId?: Nullable<string>;
|
89
85
|
};
|
90
86
|
type RudderEventType = 'page' | 'track' | 'identify' | 'alias' | 'group';
|
91
|
-
type ReadyCallback = () => void;
|
92
87
|
|
93
|
-
type RegionDetails = {
|
94
|
-
url: string;
|
95
|
-
default: boolean;
|
96
|
-
};
|
97
88
|
/**
|
98
89
|
* Represents residency server input the options
|
99
90
|
*/
|
@@ -141,18 +132,7 @@ interface IPluginsManager {
|
|
141
132
|
}
|
142
133
|
type PluginName = 'BeaconQueue' | 'Bugsnag' | 'CustomConsentManager' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ErrorReporting' | 'ExternalAnonymousId' | 'GoogleLinker' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
143
134
|
|
144
|
-
type OneTrustCookieCategory = {
|
145
|
-
oneTrustCookieCategory: string;
|
146
|
-
};
|
147
|
-
type ConsentManagementMetadata = {
|
148
|
-
providers: ConsentManagementProviderMetadata[];
|
149
|
-
};
|
150
|
-
type ConsentManagementProviderMetadata = {
|
151
|
-
provider: ConsentManagementProvider;
|
152
|
-
resolutionStrategy: ConsentResolutionStrategy;
|
153
|
-
};
|
154
135
|
type ConsentManagementProvider = 'oneTrust' | 'ketch' | 'custom';
|
155
|
-
type ConsentResolutionStrategy = 'and' | 'or';
|
156
136
|
type Consents = string[];
|
157
137
|
type ConsentManagementOptions = {
|
158
138
|
enabled?: boolean;
|
@@ -160,13 +140,6 @@ type ConsentManagementOptions = {
|
|
160
140
|
allowedConsentIds?: Consents;
|
161
141
|
deniedConsentIds?: Consents;
|
162
142
|
};
|
163
|
-
type ConsentsInfo = {
|
164
|
-
allowedConsentIds?: Consents;
|
165
|
-
deniedConsentIds?: Consents;
|
166
|
-
};
|
167
|
-
type KetchConsentPurpose = {
|
168
|
-
purpose: string;
|
169
|
-
};
|
170
143
|
|
171
144
|
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
172
145
|
|
@@ -211,15 +184,6 @@ type SessionOpts = {
|
|
211
184
|
autoTrack?: boolean;
|
212
185
|
timeout?: number;
|
213
186
|
};
|
214
|
-
type EventMapping = {
|
215
|
-
from: string;
|
216
|
-
to: string;
|
217
|
-
};
|
218
|
-
type Conversion = {
|
219
|
-
conversionLabel: string;
|
220
|
-
name: string;
|
221
|
-
};
|
222
|
-
type EventFilteringOption = 'disable' | 'whitelistedEvents' | 'blacklistedEvents';
|
223
187
|
/**
|
224
188
|
* Represents the beacon queue options parameter in loadOptions type
|
225
189
|
*/
|
@@ -807,97 +771,6 @@ interface IUserSessionManager {
|
|
807
771
|
setAuthToken(token: Nullable<string>): void;
|
808
772
|
}
|
809
773
|
|
810
|
-
type DestinationConnectionMode = 'hybrid' | 'cloud' | 'device';
|
811
|
-
type DestinationEvent = {
|
812
|
-
eventName: string;
|
813
|
-
};
|
814
|
-
type DeviceModeDestination = {
|
815
|
-
name: string;
|
816
|
-
destinationId: string;
|
817
|
-
shouldApplyDeviceModeTransformation: boolean;
|
818
|
-
propagateEventsUntransformedOnError: boolean;
|
819
|
-
analytics: any;
|
820
|
-
[index: string]: any;
|
821
|
-
isLoaded: () => boolean;
|
822
|
-
isReady?: () => boolean;
|
823
|
-
};
|
824
|
-
type ConsentsConfig = {
|
825
|
-
consent: string;
|
826
|
-
};
|
827
|
-
type ConsentManagementProviderConfig = {
|
828
|
-
provider: ConsentManagementProvider;
|
829
|
-
consents: ConsentsConfig[];
|
830
|
-
resolutionStrategy: string | undefined;
|
831
|
-
};
|
832
|
-
type DestinationConfig = {
|
833
|
-
blacklistedEvents: DestinationEvent[];
|
834
|
-
whitelistedEvents: DestinationEvent[];
|
835
|
-
oneTrustCookieCategories?: OneTrustCookieCategory[];
|
836
|
-
ketchConsentPurposes?: KetchConsentPurpose[];
|
837
|
-
consentManagement?: ConsentManagementProviderConfig[];
|
838
|
-
eventFilteringOption: EventFilteringOption;
|
839
|
-
clickEventConversions?: Conversion[];
|
840
|
-
pageLoadConversions?: Conversion[];
|
841
|
-
conversionID?: string;
|
842
|
-
conversionLinker?: boolean;
|
843
|
-
disableAdPersonalization?: boolean;
|
844
|
-
dynamicRemarketing?: boolean;
|
845
|
-
sendPageView?: boolean;
|
846
|
-
defaultPageConversion?: string;
|
847
|
-
enableConversionEventsFiltering?: boolean;
|
848
|
-
trackConversions?: boolean;
|
849
|
-
trackDynamicRemarketing?: boolean;
|
850
|
-
tagID?: string;
|
851
|
-
advertiserId?: string;
|
852
|
-
partnerId?: string;
|
853
|
-
measurementId?: string;
|
854
|
-
capturePageView?: string;
|
855
|
-
useNativeSDKToSend?: boolean;
|
856
|
-
connectionMode?: DestinationConnectionMode;
|
857
|
-
extendPageViewParams?: boolean;
|
858
|
-
eventMappingFromConfig?: EventMapping[];
|
859
|
-
appKey?: string;
|
860
|
-
dataCenter?: string;
|
861
|
-
enableBrazeLogging?: boolean;
|
862
|
-
enableNestedArrayOperations?: boolean;
|
863
|
-
enableSubscriptionGroupInGroupCall?: boolean;
|
864
|
-
supportDedup?: boolean;
|
865
|
-
trackAnonymousUser?: boolean;
|
866
|
-
serverUrl?: string;
|
867
|
-
containerID?: string;
|
868
|
-
fs_debug_mode?: boolean;
|
869
|
-
fs_org?: boolean;
|
870
|
-
siteID?: string;
|
871
|
-
[key: string]: any;
|
872
|
-
};
|
873
|
-
type Destination = {
|
874
|
-
id: string;
|
875
|
-
displayName: string;
|
876
|
-
userFriendlyId: string;
|
877
|
-
shouldApplyDeviceModeTransformation: boolean;
|
878
|
-
propagateEventsUntransformedOnError: boolean;
|
879
|
-
config: DestinationConfig;
|
880
|
-
instance?: DeviceModeDestination;
|
881
|
-
};
|
882
|
-
|
883
|
-
type StatsCollection = {
|
884
|
-
errors: {
|
885
|
-
enabled: boolean;
|
886
|
-
provider?: string;
|
887
|
-
};
|
888
|
-
metrics: {
|
889
|
-
enabled: boolean;
|
890
|
-
};
|
891
|
-
};
|
892
|
-
type SourceConfig = {
|
893
|
-
statsCollection?: StatsCollection;
|
894
|
-
};
|
895
|
-
type Source = {
|
896
|
-
id: string;
|
897
|
-
config?: SourceConfig;
|
898
|
-
dataplanes?: Record<ResidencyServerRegion, RegionDetails[]>;
|
899
|
-
};
|
900
|
-
|
901
774
|
interface IConfigManager {
|
902
775
|
httpClient: IHttpClient;
|
903
776
|
errorHandler?: IErrorHandler;
|
@@ -1142,197 +1015,11 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
1142
1015
|
}
|
1143
1016
|
//# sourceMappingURL=RudderAnalytics.d.ts.map
|
1144
1017
|
|
1145
|
-
type AppInfo = {
|
1146
|
-
readonly name: string;
|
1147
|
-
readonly version: string;
|
1148
|
-
readonly namespace: string;
|
1149
|
-
};
|
1150
|
-
type LibraryInfo = {
|
1151
|
-
readonly name: string;
|
1152
|
-
readonly version: string;
|
1153
|
-
readonly snippetVersion?: string;
|
1154
|
-
};
|
1155
|
-
type OSInfo = {
|
1156
|
-
readonly name: string;
|
1157
|
-
readonly version: string;
|
1158
|
-
};
|
1159
|
-
type ScreenInfo = {
|
1160
|
-
readonly density: number;
|
1161
|
-
readonly width: number;
|
1162
|
-
readonly height: number;
|
1163
|
-
readonly innerWidth: number;
|
1164
|
-
readonly innerHeight: number;
|
1165
|
-
};
|
1166
|
-
|
1167
|
-
type BufferedEvent = any[];
|
1168
|
-
|
1169
|
-
type LifecycleStatus = 'mounted' | 'browserCapabilitiesReady' | 'configured' | 'pluginsLoading' | 'pluginsReady' | 'initialized' | 'loaded' | 'destinationsLoading' | 'destinationsReady' | 'ready' | 'readyExecuted';
|
1170
|
-
|
1171
|
-
type SessionInfo = {
|
1172
|
-
autoTrack?: boolean;
|
1173
|
-
manualTrack?: boolean;
|
1174
|
-
timeout?: number;
|
1175
|
-
expiresAt?: number;
|
1176
|
-
id?: number;
|
1177
|
-
sessionStart?: boolean;
|
1178
|
-
};
|
1179
|
-
|
1180
|
-
type CapabilitiesState = {
|
1181
|
-
isOnline: Signal<boolean>;
|
1182
|
-
storage: {
|
1183
|
-
isLocalStorageAvailable: Signal<boolean>;
|
1184
|
-
isCookieStorageAvailable: Signal<boolean>;
|
1185
|
-
isSessionStorageAvailable: Signal<boolean>;
|
1186
|
-
};
|
1187
|
-
isBeaconAvailable: Signal<boolean>;
|
1188
|
-
isLegacyDOM: Signal<boolean>;
|
1189
|
-
isUaCHAvailable: Signal<boolean>;
|
1190
|
-
isCryptoAvailable: Signal<boolean>;
|
1191
|
-
isIE11: Signal<boolean>;
|
1192
|
-
isAdBlocked: Signal<boolean>;
|
1193
|
-
};
|
1194
|
-
type ConsentsState = {
|
1195
|
-
enabled: Signal<boolean>;
|
1196
|
-
data: Signal<ConsentsInfo>;
|
1197
|
-
initialized: Signal<boolean>;
|
1198
|
-
activeConsentManagerPluginName: Signal<PluginName | undefined>;
|
1199
|
-
preConsent: Signal<PreConsentOptions>;
|
1200
|
-
postConsent: Signal<ConsentOptions>;
|
1201
|
-
resolutionStrategy: Signal<ConsentResolutionStrategy | undefined>;
|
1202
|
-
provider: Signal<ConsentManagementProvider | undefined>;
|
1203
|
-
metadata: Signal<ConsentManagementMetadata | undefined>;
|
1204
|
-
};
|
1205
|
-
type ContextState = {
|
1206
|
-
app: Signal<AppInfo>;
|
1207
|
-
traits: Signal<Nullable<Traits>>;
|
1208
|
-
library: Signal<LibraryInfo>;
|
1209
|
-
userAgent: Signal<Nullable<string>>;
|
1210
|
-
device: Signal<Nullable<any>>;
|
1211
|
-
network: Signal<Nullable<any>>;
|
1212
|
-
os: Signal<OSInfo>;
|
1213
|
-
locale: Signal<Nullable<string>>;
|
1214
|
-
screen: Signal<ScreenInfo>;
|
1215
|
-
'ua-ch': Signal<UADataValues | undefined>;
|
1216
|
-
timezone: Signal<string | undefined>;
|
1217
|
-
};
|
1218
|
-
type EventBufferState = {
|
1219
|
-
toBeProcessedArray: Signal<BufferedEvent[]>;
|
1220
|
-
readyCallbacksArray: Signal<ApiCallback[]>;
|
1221
|
-
};
|
1222
|
-
type LifecycleState = {
|
1223
|
-
activeDataplaneUrl: Signal<string | undefined>;
|
1224
|
-
integrationsCDNPath: Signal<string | undefined>;
|
1225
|
-
pluginsCDNPath: Signal<string | undefined>;
|
1226
|
-
sourceConfigUrl: Signal<string | undefined>;
|
1227
|
-
status: Signal<LifecycleStatus | undefined>;
|
1228
|
-
initialized: Signal<boolean>;
|
1229
|
-
logLevel: Signal<LogLevel>;
|
1230
|
-
loaded: Signal<boolean>;
|
1231
|
-
readyCallbacks: Signal<ReadyCallback[]>;
|
1232
|
-
writeKey: Signal<string | undefined>;
|
1233
|
-
dataPlaneUrl: Signal<string | undefined>;
|
1234
|
-
};
|
1235
|
-
type LoadOptionsState = Signal<LoadOptions>;
|
1236
|
-
type MetricsState = {
|
1237
|
-
retries: Signal<number>;
|
1238
|
-
dropped: Signal<number>;
|
1239
|
-
sent: Signal<number>;
|
1240
|
-
queued: Signal<number>;
|
1241
|
-
triggered: Signal<number>;
|
1242
|
-
};
|
1243
|
-
type NativeDestinationsState = {
|
1244
|
-
configuredDestinations: Signal<Destination[]>;
|
1245
|
-
activeDestinations: Signal<Destination[]>;
|
1246
|
-
loadOnlyIntegrations: Signal<IntegrationOpts>;
|
1247
|
-
failedDestinations: Signal<Destination[]>;
|
1248
|
-
loadIntegration: Signal<boolean>;
|
1249
|
-
initializedDestinations: Signal<Destination[]>;
|
1250
|
-
clientDestinationsReady: Signal<boolean>;
|
1251
|
-
integrationsConfig: Signal<IntegrationOpts>;
|
1252
|
-
};
|
1253
|
-
type PluginsState = {
|
1254
|
-
ready: Signal<boolean>;
|
1255
|
-
loadedPlugins: Signal<string[]>;
|
1256
|
-
failedPlugins: Signal<string[]>;
|
1257
|
-
pluginsToLoadFromConfig: Signal<string[]>;
|
1258
|
-
activePlugins: Signal<string[]>;
|
1259
|
-
totalPluginsToLoad: Signal<number>;
|
1260
|
-
};
|
1261
|
-
type ReportingState = {
|
1262
|
-
isErrorReportingEnabled: Signal<boolean>;
|
1263
|
-
isMetricsReportingEnabled: Signal<boolean>;
|
1264
|
-
errorReportingProviderPluginName: Signal<PluginName | undefined>;
|
1265
|
-
isErrorReportingPluginLoaded: Signal<boolean>;
|
1266
|
-
};
|
1267
|
-
type SessionState = {
|
1268
|
-
readonly userId: Signal<Nullable<string> | undefined>;
|
1269
|
-
readonly userTraits: Signal<Nullable<ApiObject> | undefined>;
|
1270
|
-
readonly anonymousId: Signal<string | undefined>;
|
1271
|
-
readonly groupId: Signal<Nullable<string> | undefined>;
|
1272
|
-
readonly groupTraits: Signal<Nullable<ApiObject> | undefined>;
|
1273
|
-
readonly initialReferrer: Signal<string | undefined>;
|
1274
|
-
readonly initialReferringDomain: Signal<string | undefined>;
|
1275
|
-
readonly sessionInfo: Signal<SessionInfo>;
|
1276
|
-
readonly authToken: Signal<Nullable<string>>;
|
1277
|
-
};
|
1278
|
-
type SourceConfigState = Signal<Source | undefined>;
|
1279
|
-
type StorageEntry = {
|
1280
|
-
type: StorageType;
|
1281
|
-
key: string;
|
1282
|
-
};
|
1283
|
-
type StorageEntries = {
|
1284
|
-
[key in UserSessionKey]?: StorageEntry;
|
1285
|
-
};
|
1286
|
-
type StorageState = {
|
1287
|
-
encryptionPluginName: Signal<PluginName | undefined>;
|
1288
|
-
migrate: Signal<boolean>;
|
1289
|
-
type: Signal<StorageType | undefined>;
|
1290
|
-
cookie: Signal<CookieOptions | undefined>;
|
1291
|
-
entries: Signal<StorageEntries>;
|
1292
|
-
trulyAnonymousTracking: Signal<boolean>;
|
1293
|
-
};
|
1294
|
-
interface ApplicationState {
|
1295
|
-
capabilities: CapabilitiesState;
|
1296
|
-
consents: ConsentsState;
|
1297
|
-
context: ContextState;
|
1298
|
-
eventBuffer: EventBufferState;
|
1299
|
-
lifecycle: LifecycleState;
|
1300
|
-
loadOptions: LoadOptionsState;
|
1301
|
-
metrics: MetricsState;
|
1302
|
-
nativeDestinations: NativeDestinationsState;
|
1303
|
-
plugins: PluginsState;
|
1304
|
-
reporting: ReportingState;
|
1305
|
-
session: SessionState;
|
1306
|
-
source: SourceConfigState;
|
1307
|
-
storage: StorageState;
|
1308
|
-
}
|
1309
|
-
|
1310
|
-
/**
|
1311
|
-
* Exposed values that can be accessed as global objects per analytics instance
|
1312
|
-
* TODO: find all values that need to be exposed in globals if anything else
|
1313
|
-
*/
|
1314
|
-
type ExposedGlobals = {
|
1315
|
-
state?: ApplicationState;
|
1316
|
-
preloadedEventsBuffer?: PreloadedEventCall[];
|
1317
|
-
pluginsCDNPath?: string;
|
1318
|
-
[key: string]: any;
|
1319
|
-
};
|
1320
|
-
/**
|
1321
|
-
* Exposing all globally accessible values for all analytics instances
|
1322
|
-
* As key, we use the value of writeKey assigned to analytics instance that the values belong to
|
1323
|
-
*/
|
1324
|
-
interface IRudderStackGlobals {
|
1325
|
-
[key: string]: ExposedGlobals;
|
1326
|
-
}
|
1327
|
-
|
1328
1018
|
declare global {
|
1329
1019
|
interface Window {
|
1330
1020
|
rudderanalytics: RudderAnalytics | RudderAnalyticsPreloader | undefined;
|
1331
|
-
RudderStackGlobals: IRudderStackGlobals;
|
1332
|
-
rudderAnalyticsMount: () => void;
|
1333
|
-
rudderAnalyticsBuildType: 'legacy' | 'modern';
|
1334
1021
|
}
|
1335
1022
|
}
|
1336
1023
|
//# sourceMappingURL=index.d.ts.map
|
1337
1024
|
|
1338
|
-
export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type ConsentOptions, type CookieSameSite, type DestinationsQueueOpts, type
|
1025
|
+
export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type ConsentOptions, type CookieSameSite, type DestinationsQueueOpts, type IdentifyTraits, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, type ResidencyServerRegion, RudderAnalytics, type RudderAnalyticsPreloader, type SessionOpts, type UaChTrackLevel };
|