@aws-amplify/analytics 5.2.25-unstable.2 → 5.2.25
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 +8 -0
- package/package.json +4 -4
- package/lib/Analytics.d.ts +0 -96
- package/lib/Providers/AWSKinesisFirehoseProvider.d.ts +0 -16
- package/lib/Providers/AWSKinesisProvider.d.ts +0 -47
- package/lib/Providers/AWSPinpointProvider.d.ts +0 -74
- package/lib/Providers/AmazonPersonalizeHelper/DataType.d.ts +0 -40
- package/lib/Providers/AmazonPersonalizeHelper/MediaAutoTrack.d.ts +0 -20
- package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.d.ts +0 -17
- package/lib/Providers/AmazonPersonalizeHelper/index.d.ts +0 -3
- package/lib/Providers/AmazonPersonalizeProvider.d.ts +0 -80
- package/lib/Providers/EventBuffer.d.ts +0 -30
- package/lib/Providers/index.d.ts +0 -4
- package/lib/index.d.ts +0 -8
- package/lib/setupTests.d.ts +0 -1
- package/lib/trackers/EventTracker.d.ts +0 -13
- package/lib/trackers/PageViewTracker.d.ts +0 -16
- package/lib/trackers/SessionTracker-rn.d.ts +0 -16
- package/lib/trackers/SessionTracker.d.ts +0 -18
- package/lib/trackers/index.d.ts +0 -3
- package/lib/trackers/reactnative.d.ts +0 -8
- package/lib/types/Analytics.d.ts +0 -66
- package/lib/types/Provider.d.ts +0 -10
- package/lib/types/Providers/AWSKinesisProvider.d.ts +0 -5
- package/lib/types/Providers/AWSPinpointProvider.d.ts +0 -50
- package/lib/types/Providers/AmazonPersonalizeProvider.d.ts +0 -7
- package/lib/types/Providers/index.d.ts +0 -1
- package/lib/types/index.d.ts +0 -3
- package/lib/utils/AppUtils.d.ts +0 -2
- package/lib/utils/AppUtils.native.d.ts +0 -2
- package/lib/utils/MethodEmbed.d.ts +0 -15
- package/lib/vendor/dom-utils/closest.d.ts +0 -12
- package/lib/vendor/dom-utils/delegate.d.ts +0 -18
- package/lib/vendor/dom-utils/dispatch.d.ts +0 -17
- package/lib/vendor/dom-utils/get-attributes.d.ts +0 -11
- package/lib/vendor/dom-utils/index.d.ts +0 -7
- package/lib/vendor/dom-utils/matches.d.ts +0 -11
- package/lib/vendor/dom-utils/parents.d.ts +0 -10
- package/lib/vendor/dom-utils/parse-url.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.2.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@5.2.24...@aws-amplify/analytics@5.2.25) (2022-10-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/analytics
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [5.2.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@5.2.23...@aws-amplify/analytics@5.2.24) (2022-10-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-amplify/analytics
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/analytics",
|
|
3
|
-
"version": "5.2.25
|
|
3
|
+
"version": "5.2.25",
|
|
4
4
|
"description": "Analytics category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://aws-amplify.github.io/",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aws-amplify/cache": "4.0.60
|
|
47
|
-
"@aws-amplify/core": "4.7.9
|
|
46
|
+
"@aws-amplify/cache": "4.0.60",
|
|
47
|
+
"@aws-amplify/core": "4.7.9",
|
|
48
48
|
"@aws-sdk/client-firehose": "3.6.1",
|
|
49
49
|
"@aws-sdk/client-kinesis": "3.6.1",
|
|
50
50
|
"@aws-sdk/client-personalize-events": "3.6.1",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"<rootDir>/src/setupTests.ts"
|
|
102
102
|
]
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "be5bf2dc68c9c011c3876f003c14bc98b392c82d"
|
|
105
105
|
}
|
package/lib/Analytics.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { AnalyticsProvider, EventAttributes, EventMetrics, AnalyticsEvent, AutoTrackSessionOpts, AutoTrackPageViewOpts, AutoTrackEventOpts, PersonalizeAnalyticsEvent, KinesisAnalyticsEvent } from './types';
|
|
2
|
-
import { PageViewTracker, EventTracker, SessionTracker } from './trackers';
|
|
3
|
-
declare const trackers: {
|
|
4
|
-
pageView: typeof PageViewTracker;
|
|
5
|
-
event: typeof EventTracker;
|
|
6
|
-
session: typeof SessionTracker;
|
|
7
|
-
};
|
|
8
|
-
declare type TrackerTypes = keyof typeof trackers;
|
|
9
|
-
/**
|
|
10
|
-
* Provide mobile analytics client functions
|
|
11
|
-
*/
|
|
12
|
-
export declare class AnalyticsClass {
|
|
13
|
-
private _config;
|
|
14
|
-
private _pluggables;
|
|
15
|
-
private _disabled;
|
|
16
|
-
private _trackers;
|
|
17
|
-
/**
|
|
18
|
-
* Initialize Analtyics
|
|
19
|
-
* @param config - Configuration of the Analytics
|
|
20
|
-
*/
|
|
21
|
-
constructor();
|
|
22
|
-
getModuleName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* configure Analytics
|
|
25
|
-
* @param {Object} config - Configuration of the Analytics
|
|
26
|
-
*/
|
|
27
|
-
configure(config?: any): any;
|
|
28
|
-
/**
|
|
29
|
-
* add plugin into Analytics category
|
|
30
|
-
* @param pluggable - an instance of the plugin
|
|
31
|
-
*/
|
|
32
|
-
addPluggable(pluggable: AnalyticsProvider): any;
|
|
33
|
-
/**
|
|
34
|
-
* Get the plugin object
|
|
35
|
-
* @param providerName - the name of the provider to be removed
|
|
36
|
-
*/
|
|
37
|
-
getPluggable(providerName: string): AnalyticsProvider;
|
|
38
|
-
/**
|
|
39
|
-
* Remove the plugin object
|
|
40
|
-
* @param providerName - the name of the provider to be removed
|
|
41
|
-
*/
|
|
42
|
-
removePluggable(providerName: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* stop sending events
|
|
45
|
-
*/
|
|
46
|
-
disable(): void;
|
|
47
|
-
/**
|
|
48
|
-
* start sending events
|
|
49
|
-
*/
|
|
50
|
-
enable(): void;
|
|
51
|
-
/**
|
|
52
|
-
* Record Session start
|
|
53
|
-
* @param [provider] - name of the provider.
|
|
54
|
-
* @return - A promise which resolves if buffer doesn't overflow
|
|
55
|
-
*/
|
|
56
|
-
startSession(provider?: string): Promise<unknown>;
|
|
57
|
-
/**
|
|
58
|
-
* Record Session stop
|
|
59
|
-
* @param [provider] - name of the provider.
|
|
60
|
-
* @return - A promise which resolves if buffer doesn't overflow
|
|
61
|
-
*/
|
|
62
|
-
stopSession(provider?: string): Promise<unknown>;
|
|
63
|
-
/**
|
|
64
|
-
* Record one analytic event and send it to Pinpoint
|
|
65
|
-
* @param event - An object with the name of the event, attributes of the event and event metrics.
|
|
66
|
-
* @param [provider] - name of the provider.
|
|
67
|
-
*/
|
|
68
|
-
record(event: AnalyticsEvent | PersonalizeAnalyticsEvent | KinesisAnalyticsEvent, provider?: string): any;
|
|
69
|
-
/**
|
|
70
|
-
* Record one analytic event and send it to Pinpoint
|
|
71
|
-
* @deprecated Use the new syntax and pass in the event as an object instead.
|
|
72
|
-
* @param eventName - The name of the event
|
|
73
|
-
* @param [attributes] - Attributes of the event
|
|
74
|
-
* @param [metrics] - Event metrics
|
|
75
|
-
* @return - A promise which resolves if buffer doesn't overflow
|
|
76
|
-
*/
|
|
77
|
-
record(eventName: string, attributes?: EventAttributes, metrics?: EventMetrics): any;
|
|
78
|
-
updateEndpoint(attrs: {
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
}, provider?: string): Promise<any>;
|
|
81
|
-
private _sendEvent;
|
|
82
|
-
/**
|
|
83
|
-
* Enable or disable auto tracking
|
|
84
|
-
* @param trackerType - The type of tracker to activate.
|
|
85
|
-
* @param [opts] - Auto tracking options.
|
|
86
|
-
*/
|
|
87
|
-
autoTrack(trackerType: 'session', opts: AutoTrackSessionOpts): any;
|
|
88
|
-
autoTrack(trackerType: 'pageView', opts: AutoTrackPageViewOpts): any;
|
|
89
|
-
autoTrack(trackerType: 'event', opts: AutoTrackEventOpts): any;
|
|
90
|
-
autoTrack(trackerType: TrackerTypes, opts: {
|
|
91
|
-
provider: string;
|
|
92
|
-
[key: string]: any;
|
|
93
|
-
}): any;
|
|
94
|
-
}
|
|
95
|
-
export declare const Analytics: AnalyticsClass;
|
|
96
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AWSKinesisProvider } from './AWSKinesisProvider';
|
|
2
|
-
export declare class AWSKinesisFirehoseProvider extends AWSKinesisProvider {
|
|
3
|
-
private _kinesisFirehose;
|
|
4
|
-
constructor(config?: any);
|
|
5
|
-
/**
|
|
6
|
-
* get provider name of the plugin
|
|
7
|
-
*/
|
|
8
|
-
getProviderName(): string;
|
|
9
|
-
protected _sendEvents(group: any): boolean;
|
|
10
|
-
protected _init(config: any, credentials: any): boolean;
|
|
11
|
-
private _initFirehose;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use named import
|
|
15
|
-
*/
|
|
16
|
-
export default AWSKinesisFirehoseProvider;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { AnalyticsProvider } from '../types';
|
|
2
|
-
export declare class AWSKinesisProvider implements AnalyticsProvider {
|
|
3
|
-
protected _config: any;
|
|
4
|
-
private _kinesis;
|
|
5
|
-
private _buffer;
|
|
6
|
-
private _timer;
|
|
7
|
-
constructor(config?: any);
|
|
8
|
-
private _setupTimer;
|
|
9
|
-
/**
|
|
10
|
-
* get the category of the plugin
|
|
11
|
-
*/
|
|
12
|
-
getCategory(): string;
|
|
13
|
-
/**
|
|
14
|
-
* get provider name of the plugin
|
|
15
|
-
*/
|
|
16
|
-
getProviderName(): string;
|
|
17
|
-
/**
|
|
18
|
-
* configure the plugin
|
|
19
|
-
* @param {Object} config - configuration
|
|
20
|
-
*/
|
|
21
|
-
configure(config: any): object;
|
|
22
|
-
/**
|
|
23
|
-
* record an event
|
|
24
|
-
* @param {Object} params - the params of an event
|
|
25
|
-
*/
|
|
26
|
-
record(params: any): Promise<boolean>;
|
|
27
|
-
updateEndpoint(): Promise<boolean>;
|
|
28
|
-
/**
|
|
29
|
-
* @private
|
|
30
|
-
* @param params - params for the event recording
|
|
31
|
-
* Put events into buffer
|
|
32
|
-
*/
|
|
33
|
-
private _putToBuffer;
|
|
34
|
-
private _sendFromBuffer;
|
|
35
|
-
protected _sendEvents(group: any): boolean;
|
|
36
|
-
protected _init(config: any, credentials: any): boolean;
|
|
37
|
-
private _initKinesis;
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
* check if current credentials exists
|
|
41
|
-
*/
|
|
42
|
-
private _getCredentials;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated use named import
|
|
46
|
-
*/
|
|
47
|
-
export default AWSKinesisProvider;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { AnalyticsProvider, PromiseHandlers, EventParams } from '../types';
|
|
2
|
-
export declare class AWSPinpointProvider implements AnalyticsProvider {
|
|
3
|
-
static category: string;
|
|
4
|
-
static providerName: string;
|
|
5
|
-
private _config;
|
|
6
|
-
private pinpointClient;
|
|
7
|
-
private _sessionId;
|
|
8
|
-
private _sessionStartTimestamp;
|
|
9
|
-
private _buffer;
|
|
10
|
-
private _endpointBuffer;
|
|
11
|
-
private _clientInfo;
|
|
12
|
-
private _endpointGenerating;
|
|
13
|
-
private _endpointUpdateInProgress;
|
|
14
|
-
constructor(config?: any);
|
|
15
|
-
/**
|
|
16
|
-
* get the category of the plugin
|
|
17
|
-
*/
|
|
18
|
-
getCategory(): string;
|
|
19
|
-
/**
|
|
20
|
-
* get provider name of the plugin
|
|
21
|
-
*/
|
|
22
|
-
getProviderName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* configure the plugin
|
|
25
|
-
* @param {Object} config - configuration
|
|
26
|
-
*/
|
|
27
|
-
configure(config: any): object;
|
|
28
|
-
/**
|
|
29
|
-
* record an event
|
|
30
|
-
* @param {Object} params - the params of an event
|
|
31
|
-
*/
|
|
32
|
-
record(params: EventParams, handlers: PromiseHandlers): Promise<any>;
|
|
33
|
-
private _sendEndpointUpdate;
|
|
34
|
-
/**
|
|
35
|
-
* @private
|
|
36
|
-
* @param params - params for event recording
|
|
37
|
-
* Put events into buffer
|
|
38
|
-
*/
|
|
39
|
-
private _putToBuffer;
|
|
40
|
-
private _generateSession;
|
|
41
|
-
private _send;
|
|
42
|
-
private _generateBatchItemContext;
|
|
43
|
-
private _pinpointPutEvents;
|
|
44
|
-
private _pinpointSendStopSession;
|
|
45
|
-
private _retry;
|
|
46
|
-
private _updateEndpoint;
|
|
47
|
-
private _handleEndpointUpdateFailure;
|
|
48
|
-
private _handleEndpointUpdateForbidden;
|
|
49
|
-
private _retryEndpointUpdate;
|
|
50
|
-
/**
|
|
51
|
-
* @private
|
|
52
|
-
* @param config
|
|
53
|
-
* Init the clients
|
|
54
|
-
*/
|
|
55
|
-
private _initClients;
|
|
56
|
-
private _bufferExists;
|
|
57
|
-
private _initBuffer;
|
|
58
|
-
private _updateBufferClient;
|
|
59
|
-
private _flushBuffer;
|
|
60
|
-
private _resumeBuffer;
|
|
61
|
-
private _customizePinpointClientReq;
|
|
62
|
-
private _getEndpointId;
|
|
63
|
-
/**
|
|
64
|
-
* EndPoint request
|
|
65
|
-
* @return {Object} - The request of updating endpoint
|
|
66
|
-
*/
|
|
67
|
-
private _endpointRequest;
|
|
68
|
-
private _eventError;
|
|
69
|
-
private _getCredentials;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @deprecated use named import
|
|
73
|
-
*/
|
|
74
|
-
export default AWSPinpointProvider;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ICredentials } from '@aws-amplify/core';
|
|
2
|
-
interface BasePayload {
|
|
3
|
-
userId: string;
|
|
4
|
-
trackingId: string;
|
|
5
|
-
sessionId: string;
|
|
6
|
-
}
|
|
7
|
-
declare type Config = {
|
|
8
|
-
[key: string]: string | number;
|
|
9
|
-
};
|
|
10
|
-
declare type Properties = {
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
export interface RequestParams {
|
|
14
|
-
eventData: EventData;
|
|
15
|
-
sessionInfo: SessionInfo;
|
|
16
|
-
config: Config;
|
|
17
|
-
sentAt: number;
|
|
18
|
-
credentials: ICredentials;
|
|
19
|
-
}
|
|
20
|
-
export interface EventData {
|
|
21
|
-
eventType: string;
|
|
22
|
-
properties: Properties;
|
|
23
|
-
}
|
|
24
|
-
export interface SessionInfo {
|
|
25
|
-
userId: string;
|
|
26
|
-
trackingId: string;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
}
|
|
29
|
-
export interface RecordEventPayload {
|
|
30
|
-
eventId: string;
|
|
31
|
-
eventType: string;
|
|
32
|
-
sentAt: number;
|
|
33
|
-
properties?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface RecordEventListPayload extends BasePayload {
|
|
36
|
-
eventList: RecordEventPayload[];
|
|
37
|
-
config?: Config;
|
|
38
|
-
credentials?: ICredentials;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RequestParams } from './DataType';
|
|
2
|
-
export declare class MediaAutoTrack {
|
|
3
|
-
private _mediaElement;
|
|
4
|
-
private _provider;
|
|
5
|
-
private _params;
|
|
6
|
-
private _started;
|
|
7
|
-
private _iframePlayer;
|
|
8
|
-
private eventActionMapping;
|
|
9
|
-
private _youTubeIframeLoader;
|
|
10
|
-
constructor(params: RequestParams, provider: any);
|
|
11
|
-
private _initYoutubeFrame;
|
|
12
|
-
private _iframeMediaTracker;
|
|
13
|
-
private _onPlayerStateChange;
|
|
14
|
-
private _html5MediaTracker;
|
|
15
|
-
private playEventAction;
|
|
16
|
-
private pauseEventAction;
|
|
17
|
-
private endedEventAction;
|
|
18
|
-
private recordEvent;
|
|
19
|
-
private _financial;
|
|
20
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SessionInfo } from './DataType';
|
|
2
|
-
export declare class SessionInfoManager {
|
|
3
|
-
private _isBrowser;
|
|
4
|
-
private _cache;
|
|
5
|
-
private _timer;
|
|
6
|
-
private _timerKey;
|
|
7
|
-
constructor(prefixKey?: string);
|
|
8
|
-
private _refreshTimer;
|
|
9
|
-
private storeValue;
|
|
10
|
-
private retrieveValue;
|
|
11
|
-
private _getCachePrefix;
|
|
12
|
-
getTimerKey(): any;
|
|
13
|
-
updateSessionInfo(userId: string, sessionInfo: SessionInfo): void;
|
|
14
|
-
private _isRequireUpdateSessionInfo;
|
|
15
|
-
retrieveSessionInfo(trackingId: string): SessionInfo;
|
|
16
|
-
private _isRequireNewSession;
|
|
17
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { AnalyticsProvider } from '../types';
|
|
2
|
-
export declare class AmazonPersonalizeProvider implements AnalyticsProvider {
|
|
3
|
-
private _config;
|
|
4
|
-
private _personalize;
|
|
5
|
-
private _buffer;
|
|
6
|
-
private _timer;
|
|
7
|
-
private _sessionInfo;
|
|
8
|
-
private _sessionManager;
|
|
9
|
-
private _isBrowser;
|
|
10
|
-
constructor(config?: any);
|
|
11
|
-
private _setupTimer;
|
|
12
|
-
/**
|
|
13
|
-
* Record event
|
|
14
|
-
* @param eventType - type of the event action. e.g. "Click"
|
|
15
|
-
* @param properties - properties of the event
|
|
16
|
-
* @return Promise
|
|
17
|
-
*/
|
|
18
|
-
record(params: any): Promise<boolean>;
|
|
19
|
-
private loadElement;
|
|
20
|
-
private isElementFullyLoaded;
|
|
21
|
-
/**
|
|
22
|
-
* get the category of the plugin
|
|
23
|
-
*/
|
|
24
|
-
getCategory(): string;
|
|
25
|
-
/**
|
|
26
|
-
* get provider name of the plugin
|
|
27
|
-
*/
|
|
28
|
-
getProviderName(): string;
|
|
29
|
-
/**
|
|
30
|
-
* configure the plugin
|
|
31
|
-
* @param {Object} config - configuration
|
|
32
|
-
*/
|
|
33
|
-
configure(config: any): object;
|
|
34
|
-
/**
|
|
35
|
-
* Generate the requestParams from customer input params and sessionInfo
|
|
36
|
-
* @private
|
|
37
|
-
* @param eventData - customer input for event data
|
|
38
|
-
* @param api - api name
|
|
39
|
-
* @return RequestParams - wrapper object with all information required for make request
|
|
40
|
-
*/
|
|
41
|
-
private generateRequestParams;
|
|
42
|
-
/**
|
|
43
|
-
* record an event
|
|
44
|
-
* @param {Object} params - the params of an event
|
|
45
|
-
*/
|
|
46
|
-
private _sendEvents;
|
|
47
|
-
/**
|
|
48
|
-
* Put event into buffer
|
|
49
|
-
* @private
|
|
50
|
-
* @param params - params for the event recording
|
|
51
|
-
*/
|
|
52
|
-
private putToBuffer;
|
|
53
|
-
/**
|
|
54
|
-
* flush the buffer and batch sending the request
|
|
55
|
-
* @private
|
|
56
|
-
* @param eventsParams - the buffer for cache the payload
|
|
57
|
-
*/
|
|
58
|
-
private _sendFromBuffer;
|
|
59
|
-
/**
|
|
60
|
-
* Generate the record payload for single event
|
|
61
|
-
* @private
|
|
62
|
-
* @param params - RequestParams
|
|
63
|
-
*/
|
|
64
|
-
private _generateSingleRecordPayload;
|
|
65
|
-
/**
|
|
66
|
-
* Initialize the personalize client
|
|
67
|
-
* @private
|
|
68
|
-
* @param params - RequestParams
|
|
69
|
-
*/
|
|
70
|
-
private _init;
|
|
71
|
-
/**
|
|
72
|
-
* check if current credentials exists
|
|
73
|
-
* @private
|
|
74
|
-
*/
|
|
75
|
-
private _getCredentials;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @deprecated use named import
|
|
79
|
-
*/
|
|
80
|
-
export default AmazonPersonalizeProvider;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { EventObject } from '../types';
|
|
2
|
-
declare type EventsBufferConfig = {
|
|
3
|
-
bufferSize: number;
|
|
4
|
-
flushSize: number;
|
|
5
|
-
flushInterval: number;
|
|
6
|
-
resendLimit: number;
|
|
7
|
-
};
|
|
8
|
-
export default class EventsBuffer {
|
|
9
|
-
private _config;
|
|
10
|
-
private _client;
|
|
11
|
-
private _interval;
|
|
12
|
-
private _buffer;
|
|
13
|
-
private _pause;
|
|
14
|
-
private _flush;
|
|
15
|
-
constructor(client: any, config: EventsBufferConfig);
|
|
16
|
-
push(event: EventObject): any;
|
|
17
|
-
pause(): void;
|
|
18
|
-
resume(): void;
|
|
19
|
-
updateClient(client: any): void;
|
|
20
|
-
flush(): void;
|
|
21
|
-
private _startLoop;
|
|
22
|
-
private _sendBatch;
|
|
23
|
-
private _putEvents;
|
|
24
|
-
private _generateBatchEventParams;
|
|
25
|
-
private _handlePutEventsFailure;
|
|
26
|
-
private _processPutEventsSuccessResponse;
|
|
27
|
-
private _retry;
|
|
28
|
-
private _bufferToMap;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
package/lib/Providers/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
package/lib/setupTests.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare const anyGlobal: any;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventTrackOpts } from '../types';
|
|
2
|
-
export declare class EventTracker {
|
|
3
|
-
private _tracker;
|
|
4
|
-
private _config;
|
|
5
|
-
private _delegates;
|
|
6
|
-
constructor(tracker: any, opts: any);
|
|
7
|
-
configure(opts?: EventTrackOpts): EventTrackOpts;
|
|
8
|
-
private _trackFunc;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated use named import
|
|
12
|
-
*/
|
|
13
|
-
export default EventTracker;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { pageViewTrackOpts } from '../types';
|
|
2
|
-
export declare class PageViewTracker {
|
|
3
|
-
private _config;
|
|
4
|
-
private _tracker;
|
|
5
|
-
private _hasEnabled;
|
|
6
|
-
constructor(tracker: any, opts: any);
|
|
7
|
-
configure(opts?: pageViewTrackOpts): pageViewTrackOpts;
|
|
8
|
-
private _isSameUrl;
|
|
9
|
-
private _pageViewTrackDefault;
|
|
10
|
-
private _trackFunc;
|
|
11
|
-
private _pageViewTrackSPA;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use named import
|
|
15
|
-
*/
|
|
16
|
-
export default PageViewTracker;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SessionTrackOpts } from '../types';
|
|
2
|
-
export declare class SessionTracker {
|
|
3
|
-
private _tracker;
|
|
4
|
-
private _hasEnabled;
|
|
5
|
-
private _config;
|
|
6
|
-
private _currentState;
|
|
7
|
-
constructor(tracker: any, opts: any);
|
|
8
|
-
private _envCheck;
|
|
9
|
-
private _trackFunc;
|
|
10
|
-
private _sendInitialEvent;
|
|
11
|
-
configure(opts?: SessionTrackOpts): SessionTrackOpts;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use named import
|
|
15
|
-
*/
|
|
16
|
-
export default SessionTracker;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SessionTrackOpts } from '../types';
|
|
2
|
-
export declare class SessionTracker {
|
|
3
|
-
private _tracker;
|
|
4
|
-
private _hasEnabled;
|
|
5
|
-
private _config;
|
|
6
|
-
private _hidden;
|
|
7
|
-
private _visibilityChange;
|
|
8
|
-
constructor(tracker: any, opts: any);
|
|
9
|
-
private _envCheck;
|
|
10
|
-
private _trackFunc;
|
|
11
|
-
private _trackBeforeUnload;
|
|
12
|
-
private _sendInitialEvent;
|
|
13
|
-
configure(opts?: SessionTrackOpts): SessionTrackOpts;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated use named import
|
|
17
|
-
*/
|
|
18
|
-
export default SessionTracker;
|
package/lib/trackers/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SessionTracker } from './SessionTracker-rn';
|
|
2
|
-
declare class EventTracker {
|
|
3
|
-
constructor(tracker: any, opts: any);
|
|
4
|
-
}
|
|
5
|
-
declare class PageViewTracker {
|
|
6
|
-
constructor(tracker: any, opts: any);
|
|
7
|
-
}
|
|
8
|
-
export { EventTracker, PageViewTracker, SessionTracker };
|
package/lib/types/Analytics.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ICredentials } from '@aws-amplify/core';
|
|
2
|
-
/**
|
|
3
|
-
* Analytics instance options
|
|
4
|
-
*/
|
|
5
|
-
export interface AnalyticsOptions {
|
|
6
|
-
appId: string;
|
|
7
|
-
platform?: string;
|
|
8
|
-
clientId?: string;
|
|
9
|
-
region?: string;
|
|
10
|
-
credentials?: ICredentials;
|
|
11
|
-
}
|
|
12
|
-
export interface EventAttributes {
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
}
|
|
15
|
-
export interface EventMetrics {
|
|
16
|
-
[key: string]: number;
|
|
17
|
-
}
|
|
18
|
-
export interface pageViewTrackOpts {
|
|
19
|
-
enable: boolean;
|
|
20
|
-
type?: string;
|
|
21
|
-
eventName?: string;
|
|
22
|
-
provider?: string;
|
|
23
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
24
|
-
getUrl?: () => string;
|
|
25
|
-
}
|
|
26
|
-
export interface EventTrackOpts {
|
|
27
|
-
enable: boolean;
|
|
28
|
-
events?: Array<string>;
|
|
29
|
-
selectorPrefix?: string;
|
|
30
|
-
provider?: string;
|
|
31
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
32
|
-
}
|
|
33
|
-
export interface SessionTrackOpts {
|
|
34
|
-
enable: boolean;
|
|
35
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
36
|
-
provider?: string;
|
|
37
|
-
}
|
|
38
|
-
export declare type AutoTrackAttributes = (() => EventAttributes | Promise<EventAttributes>) | EventAttributes;
|
|
39
|
-
export interface AutoTrackSessionOpts {
|
|
40
|
-
enable: boolean;
|
|
41
|
-
attributes?: AutoTrackAttributes;
|
|
42
|
-
provider?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface AutoTrackPageViewOpts {
|
|
45
|
-
enable: boolean;
|
|
46
|
-
eventName?: string;
|
|
47
|
-
attributes?: AutoTrackAttributes;
|
|
48
|
-
type?: 'SPA' | 'multiPageApp';
|
|
49
|
-
provider?: string;
|
|
50
|
-
getUrl?: () => string;
|
|
51
|
-
}
|
|
52
|
-
export interface AutoTrackEventOpts {
|
|
53
|
-
enable: boolean;
|
|
54
|
-
events?: string[];
|
|
55
|
-
selectorPrefix?: string;
|
|
56
|
-
provider?: string;
|
|
57
|
-
attributes?: AutoTrackAttributes;
|
|
58
|
-
}
|
|
59
|
-
export interface AnalyticsEvent {
|
|
60
|
-
name: string;
|
|
61
|
-
attributes?: EventAttributes;
|
|
62
|
-
metrics?: EventMetrics;
|
|
63
|
-
immediate?: boolean;
|
|
64
|
-
}
|
|
65
|
-
export { PersonalizeAnalyticsEvent } from './Providers/AmazonPersonalizeProvider';
|
|
66
|
-
export { KinesisAnalyticsEvent } from './Providers/AWSKinesisProvider';
|
package/lib/types/Provider.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface PromiseHandlers {
|
|
2
|
-
resolve: Function;
|
|
3
|
-
reject: Function;
|
|
4
|
-
}
|
|
5
|
-
export interface AnalyticsProvider {
|
|
6
|
-
configure(config: object): object;
|
|
7
|
-
record(params: object, handlers?: PromiseHandlers): Promise<boolean>;
|
|
8
|
-
getCategory(): string;
|
|
9
|
-
getProviderName(): string;
|
|
10
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { PromiseHandlers } from '../Provider';
|
|
2
|
-
export declare type Event = {
|
|
3
|
-
eventId: string;
|
|
4
|
-
name: string;
|
|
5
|
-
attributes: string;
|
|
6
|
-
metrics: string;
|
|
7
|
-
session: object;
|
|
8
|
-
immediate: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare type EventConfig = {
|
|
11
|
-
appId: string;
|
|
12
|
-
endpointId: string;
|
|
13
|
-
region: string;
|
|
14
|
-
resendLimit: number;
|
|
15
|
-
};
|
|
16
|
-
export declare type EventParams = {
|
|
17
|
-
event: Event;
|
|
18
|
-
timestamp: string;
|
|
19
|
-
config: EventConfig;
|
|
20
|
-
credentials: object;
|
|
21
|
-
resendLimit: number;
|
|
22
|
-
};
|
|
23
|
-
export declare type EventObject = {
|
|
24
|
-
params: EventParams;
|
|
25
|
-
handlers: PromiseHandlers;
|
|
26
|
-
};
|
|
27
|
-
export declare type EventMap = {
|
|
28
|
-
[key: string]: EventObject;
|
|
29
|
-
};
|
|
30
|
-
export declare type EventBuffer = Array<EventMap>;
|
|
31
|
-
export declare type EndpointBuffer = Array<EventObject>;
|
|
32
|
-
export declare type PutEventsResponse = {
|
|
33
|
-
EventsResponse: {
|
|
34
|
-
Results?: {
|
|
35
|
-
[endpointId: string]: {
|
|
36
|
-
EventsItemResponse?: {
|
|
37
|
-
[eventId: string]: {
|
|
38
|
-
StatusCode?: number;
|
|
39
|
-
Message?: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export declare type EndpointFailureData = {
|
|
47
|
-
err: any;
|
|
48
|
-
update_params: any;
|
|
49
|
-
endpointObject: EventObject;
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AWSPinpointProvider';
|
package/lib/types/index.d.ts
DELETED
package/lib/utils/AppUtils.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare class MethodEmbed {
|
|
2
|
-
context: any;
|
|
3
|
-
methodName: any;
|
|
4
|
-
private _originalMethod;
|
|
5
|
-
private _bindedMethod;
|
|
6
|
-
static add(context: any, methodName: any, methodOverride: any): void;
|
|
7
|
-
static remove(context: any, methodName: any): void;
|
|
8
|
-
constructor(context: any, methodName: any);
|
|
9
|
-
set(methodOverride: any): void;
|
|
10
|
-
remove(): void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated use named import
|
|
14
|
-
*/
|
|
15
|
-
export default MethodEmbed;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Gets the closest parent element that matches the passed selector.
|
|
6
|
-
* @param {Element} element The element whose parents to check.
|
|
7
|
-
* @param {string} selector The CSS selector to match against.
|
|
8
|
-
* @param {boolean=} shouldCheckSelf True if the selector should test against
|
|
9
|
-
* the passed element itself.
|
|
10
|
-
* @return {Element|undefined} The matching element or undefined.
|
|
11
|
-
*/
|
|
12
|
-
export declare function closest(element: any, selector: any, shouldCheckSelf?: boolean): any;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Delegates the handling of events for an element matching a selector to an
|
|
6
|
-
* ancestor of the matching element.
|
|
7
|
-
* @param {!Node} ancestor The ancestor element to add the listener to.
|
|
8
|
-
* @param {string} eventType The event type to listen to.
|
|
9
|
-
* @param {string} selector A CSS selector to match against child elements.
|
|
10
|
-
* @param {!Function} callback A function to run any time the event happens.
|
|
11
|
-
* @param {Object=} opts A configuration options object. The available options:
|
|
12
|
-
* - useCapture<boolean>: If true, bind to the event capture phase.
|
|
13
|
-
* - deep<boolean>: If true, delegate into shadow trees.
|
|
14
|
-
* @return {Object} The delegate object. It contains a destroy method.
|
|
15
|
-
*/
|
|
16
|
-
export declare function delegate(ancestor: any, eventType: any, selector: any, callback: any, opts?: {}): {
|
|
17
|
-
destroy: () => void;
|
|
18
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Dispatches an event on the passed element.
|
|
6
|
-
* @param {!Element} element The DOM element to dispatch the event on.
|
|
7
|
-
* @param {string} eventType The type of event to dispatch.
|
|
8
|
-
* @param {Object|string=} eventName A string name of the event constructor
|
|
9
|
-
* to use. Defaults to 'Event' if nothing is passed or 'CustomEvent' if
|
|
10
|
-
* a value is set on `initDict.detail`. If eventName is given an object
|
|
11
|
-
* it is assumed to be initDict and thus reassigned.
|
|
12
|
-
* @param {Object=} initDict The initialization attributes for the
|
|
13
|
-
* event. A `detail` property can be used here to pass custom data.
|
|
14
|
-
* @return {boolean} The return value of `element.dispatchEvent`, which will
|
|
15
|
-
* be false if any of the event listeners called `preventDefault`.
|
|
16
|
-
*/
|
|
17
|
-
export declare function dispatch(element: any, eventType: any, evtName?: string, init_dict?: {}): any;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Gets all attributes of an element as a plain JavaScriot object.
|
|
6
|
-
* @param {Element} element The element whose attributes to get.
|
|
7
|
-
* @return {!Object} An object whose keys are the attribute keys and whose
|
|
8
|
-
* values are the attribute values. If no attributes exist, an empty
|
|
9
|
-
* object is returned.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getAttributes(element: any): {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { closest } from './closest';
|
|
2
|
-
export { delegate } from './delegate';
|
|
3
|
-
export { dispatch } from './dispatch';
|
|
4
|
-
export { getAttributes } from './get-attributes';
|
|
5
|
-
export { matches } from './matches';
|
|
6
|
-
export { parents } from './parents';
|
|
7
|
-
export { parseUrl } from './parse-url';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Tests if a DOM elements matches any of the test DOM elements or selectors.
|
|
6
|
-
* @param {Element} element The DOM element to test.
|
|
7
|
-
* @param {Element|string|Array<Element|string>} test A DOM element, a CSS
|
|
8
|
-
* selector, or an array of DOM elements or CSS selectors to match against.
|
|
9
|
-
* @return {boolean} True of any part of the test matches.
|
|
10
|
-
*/
|
|
11
|
-
export declare function matches(element: any, test: any): any;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Returns an array of a DOM element's parent elements.
|
|
6
|
-
* @param {!Element} element The DOM element whose parents to get.
|
|
7
|
-
* @return {!Array} An array of all parent elemets, or an empty array if no
|
|
8
|
-
* parent elements are found.
|
|
9
|
-
*/
|
|
10
|
-
export declare function parents(ele: any): any[];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Parses the given url and returns an object mimicing a `Location` object.
|
|
6
|
-
* @param {string} url The url to parse.
|
|
7
|
-
* @return {!Object} An object with the same properties as a `Location`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function parseUrl(u: any): any;
|