@aws-amplify/analytics 7.0.1-preview-testing.be90020.0 → 7.0.1-ssr-api.df60e41.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/kinesis/package.json +7 -0
- package/kinesis-firehose/package.json +7 -0
- package/lib/apis/disable.d.ts +8 -0
- package/lib/apis/disable.js +14 -0
- package/lib/apis/enable.d.ts +7 -0
- package/lib/apis/enable.js +13 -0
- package/lib/apis/index.d.ts +2 -0
- package/lib/apis/index.js +9 -0
- package/lib/errors/AnalyticsError.d.ts +2 -2
- package/lib/errors/AnalyticsError.js +7 -11
- package/lib/errors/assertValidationError.d.ts +1 -1
- package/lib/errors/assertValidationError.js +9 -5
- package/lib/errors/validation.d.ts +5 -2
- package/lib/errors/validation.js +22 -11
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -1
- package/lib/providers/kinesis/apis/flushEvents.d.ts +8 -0
- package/lib/providers/kinesis/apis/flushEvents.js +35 -0
- package/lib/providers/kinesis/apis/index.d.ts +2 -0
- package/lib/providers/kinesis/apis/index.js +9 -0
- package/lib/providers/kinesis/apis/record.d.ts +2 -0
- package/lib/providers/kinesis/apis/record.js +46 -0
- package/lib/providers/kinesis/index.d.ts +1 -0
- package/lib/providers/kinesis/index.js +8 -0
- package/lib/providers/kinesis/types/buffer.d.ts +15 -0
- package/lib/providers/kinesis/types/buffer.js +4 -0
- package/lib/providers/kinesis/types/index.d.ts +2 -0
- package/lib/providers/kinesis/types/index.js +4 -0
- package/lib/providers/kinesis/types/inputs.d.ts +6 -0
- package/lib/providers/kinesis/types/inputs.js +4 -0
- package/lib/providers/kinesis/utils/constants.d.ts +6 -0
- package/lib/providers/kinesis/utils/constants.js +11 -0
- package/lib/providers/kinesis/utils/getEventBuffer.d.ts +3 -0
- package/lib/providers/kinesis/utils/getEventBuffer.js +72 -0
- package/lib/providers/kinesis/utils/resolveConfig.d.ts +7 -0
- package/lib/providers/kinesis/utils/resolveConfig.js +25 -0
- package/lib/providers/kinesis-firehose/apis/flushEvents.d.ts +8 -0
- package/lib/providers/kinesis-firehose/apis/flushEvents.js +34 -0
- package/lib/providers/kinesis-firehose/apis/index.d.ts +2 -0
- package/lib/providers/kinesis-firehose/apis/index.js +9 -0
- package/lib/providers/kinesis-firehose/apis/record.d.ts +2 -0
- package/lib/providers/kinesis-firehose/apis/record.js +43 -0
- package/lib/providers/kinesis-firehose/index.d.ts +1 -0
- package/lib/providers/kinesis-firehose/index.js +8 -0
- package/lib/providers/kinesis-firehose/types/buffer.d.ts +15 -0
- package/lib/providers/kinesis-firehose/types/index.d.ts +2 -0
- package/lib/providers/kinesis-firehose/types/index.js +4 -0
- package/lib/providers/kinesis-firehose/types/inputs.d.ts +5 -0
- package/lib/providers/kinesis-firehose/types/inputs.js +4 -0
- package/lib/providers/kinesis-firehose/utils/constants.d.ts +6 -0
- package/lib/providers/kinesis-firehose/utils/constants.js +11 -0
- package/lib/providers/kinesis-firehose/utils/getEventBuffer.d.ts +3 -0
- package/lib/providers/kinesis-firehose/utils/getEventBuffer.js +71 -0
- package/lib/providers/kinesis-firehose/utils/index.d.ts +2 -0
- package/lib/providers/kinesis-firehose/utils/index.js +9 -0
- package/lib/providers/kinesis-firehose/utils/resolveConfig.d.ts +7 -0
- package/lib/providers/kinesis-firehose/utils/resolveConfig.js +25 -0
- package/lib/providers/personalize/apis/flushEvents.d.ts +8 -0
- package/lib/providers/personalize/apis/flushEvents.js +33 -0
- package/lib/providers/personalize/apis/index.d.ts +2 -0
- package/lib/providers/personalize/apis/index.js +9 -0
- package/lib/providers/personalize/apis/record.d.ts +2 -0
- package/lib/providers/personalize/apis/record.js +71 -0
- package/lib/providers/personalize/index.d.ts +1 -0
- package/lib/providers/personalize/index.js +8 -0
- package/lib/providers/personalize/types/buffer.d.ts +16 -0
- package/lib/providers/personalize/types/buffer.js +4 -0
- package/lib/providers/personalize/types/index.d.ts +2 -0
- package/lib/providers/personalize/types/index.js +4 -0
- package/lib/providers/personalize/types/inputs.d.ts +7 -0
- package/lib/providers/personalize/types/inputs.js +4 -0
- package/lib/providers/personalize/utils/autoTrackMedia.d.ts +10 -0
- package/lib/providers/personalize/utils/autoTrackMedia.js +181 -0
- package/lib/providers/personalize/utils/cachedSession.d.ts +5 -0
- package/lib/providers/personalize/utils/cachedSession.js +49 -0
- package/lib/providers/personalize/utils/constants.d.ts +7 -0
- package/lib/providers/personalize/utils/constants.js +12 -0
- package/lib/providers/personalize/utils/getEventBuffer.d.ts +3 -0
- package/lib/providers/personalize/utils/getEventBuffer.js +73 -0
- package/lib/providers/personalize/utils/index.d.ts +5 -0
- package/lib/providers/personalize/utils/index.js +17 -0
- package/lib/providers/personalize/utils/resolveConfig.d.ts +7 -0
- package/lib/providers/personalize/utils/resolveConfig.js +26 -0
- package/lib/providers/pinpoint/apis/configureAutoTrack.d.ts +15 -0
- package/lib/providers/pinpoint/apis/configureAutoTrack.js +35 -0
- package/lib/providers/pinpoint/apis/flushEvents.d.ts +8 -0
- package/lib/providers/pinpoint/apis/flushEvents.js +25 -0
- package/lib/providers/pinpoint/apis/identifyUser.d.ts +7 -5
- package/lib/providers/pinpoint/apis/identifyUser.js +24 -32
- package/lib/providers/pinpoint/apis/index.d.ts +2 -0
- package/lib/providers/pinpoint/apis/index.js +5 -1
- package/lib/providers/pinpoint/apis/record.d.ts +8 -14
- package/lib/providers/pinpoint/apis/record.js +31 -34
- package/lib/providers/pinpoint/index.d.ts +2 -2
- package/lib/providers/pinpoint/index.js +3 -1
- package/lib/providers/pinpoint/types/index.d.ts +2 -2
- package/lib/providers/pinpoint/types/index.js +0 -3
- package/lib/providers/pinpoint/types/inputs.d.ts +8 -17
- package/lib/providers/pinpoint/types/options.d.ts +5 -0
- package/lib/providers/pinpoint/types/options.js +4 -0
- package/lib/providers/pinpoint/utils/resolveConfig.js +5 -6
- package/lib/providers/pinpoint/utils/resolveCredentials.d.ts +1 -6
- package/lib/providers/pinpoint/utils/resolveCredentials.js +7 -15
- package/lib/setupTests.js +1 -1
- package/lib/trackers/EventTracker.d.ts +10 -0
- package/lib/trackers/EventTracker.js +98 -0
- package/lib/trackers/PageViewTracker.d.ts +18 -0
- package/lib/trackers/PageViewTracker.js +112 -0
- package/lib/trackers/SessionTracker.d.ts +13 -0
- package/lib/trackers/SessionTracker.js +67 -0
- package/lib/trackers/SessionTracker.native.d.ts +13 -0
- package/lib/trackers/SessionTracker.native.js +67 -0
- package/lib/trackers/index.d.ts +3 -0
- package/lib/trackers/index.js +11 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.js +0 -2
- package/lib/types/inputs.d.ts +35 -0
- package/lib/types/inputs.js +4 -0
- package/lib/types/kinesis.d.ts +8 -0
- package/lib/types/kinesis.js +4 -0
- package/lib/types/options.d.ts +4 -0
- package/lib/types/options.js +4 -0
- package/lib/types/trackers.d.ts +22 -0
- package/lib/types/trackers.js +4 -0
- package/lib/utils/eventBuffer/EventBuffer.d.ts +16 -0
- package/lib/utils/eventBuffer/EventBuffer.js +63 -0
- package/lib/utils/eventBuffer/index.d.ts +2 -0
- package/lib/utils/eventBuffer/index.js +7 -0
- package/lib/utils/eventBuffer/types.d.ts +8 -0
- package/lib/utils/eventBuffer/types.js +4 -0
- package/lib/utils/groupBy.d.ts +1 -0
- package/lib/utils/groupBy.js +12 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +22 -0
- package/lib/utils/resolveCredentials.d.ts +4 -0
- package/lib/utils/resolveCredentials.js +13 -0
- package/lib/utils/statusHelpers.d.ts +6 -0
- package/lib/utils/statusHelpers.js +19 -0
- package/lib/utils/trackerConfigHelpers.d.ts +5 -0
- package/lib/utils/trackerConfigHelpers.js +15 -0
- package/lib/utils/trackerConfigHelpers.native.d.ts +5 -0
- package/lib/utils/trackerConfigHelpers.native.js +14 -0
- package/lib/utils/trackerHelpers.d.ts +9 -0
- package/lib/utils/trackerHelpers.js +44 -0
- package/lib/utils/userAgent.js +3 -3
- package/lib-esm/apis/disable.d.ts +8 -0
- package/lib-esm/apis/disable.js +11 -0
- package/lib-esm/apis/enable.d.ts +7 -0
- package/lib-esm/apis/enable.js +10 -0
- package/lib-esm/apis/index.d.ts +2 -0
- package/lib-esm/apis/index.js +4 -0
- package/lib-esm/errors/AnalyticsError.d.ts +2 -2
- package/lib-esm/errors/AnalyticsError.js +7 -12
- package/lib-esm/errors/assertValidationError.d.ts +1 -1
- package/lib-esm/errors/assertValidationError.js +7 -3
- package/lib-esm/errors/validation.d.ts +5 -2
- package/lib-esm/errors/validation.js +22 -11
- package/lib-esm/index.d.ts +2 -1
- package/lib-esm/index.js +2 -1
- package/lib-esm/providers/kinesis/apis/flushEvents.d.ts +8 -0
- package/lib-esm/providers/kinesis/apis/flushEvents.js +31 -0
- package/lib-esm/providers/kinesis/apis/index.d.ts +2 -0
- package/lib-esm/providers/kinesis/apis/index.js +4 -0
- package/lib-esm/providers/kinesis/apis/record.d.ts +2 -0
- package/lib-esm/providers/kinesis/apis/record.js +42 -0
- package/lib-esm/providers/kinesis/index.d.ts +1 -0
- package/lib-esm/providers/kinesis/index.js +3 -0
- package/lib-esm/providers/kinesis/types/buffer.d.ts +15 -0
- package/lib-esm/providers/kinesis/types/buffer.js +3 -0
- package/lib-esm/providers/kinesis/types/index.d.ts +2 -0
- package/lib-esm/providers/kinesis/types/index.js +3 -0
- package/lib-esm/providers/kinesis/types/inputs.d.ts +6 -0
- package/lib-esm/providers/kinesis/types/inputs.js +3 -0
- package/lib-esm/providers/kinesis/utils/constants.d.ts +6 -0
- package/lib-esm/providers/kinesis/utils/constants.js +8 -0
- package/lib-esm/providers/kinesis/utils/getEventBuffer.d.ts +3 -0
- package/lib-esm/providers/kinesis/utils/getEventBuffer.js +68 -0
- package/lib-esm/providers/kinesis/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/providers/kinesis/utils/resolveConfig.js +21 -0
- package/lib-esm/providers/kinesis-firehose/apis/flushEvents.d.ts +8 -0
- package/lib-esm/providers/kinesis-firehose/apis/flushEvents.js +30 -0
- package/lib-esm/providers/kinesis-firehose/apis/index.d.ts +2 -0
- package/lib-esm/providers/kinesis-firehose/apis/index.js +4 -0
- package/lib-esm/providers/kinesis-firehose/apis/record.d.ts +2 -0
- package/lib-esm/providers/kinesis-firehose/apis/record.js +39 -0
- package/lib-esm/providers/kinesis-firehose/index.d.ts +1 -0
- package/lib-esm/providers/kinesis-firehose/index.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/buffer.d.ts +15 -0
- package/lib-esm/providers/kinesis-firehose/types/index.d.ts +2 -0
- package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/inputs.d.ts +5 -0
- package/lib-esm/providers/kinesis-firehose/types/inputs.js +3 -0
- package/lib-esm/providers/kinesis-firehose/utils/constants.d.ts +6 -0
- package/lib-esm/providers/kinesis-firehose/utils/constants.js +8 -0
- package/lib-esm/providers/kinesis-firehose/utils/getEventBuffer.d.ts +3 -0
- package/lib-esm/providers/kinesis-firehose/utils/getEventBuffer.js +67 -0
- package/lib-esm/providers/kinesis-firehose/utils/index.d.ts +2 -0
- package/lib-esm/providers/kinesis-firehose/utils/index.js +4 -0
- package/lib-esm/providers/kinesis-firehose/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/providers/kinesis-firehose/utils/resolveConfig.js +21 -0
- package/lib-esm/providers/personalize/apis/flushEvents.d.ts +8 -0
- package/lib-esm/providers/personalize/apis/flushEvents.js +29 -0
- package/lib-esm/providers/personalize/apis/index.d.ts +2 -0
- package/lib-esm/providers/personalize/apis/index.js +4 -0
- package/lib-esm/providers/personalize/apis/record.d.ts +2 -0
- package/lib-esm/providers/personalize/apis/record.js +67 -0
- package/lib-esm/providers/personalize/index.d.ts +1 -0
- package/lib-esm/providers/personalize/index.js +3 -0
- package/lib-esm/providers/personalize/types/buffer.d.ts +16 -0
- package/lib-esm/providers/personalize/types/buffer.js +3 -0
- package/lib-esm/providers/personalize/types/index.d.ts +2 -0
- package/lib-esm/providers/personalize/types/index.js +3 -0
- package/lib-esm/providers/personalize/types/inputs.d.ts +7 -0
- package/lib-esm/providers/personalize/types/inputs.js +3 -0
- package/lib-esm/providers/personalize/utils/autoTrackMedia.d.ts +10 -0
- package/lib-esm/providers/personalize/utils/autoTrackMedia.js +177 -0
- package/lib-esm/providers/personalize/utils/cachedSession.d.ts +5 -0
- package/lib-esm/providers/personalize/utils/cachedSession.js +44 -0
- package/lib-esm/providers/personalize/utils/constants.d.ts +7 -0
- package/lib-esm/providers/personalize/utils/constants.js +9 -0
- package/lib-esm/providers/personalize/utils/getEventBuffer.d.ts +3 -0
- package/lib-esm/providers/personalize/utils/getEventBuffer.js +69 -0
- package/lib-esm/providers/personalize/utils/index.d.ts +5 -0
- package/lib-esm/providers/personalize/utils/index.js +7 -0
- package/lib-esm/providers/personalize/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/providers/personalize/utils/resolveConfig.js +22 -0
- package/lib-esm/providers/pinpoint/apis/configureAutoTrack.d.ts +15 -0
- package/lib-esm/providers/pinpoint/apis/configureAutoTrack.js +31 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +8 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.js +21 -0
- package/lib-esm/providers/pinpoint/apis/identifyUser.d.ts +7 -5
- package/lib-esm/providers/pinpoint/apis/identifyUser.js +22 -30
- package/lib-esm/providers/pinpoint/apis/index.d.ts +2 -0
- package/lib-esm/providers/pinpoint/apis/index.js +2 -0
- package/lib-esm/providers/pinpoint/apis/record.d.ts +8 -14
- package/lib-esm/providers/pinpoint/apis/record.js +26 -29
- package/lib-esm/providers/pinpoint/index.d.ts +2 -2
- package/lib-esm/providers/pinpoint/index.js +1 -1
- package/lib-esm/providers/pinpoint/types/index.d.ts +2 -2
- package/lib-esm/providers/pinpoint/types/index.js +1 -1
- package/lib-esm/providers/pinpoint/types/inputs.d.ts +8 -17
- package/lib-esm/providers/pinpoint/types/options.d.ts +5 -0
- package/lib-esm/providers/pinpoint/types/options.js +3 -0
- package/lib-esm/providers/pinpoint/utils/resolveConfig.js +3 -4
- package/lib-esm/providers/pinpoint/utils/resolveCredentials.d.ts +1 -6
- package/lib-esm/providers/pinpoint/utils/resolveCredentials.js +5 -13
- package/lib-esm/setupTests.js +1 -1
- package/lib-esm/trackers/EventTracker.d.ts +10 -0
- package/lib-esm/trackers/EventTracker.js +94 -0
- package/lib-esm/trackers/PageViewTracker.d.ts +18 -0
- package/lib-esm/trackers/PageViewTracker.js +108 -0
- package/lib-esm/trackers/SessionTracker.d.ts +13 -0
- package/lib-esm/trackers/SessionTracker.js +63 -0
- package/lib-esm/trackers/SessionTracker.native.d.ts +13 -0
- package/lib-esm/trackers/SessionTracker.native.js +63 -0
- package/lib-esm/trackers/index.d.ts +3 -0
- package/lib-esm/trackers/index.js +5 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/index.d.ts +3 -1
- package/lib-esm/types/index.js +1 -1
- package/lib-esm/types/inputs.d.ts +35 -0
- package/lib-esm/types/inputs.js +3 -0
- package/lib-esm/types/kinesis.d.ts +8 -0
- package/lib-esm/types/kinesis.js +3 -0
- package/lib-esm/types/options.d.ts +4 -0
- package/lib-esm/types/options.js +3 -0
- package/lib-esm/types/trackers.d.ts +22 -0
- package/lib-esm/types/trackers.js +3 -0
- package/lib-esm/utils/eventBuffer/EventBuffer.d.ts +16 -0
- package/lib-esm/utils/eventBuffer/EventBuffer.js +59 -0
- package/lib-esm/utils/eventBuffer/index.d.ts +2 -0
- package/lib-esm/utils/eventBuffer/index.js +3 -0
- package/lib-esm/utils/eventBuffer/types.d.ts +8 -0
- package/lib-esm/utils/eventBuffer/types.js +3 -0
- package/lib-esm/utils/groupBy.d.ts +1 -0
- package/lib-esm/utils/groupBy.js +8 -0
- package/lib-esm/utils/index.d.ts +7 -0
- package/lib-esm/utils/index.js +9 -0
- package/lib-esm/utils/resolveCredentials.d.ts +4 -0
- package/lib-esm/utils/resolveCredentials.js +9 -0
- package/lib-esm/utils/statusHelpers.d.ts +6 -0
- package/lib-esm/utils/statusHelpers.js +13 -0
- package/lib-esm/utils/trackerConfigHelpers.d.ts +5 -0
- package/lib-esm/utils/trackerConfigHelpers.js +11 -0
- package/lib-esm/utils/trackerConfigHelpers.native.d.ts +5 -0
- package/lib-esm/utils/trackerConfigHelpers.native.js +10 -0
- package/lib-esm/utils/trackerHelpers.d.ts +9 -0
- package/lib-esm/utils/trackerHelpers.js +40 -0
- package/lib-esm/utils/userAgent.js +2 -2
- package/package.json +39 -12
- package/personalize/package.json +7 -0
- package/src/apis/disable.ts +13 -0
- package/src/apis/enable.ts +12 -0
- package/src/apis/index.ts +5 -0
- package/src/errors/AnalyticsError.ts +5 -2
- package/src/errors/assertValidationError.ts +9 -3
- package/src/errors/validation.ts +16 -4
- package/src/index.ts +4 -0
- package/src/providers/kinesis/apis/flushEvents.ts +40 -0
- package/src/providers/kinesis/apis/index.ts +5 -0
- package/src/providers/kinesis/apis/record.ts +58 -0
- package/src/providers/kinesis/index.ts +4 -0
- package/src/providers/kinesis/types/buffer.ts +20 -0
- package/src/providers/kinesis/types/index.ts +5 -0
- package/src/providers/kinesis/types/inputs.ts +10 -0
- package/src/providers/kinesis/utils/constants.ts +9 -0
- package/src/providers/kinesis/utils/getEventBuffer.ts +109 -0
- package/src/providers/kinesis/utils/resolveConfig.ts +36 -0
- package/src/providers/kinesis-firehose/apis/flushEvents.ts +39 -0
- package/src/providers/kinesis-firehose/apis/index.ts +5 -0
- package/src/providers/kinesis-firehose/apis/record.ts +51 -0
- package/src/providers/kinesis-firehose/index.ts +4 -0
- package/src/providers/kinesis-firehose/types/buffer.ts +20 -0
- package/src/providers/kinesis-firehose/types/index.ts +9 -0
- package/src/providers/kinesis-firehose/types/inputs.ts +9 -0
- package/src/providers/kinesis-firehose/utils/constants.ts +9 -0
- package/src/providers/kinesis-firehose/utils/getEventBuffer.ts +117 -0
- package/src/providers/kinesis-firehose/utils/index.ts +5 -0
- package/src/providers/kinesis-firehose/utils/resolveConfig.ts +36 -0
- package/src/providers/personalize/apis/flushEvents.ts +37 -0
- package/src/providers/personalize/apis/index.ts +5 -0
- package/src/providers/personalize/apis/record.ts +102 -0
- package/src/providers/personalize/index.ts +4 -0
- package/src/providers/personalize/types/buffer.ts +21 -0
- package/src/providers/personalize/types/index.ts +5 -0
- package/src/providers/personalize/types/inputs.ts +11 -0
- package/src/providers/personalize/utils/autoTrackMedia.ts +232 -0
- package/src/providers/personalize/utils/cachedSession.ts +68 -0
- package/src/providers/personalize/utils/constants.ts +12 -0
- package/src/providers/personalize/utils/getEventBuffer.ts +110 -0
- package/src/providers/personalize/utils/index.ts +11 -0
- package/src/providers/personalize/utils/resolveConfig.ts +41 -0
- package/src/providers/pinpoint/apis/configureAutoTrack.ts +49 -0
- package/src/providers/pinpoint/apis/flushEvents.ts +32 -0
- package/src/providers/pinpoint/apis/identifyUser.ts +20 -12
- package/src/providers/pinpoint/apis/index.ts +2 -0
- package/src/providers/pinpoint/apis/record.ts +31 -23
- package/src/providers/pinpoint/index.ts +6 -2
- package/src/providers/pinpoint/types/index.ts +6 -2
- package/src/providers/pinpoint/types/inputs.ts +11 -17
- package/src/providers/pinpoint/types/options.ts +12 -0
- package/src/trackers/EventTracker.ts +135 -0
- package/src/trackers/PageViewTracker.ts +160 -0
- package/src/trackers/SessionTracker.native.ts +105 -0
- package/src/trackers/SessionTracker.ts +105 -0
- package/src/trackers/index.ts +6 -0
- package/src/types/index.ts +8 -1
- package/src/types/inputs.ts +52 -0
- package/src/types/kinesis.ts +13 -0
- package/src/types/options.ts +7 -0
- package/src/types/trackers.ts +35 -0
- package/src/utils/eventBuffer/EventBuffer.ts +84 -0
- package/src/utils/eventBuffer/index.ts +5 -0
- package/src/utils/eventBuffer/types.ts +12 -0
- package/src/utils/groupBy.ts +12 -0
- package/src/utils/index.ts +21 -0
- package/src/utils/resolveCredentials.ts +14 -0
- package/src/utils/statusHelpers.ts +17 -0
- package/src/utils/trackerConfigHelpers.native.ts +18 -0
- package/src/utils/trackerConfigHelpers.ts +19 -0
- package/src/utils/trackerHelpers.ts +57 -0
- package/lib/providers/pinpoint/types/errors.d.ts +0 -9
- package/lib/providers/pinpoint/types/errors.js +0 -15
- package/lib/types/analytics.d.ts +0 -50
- package/lib-esm/providers/pinpoint/types/errors.d.ts +0 -9
- package/lib-esm/providers/pinpoint/types/errors.js +0 -12
- package/lib-esm/types/analytics.d.ts +0 -50
- package/src/providers/pinpoint/types/errors.ts +0 -12
- package/src/types/analytics.ts +0 -70
- /package/lib/{types/analytics.js → providers/kinesis-firehose/types/buffer.js} +0 -0
- /package/lib-esm/{types/analytics.js → providers/kinesis-firehose/types/buffer.js} +0 -0
package/src/types/index.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export { AnalyticsServiceOptions } from './options';
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
AnalyticsConfigureAutoTrackInput,
|
|
8
|
+
AnalyticsIdentifyUserInput,
|
|
9
|
+
} from './inputs';
|
|
10
|
+
|
|
11
|
+
export { KinesisStream, KinesisShard, KinesisEventData } from './kinesis';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { UserProfile } from '@aws-amplify/core';
|
|
5
|
+
import { AnalyticsServiceOptions } from '.';
|
|
6
|
+
import {
|
|
7
|
+
SessionTrackingOptions,
|
|
8
|
+
PageViewTrackingOptions,
|
|
9
|
+
EventTrackingOptions,
|
|
10
|
+
} from './trackers';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Input type for `identifyUser`.
|
|
14
|
+
*/
|
|
15
|
+
export type AnalyticsIdentifyUserInput<
|
|
16
|
+
ServiceOptions extends AnalyticsServiceOptions = AnalyticsServiceOptions
|
|
17
|
+
> = {
|
|
18
|
+
/**
|
|
19
|
+
* A User ID associated to the current device.
|
|
20
|
+
*/
|
|
21
|
+
userId: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Additional information about the user and their device.
|
|
25
|
+
*/
|
|
26
|
+
userProfile: UserProfile;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Options to be passed to the API.
|
|
30
|
+
*/
|
|
31
|
+
options?: ServiceOptions;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Input type for `configureAutoTrack`.
|
|
36
|
+
*/
|
|
37
|
+
export type AnalyticsConfigureAutoTrackInput = {
|
|
38
|
+
enable: boolean;
|
|
39
|
+
} & (
|
|
40
|
+
| {
|
|
41
|
+
type: 'session';
|
|
42
|
+
options?: SessionTrackingOptions;
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
type: 'pageView';
|
|
46
|
+
options?: PageViewTrackingOptions;
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
type: 'event';
|
|
50
|
+
options?: EventTrackingOptions;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export type KinesisStream = {
|
|
5
|
+
region: string;
|
|
6
|
+
streamName: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type KinesisShard = KinesisStream & {
|
|
10
|
+
partitionKey: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type KinesisEventData = Record<string, unknown> | Uint8Array;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export type SessionTrackingOptions = {
|
|
5
|
+
attributes?: TrackerAttributes;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type PageViewTrackingOptions = {
|
|
9
|
+
attributes?: TrackerAttributes;
|
|
10
|
+
eventName?: string;
|
|
11
|
+
urlProvider?: () => string;
|
|
12
|
+
appType?: 'multiPage' | 'singlePage';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type EventTrackingOptions = {
|
|
16
|
+
attributes?: TrackerAttributes;
|
|
17
|
+
events?: DOMEvent[];
|
|
18
|
+
selectorPrefix?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type TrackerType = 'event' | 'pageView' | 'session';
|
|
22
|
+
|
|
23
|
+
export type TrackerAttributes = Record<string, string>;
|
|
24
|
+
|
|
25
|
+
export type TrackerEventRecorder = (
|
|
26
|
+
eventName: string,
|
|
27
|
+
attributes: TrackerAttributes
|
|
28
|
+
) => void;
|
|
29
|
+
|
|
30
|
+
export type DOMEvent = keyof GlobalEventHandlersEventMap;
|
|
31
|
+
|
|
32
|
+
export interface TrackerInterface {
|
|
33
|
+
configure(eventRecorder: TrackerEventRecorder, options?: object): void;
|
|
34
|
+
cleanup(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
+
import { EventBufferConfig, IAnalyticsClient } from './';
|
|
6
|
+
|
|
7
|
+
const logger = new ConsoleLogger('EventBuffer');
|
|
8
|
+
|
|
9
|
+
export class EventBuffer<T> {
|
|
10
|
+
private list: T[];
|
|
11
|
+
private readonly config: EventBufferConfig;
|
|
12
|
+
private getAnalyticsClient: () => IAnalyticsClient<T>;
|
|
13
|
+
|
|
14
|
+
private timer?: ReturnType<typeof setInterval>;
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
config: EventBufferConfig,
|
|
18
|
+
getAnalyticsClient: () => IAnalyticsClient<T>
|
|
19
|
+
) {
|
|
20
|
+
this.list = [];
|
|
21
|
+
this.config = config;
|
|
22
|
+
this.getAnalyticsClient = getAnalyticsClient;
|
|
23
|
+
this.startEventLoop();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public append(...events: T[]) {
|
|
27
|
+
for (const event of events) {
|
|
28
|
+
if (this.list.length + 1 > this.config.bufferSize) {
|
|
29
|
+
logger.debug(
|
|
30
|
+
`Exceed ${typeof event} event buffer limits, event dropped`
|
|
31
|
+
);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
this.list.push(event);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public flushAll(): Promise<void> {
|
|
39
|
+
return this.submitEvents(this.list.length);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public release() {
|
|
43
|
+
this.list = [];
|
|
44
|
+
if (this.timer) {
|
|
45
|
+
clearInterval(this.timer);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public get length() {
|
|
50
|
+
return this.list.length;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private head(count: number) {
|
|
54
|
+
return this.list.splice(0, count);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private insertAtBeginning(...data: T[]) {
|
|
58
|
+
this.list.unshift(...data);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private startEventLoop() {
|
|
62
|
+
if (this.timer) {
|
|
63
|
+
clearInterval(this.timer);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { flushSize, flushInterval } = this.config;
|
|
67
|
+
setInterval(() => {
|
|
68
|
+
this.submitEvents(flushSize);
|
|
69
|
+
}, flushInterval);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private submitEvents(count: number): Promise<void> {
|
|
73
|
+
const events = this.head(count);
|
|
74
|
+
if (events.length === 0) {
|
|
75
|
+
return Promise.resolve();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return this.getAnalyticsClient()(events).then(result => {
|
|
79
|
+
if (result.length > 0) {
|
|
80
|
+
this.insertAtBeginning(...result);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export interface IAnalyticsClient<T> {
|
|
5
|
+
(events: T[]): Promise<T[]>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type EventBufferConfig = {
|
|
9
|
+
flushSize: number;
|
|
10
|
+
flushInterval: number;
|
|
11
|
+
bufferSize: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export const groupBy = <T>(
|
|
5
|
+
getGroupId: (x: T) => string,
|
|
6
|
+
list: T[]
|
|
7
|
+
): Record<string, T[]> => {
|
|
8
|
+
return list.reduce((result, current) => {
|
|
9
|
+
const groupId = getGroupId(current);
|
|
10
|
+
return { ...result, [groupId]: [...(result[groupId] ?? []), current] };
|
|
11
|
+
}, {} as Record<string, T[]>);
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export { resolveCredentials } from './resolveCredentials';
|
|
5
|
+
export { groupBy } from './groupBy';
|
|
6
|
+
export {
|
|
7
|
+
EventBuffer,
|
|
8
|
+
IAnalyticsClient,
|
|
9
|
+
EventBufferConfig,
|
|
10
|
+
} from './eventBuffer';
|
|
11
|
+
export {
|
|
12
|
+
enableAnalytics,
|
|
13
|
+
disableAnalytics,
|
|
14
|
+
isAnalyticsEnabled,
|
|
15
|
+
} from './statusHelpers';
|
|
16
|
+
export {
|
|
17
|
+
getAnalyticsUserAgent,
|
|
18
|
+
getAnalyticsUserAgentString,
|
|
19
|
+
} from './userAgent';
|
|
20
|
+
export { updateProviderTrackers } from './trackerHelpers';
|
|
21
|
+
export { validateTrackerConfiguration } from './trackerConfigHelpers';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AnalyticsValidationErrorCode, assertValidationError } from '../errors';
|
|
5
|
+
import { fetchAuthSession } from '@aws-amplify/core';
|
|
6
|
+
|
|
7
|
+
export const resolveCredentials = async () => {
|
|
8
|
+
const { credentials, identityId } = await fetchAuthSession();
|
|
9
|
+
assertValidationError(
|
|
10
|
+
!!credentials,
|
|
11
|
+
AnalyticsValidationErrorCode.NoCredentials
|
|
12
|
+
);
|
|
13
|
+
return { credentials, identityId };
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
let analyticsEnabled = true;
|
|
5
|
+
|
|
6
|
+
export const enableAnalytics = () => {
|
|
7
|
+
analyticsEnabled = true;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const disableAnalytics = () => {
|
|
11
|
+
analyticsEnabled = false;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the current status of the Analytics category.
|
|
16
|
+
*/
|
|
17
|
+
export const isAnalyticsEnabled = () => analyticsEnabled;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AnalyticsValidationErrorCode, assertValidationError } from '../errors';
|
|
5
|
+
import { AnalyticsConfigureAutoTrackInput } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Validates tracker configuration.
|
|
9
|
+
*/
|
|
10
|
+
export const validateTrackerConfiguration = (
|
|
11
|
+
input: AnalyticsConfigureAutoTrackInput
|
|
12
|
+
) => {
|
|
13
|
+
// React Native only supports session tracking
|
|
14
|
+
assertValidationError(
|
|
15
|
+
input.type === 'session',
|
|
16
|
+
AnalyticsValidationErrorCode.UnsupportedPlatform
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AnalyticsValidationErrorCode, assertValidationError } from '../errors';
|
|
5
|
+
import { AnalyticsConfigureAutoTrackInput } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Validates tracker configuration.
|
|
9
|
+
*/
|
|
10
|
+
export const validateTrackerConfiguration = (
|
|
11
|
+
input: AnalyticsConfigureAutoTrackInput
|
|
12
|
+
) => {
|
|
13
|
+
assertValidationError(
|
|
14
|
+
input.type === 'event' ||
|
|
15
|
+
input.type === 'pageView' ||
|
|
16
|
+
input.type === 'session',
|
|
17
|
+
AnalyticsValidationErrorCode.InvalidTracker
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
TrackerAttributes,
|
|
6
|
+
TrackerEventRecorder,
|
|
7
|
+
TrackerInterface,
|
|
8
|
+
TrackerType,
|
|
9
|
+
} from '../types/trackers';
|
|
10
|
+
import { EventTracker, PageViewTracker, SessionTracker } from '../trackers';
|
|
11
|
+
import { ConfigureAutoTrackInput } from '../providers/pinpoint';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Updates a provider's trackers as appropriate for the provided auto-track configuration.
|
|
15
|
+
*
|
|
16
|
+
* @remark
|
|
17
|
+
* This utility will mutate the provider's configured trackers via `providerTrackers`.
|
|
18
|
+
*/
|
|
19
|
+
export const updateProviderTrackers = (
|
|
20
|
+
input: ConfigureAutoTrackInput,
|
|
21
|
+
providerEventRecorder: TrackerEventRecorder,
|
|
22
|
+
providerTrackers: Partial<Record<TrackerType, TrackerInterface>>
|
|
23
|
+
) => {
|
|
24
|
+
let trackerInstance;
|
|
25
|
+
const trackerType = input.type;
|
|
26
|
+
const currentTracker = providerTrackers[trackerType];
|
|
27
|
+
|
|
28
|
+
// Check if the tracker was disabled & should be cleaned up
|
|
29
|
+
if (!input.enable) {
|
|
30
|
+
if (currentTracker) {
|
|
31
|
+
currentTracker.cleanup();
|
|
32
|
+
delete providerTrackers[trackerType];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Re-configure the existing tracker, or create & configure an instance if it doesn't exist yet
|
|
39
|
+
if (currentTracker) {
|
|
40
|
+
currentTracker.configure(providerEventRecorder, input.options);
|
|
41
|
+
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Create a new tracker instance for the type
|
|
46
|
+
if (trackerType === 'event') {
|
|
47
|
+
trackerInstance = new EventTracker(providerEventRecorder, input.options);
|
|
48
|
+
} else if (trackerType === 'pageView') {
|
|
49
|
+
trackerInstance = new PageViewTracker(providerEventRecorder, input.options);
|
|
50
|
+
} else if (trackerType === 'session') {
|
|
51
|
+
trackerInstance = new SessionTracker(providerEventRecorder, input.options);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (trackerInstance) {
|
|
55
|
+
providerTrackers[trackerType] = trackerInstance;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare enum UpdateEndpointException {
|
|
2
|
-
BadRequestException = "BadRequestException",
|
|
3
|
-
ForbiddenException = "ForbiddenException",
|
|
4
|
-
InternalServerErrorException = "InternalServerErrorException",
|
|
5
|
-
MethodNotAllowedException = "MethodNotAllowedException",
|
|
6
|
-
NotFoundException = "NotFoundException",
|
|
7
|
-
PayloadTooLargeException = "PayloadTooLargeException",
|
|
8
|
-
TooManyRequestsException = "TooManyRequestsException"
|
|
9
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.UpdateEndpointException = void 0;
|
|
6
|
-
var UpdateEndpointException;
|
|
7
|
-
(function (UpdateEndpointException) {
|
|
8
|
-
UpdateEndpointException["BadRequestException"] = "BadRequestException";
|
|
9
|
-
UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
|
|
10
|
-
UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
|
|
11
|
-
UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
|
|
12
|
-
UpdateEndpointException["NotFoundException"] = "NotFoundException";
|
|
13
|
-
UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
|
|
14
|
-
UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
|
|
15
|
-
})(UpdateEndpointException = exports.UpdateEndpointException || (exports.UpdateEndpointException = {}));
|
package/lib/types/analytics.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Analytics instance options
|
|
3
|
-
*/
|
|
4
|
-
export interface EventAttributes {
|
|
5
|
-
[key: string]: string;
|
|
6
|
-
}
|
|
7
|
-
export interface EventMetrics {
|
|
8
|
-
[key: string]: number;
|
|
9
|
-
}
|
|
10
|
-
export interface pageViewTrackOpts {
|
|
11
|
-
enable: boolean;
|
|
12
|
-
type?: string;
|
|
13
|
-
eventName?: string;
|
|
14
|
-
provider?: string;
|
|
15
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
16
|
-
getUrl?: () => string;
|
|
17
|
-
}
|
|
18
|
-
export interface EventTrackOpts {
|
|
19
|
-
enable: boolean;
|
|
20
|
-
events?: Array<string>;
|
|
21
|
-
selectorPrefix?: string;
|
|
22
|
-
provider?: string;
|
|
23
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
24
|
-
}
|
|
25
|
-
export interface SessionTrackOpts {
|
|
26
|
-
enable: boolean;
|
|
27
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
28
|
-
provider?: string;
|
|
29
|
-
}
|
|
30
|
-
export type AutoTrackAttributes = (() => EventAttributes | Promise<EventAttributes>) | EventAttributes;
|
|
31
|
-
export interface AutoTrackSessionOpts {
|
|
32
|
-
enable: boolean;
|
|
33
|
-
attributes?: AutoTrackAttributes;
|
|
34
|
-
provider?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface AutoTrackPageViewOpts {
|
|
37
|
-
enable: boolean;
|
|
38
|
-
eventName?: string;
|
|
39
|
-
attributes?: AutoTrackAttributes;
|
|
40
|
-
type?: 'SPA' | 'multiPageApp';
|
|
41
|
-
provider?: string;
|
|
42
|
-
getUrl?: () => string;
|
|
43
|
-
}
|
|
44
|
-
export interface AutoTrackEventOpts {
|
|
45
|
-
enable: boolean;
|
|
46
|
-
events?: string[];
|
|
47
|
-
selectorPrefix?: string;
|
|
48
|
-
provider?: string;
|
|
49
|
-
attributes?: AutoTrackAttributes;
|
|
50
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare enum UpdateEndpointException {
|
|
2
|
-
BadRequestException = "BadRequestException",
|
|
3
|
-
ForbiddenException = "ForbiddenException",
|
|
4
|
-
InternalServerErrorException = "InternalServerErrorException",
|
|
5
|
-
MethodNotAllowedException = "MethodNotAllowedException",
|
|
6
|
-
NotFoundException = "NotFoundException",
|
|
7
|
-
PayloadTooLargeException = "PayloadTooLargeException",
|
|
8
|
-
TooManyRequestsException = "TooManyRequestsException"
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export var UpdateEndpointException;
|
|
4
|
-
(function (UpdateEndpointException) {
|
|
5
|
-
UpdateEndpointException["BadRequestException"] = "BadRequestException";
|
|
6
|
-
UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
|
|
7
|
-
UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
|
|
8
|
-
UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
|
|
9
|
-
UpdateEndpointException["NotFoundException"] = "NotFoundException";
|
|
10
|
-
UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
|
|
11
|
-
UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
|
|
12
|
-
})(UpdateEndpointException || (UpdateEndpointException = {}));
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Analytics instance options
|
|
3
|
-
*/
|
|
4
|
-
export interface EventAttributes {
|
|
5
|
-
[key: string]: string;
|
|
6
|
-
}
|
|
7
|
-
export interface EventMetrics {
|
|
8
|
-
[key: string]: number;
|
|
9
|
-
}
|
|
10
|
-
export interface pageViewTrackOpts {
|
|
11
|
-
enable: boolean;
|
|
12
|
-
type?: string;
|
|
13
|
-
eventName?: string;
|
|
14
|
-
provider?: string;
|
|
15
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
16
|
-
getUrl?: () => string;
|
|
17
|
-
}
|
|
18
|
-
export interface EventTrackOpts {
|
|
19
|
-
enable: boolean;
|
|
20
|
-
events?: Array<string>;
|
|
21
|
-
selectorPrefix?: string;
|
|
22
|
-
provider?: string;
|
|
23
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
24
|
-
}
|
|
25
|
-
export interface SessionTrackOpts {
|
|
26
|
-
enable: boolean;
|
|
27
|
-
attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
|
28
|
-
provider?: string;
|
|
29
|
-
}
|
|
30
|
-
export type AutoTrackAttributes = (() => EventAttributes | Promise<EventAttributes>) | EventAttributes;
|
|
31
|
-
export interface AutoTrackSessionOpts {
|
|
32
|
-
enable: boolean;
|
|
33
|
-
attributes?: AutoTrackAttributes;
|
|
34
|
-
provider?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface AutoTrackPageViewOpts {
|
|
37
|
-
enable: boolean;
|
|
38
|
-
eventName?: string;
|
|
39
|
-
attributes?: AutoTrackAttributes;
|
|
40
|
-
type?: 'SPA' | 'multiPageApp';
|
|
41
|
-
provider?: string;
|
|
42
|
-
getUrl?: () => string;
|
|
43
|
-
}
|
|
44
|
-
export interface AutoTrackEventOpts {
|
|
45
|
-
enable: boolean;
|
|
46
|
-
events?: string[];
|
|
47
|
-
selectorPrefix?: string;
|
|
48
|
-
provider?: string;
|
|
49
|
-
attributes?: AutoTrackAttributes;
|
|
50
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
export enum UpdateEndpointException {
|
|
5
|
-
BadRequestException = 'BadRequestException',
|
|
6
|
-
ForbiddenException = 'ForbiddenException',
|
|
7
|
-
InternalServerErrorException = 'InternalServerErrorException',
|
|
8
|
-
MethodNotAllowedException = 'MethodNotAllowedException',
|
|
9
|
-
NotFoundException = 'NotFoundException',
|
|
10
|
-
PayloadTooLargeException = 'PayloadTooLargeException',
|
|
11
|
-
TooManyRequestsException = 'TooManyRequestsException',
|
|
12
|
-
}
|
package/src/types/analytics.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Analytics instance options
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface EventAttributes {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface EventMetrics {
|
|
13
|
-
[key: string]: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface pageViewTrackOpts {
|
|
17
|
-
enable: boolean;
|
|
18
|
-
type?: string;
|
|
19
|
-
eventName?: string;
|
|
20
|
-
provider?: string;
|
|
21
|
-
attributes?:
|
|
22
|
-
| EventAttributes
|
|
23
|
-
| (() => EventAttributes | Promise<EventAttributes>);
|
|
24
|
-
getUrl?: () => string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface EventTrackOpts {
|
|
28
|
-
enable: boolean;
|
|
29
|
-
events?: Array<string>;
|
|
30
|
-
selectorPrefix?: string;
|
|
31
|
-
provider?: string;
|
|
32
|
-
attributes?:
|
|
33
|
-
| EventAttributes
|
|
34
|
-
| (() => EventAttributes | Promise<EventAttributes>);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface SessionTrackOpts {
|
|
38
|
-
enable: boolean;
|
|
39
|
-
attributes?:
|
|
40
|
-
| EventAttributes
|
|
41
|
-
| (() => EventAttributes | Promise<EventAttributes>);
|
|
42
|
-
provider?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type AutoTrackAttributes =
|
|
46
|
-
| (() => EventAttributes | Promise<EventAttributes>)
|
|
47
|
-
| EventAttributes;
|
|
48
|
-
|
|
49
|
-
export interface AutoTrackSessionOpts {
|
|
50
|
-
enable: boolean;
|
|
51
|
-
attributes?: AutoTrackAttributes;
|
|
52
|
-
provider?: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface AutoTrackPageViewOpts {
|
|
56
|
-
enable: boolean;
|
|
57
|
-
eventName?: string;
|
|
58
|
-
attributes?: AutoTrackAttributes;
|
|
59
|
-
type?: 'SPA' | 'multiPageApp';
|
|
60
|
-
provider?: string;
|
|
61
|
-
getUrl?: () => string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface AutoTrackEventOpts {
|
|
65
|
-
enable: boolean;
|
|
66
|
-
events?: string[];
|
|
67
|
-
selectorPrefix?: string;
|
|
68
|
-
provider?: string;
|
|
69
|
-
attributes?: AutoTrackAttributes;
|
|
70
|
-
}
|
|
File without changes
|
|
File without changes
|