@rudderstack/analytics-js 3.0.0-beta.13 → 3.0.0-beta.14
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/dist/npm/index.d.ts +52 -16
- package/dist/npm/legacy/cjs/index.js +163 -121
- package/dist/npm/legacy/esm/index.js +163 -121
- package/dist/npm/legacy/umd/index.js +163 -121
- package/dist/npm/modern/bundled/cjs/index.js +157 -115
- package/dist/npm/modern/bundled/esm/index.js +157 -115
- package/dist/npm/modern/bundled/umd/index.js +157 -115
- package/dist/npm/modern/cjs/index.js +115 -84
- package/dist/npm/modern/esm/index.js +115 -84
- package/dist/npm/modern/umd/index.js +115 -84
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,24 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [3.0.0-beta.14](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.0-beta.13...@rudderstack/analytics-js@3.0.0-beta.14) (2023-10-27)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* alter life cycle for pre consent ([#1411](https://github.com/rudderlabs/rudder-sdk-js/issues/1411)) ([60ec092](https://github.com/rudderlabs/rudder-sdk-js/commit/60ec0924a1229678fb16d76a34a494c40a622a11))
|
11
|
+
* auto capture timezone as a part of context ([#1464](https://github.com/rudderlabs/rudder-sdk-js/issues/1464)) ([8e66069](https://github.com/rudderlabs/rudder-sdk-js/commit/8e660693d75727d2131a57ca57859e6d0b920e84))
|
12
|
+
* configure cookie to be fetched from exact domain ([#1468](https://github.com/rudderlabs/rudder-sdk-js/issues/1468)) ([4db1b10](https://github.com/rudderlabs/rudder-sdk-js/commit/4db1b10b45b4ffcd652aec6bd684943ca35c6c08))
|
13
|
+
* consent api ([#1458](https://github.com/rudderlabs/rudder-sdk-js/issues/1458)) ([216b405](https://github.com/rudderlabs/rudder-sdk-js/commit/216b405f7c319d5ff2d799d2e3a5efe2ee4a03af))
|
14
|
+
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
* **analytics-js:** correct declared global extended type ([#1460](https://github.com/rudderlabs/rudder-sdk-js/issues/1460)) ([3f15290](https://github.com/rudderlabs/rudder-sdk-js/commit/3f1529037ba0541391b5f8033e37f867fdd7931c))
|
19
|
+
* **analytics-js:** fix remote import error when npm package is bundled with webpack ([#1466](https://github.com/rudderlabs/rudder-sdk-js/issues/1466)) ([3a818ac](https://github.com/rudderlabs/rudder-sdk-js/commit/3a818accd24e6b3667c75a6b60fb12aba36bdf7e))
|
20
|
+
* **monorepo:** update vulnerable dependencies ([#1457](https://github.com/rudderlabs/rudder-sdk-js/issues/1457)) ([7a4bc4c](https://github.com/rudderlabs/rudder-sdk-js/commit/7a4bc4cc641e4fff2a8f561ce6fd67d16c0cd5a0))
|
21
|
+
* upgrade vulnerable cryptoJS dependency, rolup to v4 & NX to v17 ([#1471](https://github.com/rudderlabs/rudder-sdk-js/issues/1471)) ([b2bb21c](https://github.com/rudderlabs/rudder-sdk-js/commit/b2bb21cb3f618f6c86f593d1706abe9e6349066d))
|
22
|
+
|
5
23
|
## [3.0.0-beta.13](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.0-beta.12...@rudderstack/analytics-js@3.0.0-beta.13) (2023-10-16)
|
6
24
|
|
7
25
|
|
package/dist/npm/index.d.ts
CHANGED
@@ -139,20 +139,22 @@ interface IPluginsManager {
|
|
139
139
|
invokeSingle<T = any>(extPoint?: string, ...args: any[]): Nullable<T>;
|
140
140
|
register(plugins: ExtensionPlugin[]): void;
|
141
141
|
}
|
142
|
-
type PluginName = 'BeaconQueue' | 'Bugsnag' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ErrorReporting' | 'ExternalAnonymousId' | 'GoogleLinker' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
142
|
+
type PluginName = 'BeaconQueue' | 'Bugsnag' | 'CustomConsentManager' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ErrorReporting' | 'ExternalAnonymousId' | 'GoogleLinker' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
143
143
|
|
144
144
|
type OneTrustCookieCategory = {
|
145
145
|
oneTrustCookieCategory: string;
|
146
146
|
};
|
147
|
-
type
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
type ConsentProvider = 'oneTrust' | 'ketch' | 'custom';
|
148
|
+
type Consents = Record<string, string> | string[];
|
149
|
+
type ConsentManagementOptions = {
|
150
|
+
enabled: boolean;
|
151
|
+
provider: ConsentProvider;
|
152
|
+
allowedConsentIds?: Consents;
|
153
|
+
deniedConsentIds?: Consents;
|
151
154
|
};
|
152
|
-
type
|
153
|
-
|
154
|
-
|
155
|
-
deniedConsentIds?: string[];
|
155
|
+
type ConsentsInfo = {
|
156
|
+
allowedConsentIds?: Consents;
|
157
|
+
deniedConsentIds?: Consents;
|
156
158
|
};
|
157
159
|
type KetchConsentPurpose = {
|
158
160
|
purpose: string;
|
@@ -255,7 +257,6 @@ type PreConsentOptions = {
|
|
255
257
|
enabled: boolean;
|
256
258
|
storage?: PreConsentStorageOptions;
|
257
259
|
events?: PreConsentEventsOptions;
|
258
|
-
trackConsent?: boolean;
|
259
260
|
};
|
260
261
|
/**
|
261
262
|
* Represents the options parameter in the load API
|
@@ -273,7 +274,6 @@ type LoadOptions = {
|
|
273
274
|
useBeacon?: boolean;
|
274
275
|
beaconQueueOptions?: BeaconQueueOpts;
|
275
276
|
destinationsQueueOptions?: DestinationsQueueOpts;
|
276
|
-
cookieConsentManager?: CookieConsentOptions;
|
277
277
|
anonymousIdOptions?: AnonymousIdOptions;
|
278
278
|
setCookieDomain?: string;
|
279
279
|
sameSiteCookie: CookieSameSite;
|
@@ -293,6 +293,16 @@ type LoadOptions = {
|
|
293
293
|
storage?: StorageOpts;
|
294
294
|
preConsent?: PreConsentOptions;
|
295
295
|
transportMode?: EventsTransportMode;
|
296
|
+
consentManagement?: ConsentManagementOptions;
|
297
|
+
sameDomainCookiesOnly?: boolean;
|
298
|
+
};
|
299
|
+
type ConsentOptions = {
|
300
|
+
storage?: StorageOpts;
|
301
|
+
consentManagement?: ConsentManagementOptions;
|
302
|
+
integrations?: IntegrationOpts;
|
303
|
+
discardPreConsentEvents?: boolean;
|
304
|
+
sendPageEvent?: boolean;
|
305
|
+
trackConsent?: boolean;
|
296
306
|
};
|
297
307
|
|
298
308
|
type Address = {
|
@@ -500,10 +510,20 @@ interface IRudderAnalytics<T = any> {
|
|
500
510
|
* To manually end user session in the SDK
|
501
511
|
*/
|
502
512
|
endSession(): void;
|
513
|
+
/**
|
514
|
+
* To set authorization token
|
515
|
+
* @param token token value
|
516
|
+
*/
|
517
|
+
setAuthToken(token: string): void;
|
503
518
|
/**
|
504
519
|
* To fetch the current sessionId
|
505
520
|
*/
|
506
521
|
getSessionId(): Nullable<number>;
|
522
|
+
/**
|
523
|
+
* To provide consent
|
524
|
+
* @param options Consent API options
|
525
|
+
*/
|
526
|
+
consent(options?: ConsentOptions): void;
|
507
527
|
}
|
508
528
|
|
509
529
|
interface IExternalSourceLoadConfig {
|
@@ -591,7 +611,7 @@ interface IStoreManager {
|
|
591
611
|
errorHandler?: IErrorHandler;
|
592
612
|
logger?: ILogger;
|
593
613
|
init(): void;
|
594
|
-
|
614
|
+
initClientDataStores(): void;
|
595
615
|
setStore(storeConfig: IStoreConfig): IStore;
|
596
616
|
getStore(id: StoreId): IStore | undefined;
|
597
617
|
}
|
@@ -628,6 +648,7 @@ interface ICookieStorageOptions extends CookieOptions {
|
|
628
648
|
domain?: string;
|
629
649
|
secure?: boolean;
|
630
650
|
enabled?: boolean;
|
651
|
+
sameDomainCookiesOnly?: boolean;
|
631
652
|
}
|
632
653
|
interface ILocalStorageOptions {
|
633
654
|
enabled?: boolean;
|
@@ -746,6 +767,7 @@ interface IUserSessionManager {
|
|
746
767
|
reset(resetAnonymousId?: boolean, noNewSessionStart?: boolean): void;
|
747
768
|
start(sessionId?: number): void;
|
748
769
|
end(): void;
|
770
|
+
syncStorageDataToState(): void;
|
749
771
|
setAuthToken(token: string): void;
|
750
772
|
}
|
751
773
|
|
@@ -843,6 +865,7 @@ interface IConfigManager {
|
|
843
865
|
interface IEventManager {
|
844
866
|
init(): void;
|
845
867
|
addEvent(event: APIEvent): void;
|
868
|
+
resume(): void;
|
846
869
|
}
|
847
870
|
|
848
871
|
interface ICapabilitiesManager {
|
@@ -857,6 +880,9 @@ interface ICapabilitiesManager {
|
|
857
880
|
}
|
858
881
|
|
859
882
|
type PreloadedEventCall = Array<string | any>;
|
883
|
+
type RudderAnalyticsPreloader = {
|
884
|
+
[index: string]: (...args: number[]) => any;
|
885
|
+
};
|
860
886
|
|
861
887
|
/**
|
862
888
|
* A buffer queue to serve as a store for any type of data
|
@@ -1007,6 +1033,11 @@ interface IAnalytics {
|
|
1007
1033
|
* To fetch the current sessionId
|
1008
1034
|
*/
|
1009
1035
|
getSessionId(): Nullable<number>;
|
1036
|
+
/**
|
1037
|
+
* To record consent
|
1038
|
+
* @param options Consent API options
|
1039
|
+
*/
|
1040
|
+
consent(options?: ConsentOptions): void;
|
1010
1041
|
/**
|
1011
1042
|
* To set auth token
|
1012
1043
|
*/
|
@@ -1076,6 +1107,7 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
1076
1107
|
endSession(): void;
|
1077
1108
|
getSessionId(): Nullable<number>;
|
1078
1109
|
setAuthToken(token: string): void;
|
1110
|
+
consent(options?: ConsentOptions): void;
|
1079
1111
|
}
|
1080
1112
|
//# sourceMappingURL=RudderAnalytics.d.ts.map
|
1081
1113
|
|
@@ -1126,9 +1158,12 @@ type CapabilitiesState = {
|
|
1126
1158
|
isAdBlocked: Signal<boolean>;
|
1127
1159
|
};
|
1128
1160
|
type ConsentsState = {
|
1129
|
-
|
1161
|
+
enabled: Signal<boolean>;
|
1162
|
+
data: Signal<ConsentsInfo>;
|
1163
|
+
initialized: Signal<boolean>;
|
1130
1164
|
activeConsentManagerPluginName: Signal<PluginName | undefined>;
|
1131
|
-
|
1165
|
+
preConsent: Signal<PreConsentOptions>;
|
1166
|
+
postConsent: Signal<ConsentOptions>;
|
1132
1167
|
};
|
1133
1168
|
type ContextState = {
|
1134
1169
|
app: Signal<AppInfo>;
|
@@ -1141,6 +1176,7 @@ type ContextState = {
|
|
1141
1176
|
locale: Signal<Nullable<string>>;
|
1142
1177
|
screen: Signal<ScreenInfo>;
|
1143
1178
|
'ua-ch': Signal<UADataValues | undefined>;
|
1179
|
+
timezone: Signal<string | undefined>;
|
1144
1180
|
};
|
1145
1181
|
type EventBufferState = {
|
1146
1182
|
toBeProcessedArray: Signal<BufferedEvent[]>;
|
@@ -1253,7 +1289,7 @@ interface IRudderStackGlobals {
|
|
1253
1289
|
|
1254
1290
|
declare global {
|
1255
1291
|
interface Window {
|
1256
|
-
rudderanalytics: RudderAnalytics | PreloadedEventCall[];
|
1292
|
+
rudderanalytics: RudderAnalytics | PreloadedEventCall[] | RudderAnalyticsPreloader;
|
1257
1293
|
RudderStackGlobals: IRudderStackGlobals;
|
1258
1294
|
rudderAnalyticsMount: () => void;
|
1259
1295
|
rudderAnalyticsBuildType: 'legacy' | 'modern';
|
@@ -1261,4 +1297,4 @@ declare global {
|
|
1261
1297
|
}
|
1262
1298
|
//# sourceMappingURL=index.d.ts.map
|
1263
1299
|
|
1264
|
-
export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type CookieSameSite, type DestinationsQueueOpts, type IRudderStackGlobals, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, type ResidencyServerRegion, RudderAnalytics, type SessionOpts, type UaChTrackLevel };
|
1300
|
+
export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type ConsentOptions, type CookieSameSite, type DestinationsQueueOpts, type IRudderStackGlobals, type IdentifyTraits, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, type ResidencyServerRegion, RudderAnalytics, type RudderAnalyticsPreloader, type SessionOpts, type UaChTrackLevel };
|