@amplitude/analytics-types 2.8.4 → 2.9.1

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.
Files changed (58) hide show
  1. package/lib/cjs/amplitude-promise.js +1 -0
  2. package/lib/cjs/base-event.d.ts +4 -3
  3. package/lib/cjs/base-event.d.ts.map +1 -1
  4. package/lib/cjs/base-event.js +1 -0
  5. package/lib/cjs/base-event.js.map +1 -1
  6. package/lib/cjs/campaign.js +1 -0
  7. package/lib/cjs/client/core-client.js +1 -0
  8. package/lib/cjs/client/index.js +1 -0
  9. package/lib/cjs/client/node-client.js +1 -0
  10. package/lib/cjs/client/web-client.js +1 -0
  11. package/lib/cjs/config/browser.d.ts +1 -1
  12. package/lib/cjs/config/browser.js +1 -0
  13. package/lib/cjs/config/browser.js.map +1 -1
  14. package/lib/cjs/config/core.js +1 -0
  15. package/lib/cjs/config/index.js +1 -0
  16. package/lib/cjs/config/node.js +1 -0
  17. package/lib/cjs/config/react-native.js +1 -0
  18. package/lib/cjs/destination-context.js +1 -0
  19. package/lib/cjs/element-interactions.js +1 -0
  20. package/lib/cjs/element-interactions.js.map +1 -1
  21. package/lib/cjs/event-bridge.js +1 -0
  22. package/lib/cjs/event-callback.js +1 -0
  23. package/lib/cjs/event.d.ts +3 -1
  24. package/lib/cjs/event.d.ts.map +1 -1
  25. package/lib/cjs/event.js +2 -0
  26. package/lib/cjs/event.js.map +1 -1
  27. package/lib/cjs/index.js +1 -0
  28. package/lib/cjs/index.js.map +1 -1
  29. package/lib/cjs/ingestion-metadata.js +1 -0
  30. package/lib/cjs/logger.js +1 -0
  31. package/lib/cjs/logger.js.map +1 -1
  32. package/lib/cjs/offline.js +1 -0
  33. package/lib/cjs/offline.js.map +1 -1
  34. package/lib/cjs/page-view-tracking.js +1 -0
  35. package/lib/cjs/payload.js +1 -0
  36. package/lib/cjs/plan.js +1 -0
  37. package/lib/cjs/plugin.js +1 -0
  38. package/lib/cjs/proxy.js +1 -0
  39. package/lib/cjs/response.js +1 -0
  40. package/lib/cjs/result.js +1 -0
  41. package/lib/cjs/server-zone.js +1 -0
  42. package/lib/cjs/server-zone.js.map +1 -1
  43. package/lib/cjs/status.js +1 -0
  44. package/lib/cjs/status.js.map +1 -1
  45. package/lib/cjs/storage.js +1 -0
  46. package/lib/cjs/transport.js +1 -0
  47. package/lib/cjs/user-session.js +1 -0
  48. package/lib/cjs/utm.js +1 -0
  49. package/lib/esm/base-event.d.ts +4 -3
  50. package/lib/esm/base-event.d.ts.map +1 -1
  51. package/lib/esm/base-event.js.map +1 -1
  52. package/lib/esm/config/browser.d.ts +1 -1
  53. package/lib/esm/config/browser.js.map +1 -1
  54. package/lib/esm/event.d.ts +3 -1
  55. package/lib/esm/event.d.ts.map +1 -1
  56. package/lib/esm/event.js +1 -0
  57. package/lib/esm/event.js.map +1 -1
  58. package/package.json +2 -2
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=amplitude-promise.js.map
@@ -11,9 +11,6 @@ export interface BaseEvent extends EventOptions {
11
11
  group_properties?: {
12
12
  [key: string]: any;
13
13
  } | undefined;
14
- groups?: {
15
- [key: string]: any;
16
- } | undefined;
17
14
  }
18
15
  export interface EventOptions {
19
16
  user_id?: string;
@@ -46,6 +43,7 @@ export interface EventOptions {
46
43
  revenue?: number;
47
44
  productId?: string;
48
45
  revenueType?: string;
46
+ currency?: string;
49
47
  event_id?: number;
50
48
  session_id?: number;
51
49
  insert_id?: string;
@@ -57,5 +55,8 @@ export interface EventOptions {
57
55
  extra?: {
58
56
  [key: string]: any;
59
57
  };
58
+ groups?: {
59
+ [key: string]: any;
60
+ } | undefined;
60
61
  }
61
62
  //# sourceMappingURL=base-event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-event.d.ts","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,Q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C,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kBAAkB,CAAC,EAAE,8BAA8B,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,SAAS,CAAC;CAC7C"}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=base-event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-event.js","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"","sourcesContent":["import { Plan } from './plan';\nimport { IngestionMetadataEventProperty } from './ingestion-metadata';\n\nexport interface BaseEvent extends EventOptions {\n event_type: string;\n event_properties?: { [key: string]: any } | undefined;\n user_properties?: { [key: string]: any } | undefined;\n group_properties?: { [key: string]: any } | undefined;\n groups?: { [key: string]: any } | undefined;\n}\n\nexport interface EventOptions {\n user_id?: string;\n device_id?: string;\n time?: number;\n location_lat?: number;\n location_lng?: number;\n app_version?: string;\n version_name?: string;\n library?: string;\n platform?: string;\n os_name?: string;\n os_version?: string;\n device_brand?: string;\n device_manufacturer?: string;\n device_model?: string;\n carrier?: string;\n country?: string;\n region?: string;\n city?: string;\n dma?: string;\n idfa?: string;\n idfv?: string;\n adid?: string;\n android_id?: string;\n language?: string;\n ip?: string;\n price?: number;\n quantity?: number;\n revenue?: number;\n productId?: string;\n revenueType?: string;\n event_id?: number;\n session_id?: number;\n insert_id?: string;\n plan?: Plan;\n ingestion_metadata?: IngestionMetadataEventProperty;\n partner_id?: string;\n user_agent?: string;\n android_app_set_id?: string;\n extra?: { [key: string]: any };\n}\n"]}
1
+ {"version":3,"file":"base-event.js","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"","sourcesContent":["import { Plan } from './plan';\nimport { IngestionMetadataEventProperty } from './ingestion-metadata';\n\nexport interface BaseEvent extends EventOptions {\n event_type: string;\n event_properties?: { [key: string]: any } | undefined;\n user_properties?: { [key: string]: any } | undefined;\n group_properties?: { [key: string]: any } | undefined;\n}\n\nexport interface EventOptions {\n user_id?: string;\n device_id?: string;\n time?: number;\n location_lat?: number;\n location_lng?: number;\n app_version?: string;\n version_name?: string;\n library?: string;\n platform?: string;\n os_name?: string;\n os_version?: string;\n device_brand?: string;\n device_manufacturer?: string;\n device_model?: string;\n carrier?: string;\n country?: string;\n region?: string;\n city?: string;\n dma?: string;\n idfa?: string;\n idfv?: string;\n adid?: string;\n android_id?: string;\n language?: string;\n ip?: string;\n price?: number;\n quantity?: number;\n revenue?: number;\n productId?: string;\n revenueType?: string;\n currency?: string;\n event_id?: number;\n session_id?: number;\n insert_id?: string;\n plan?: Plan;\n ingestion_metadata?: IngestionMetadataEventProperty;\n partner_id?: string;\n user_agent?: string;\n android_app_set_id?: string;\n extra?: { [key: string]: any };\n groups?: { [key: string]: any } | undefined;\n}\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=campaign.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=core-client.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=node-client.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=web-client.js.map
@@ -160,7 +160,7 @@ export interface TrackingOptions {
160
160
  */
161
161
  language?: boolean;
162
162
  /**
163
- * Enables/disables plantform tracking.
163
+ * Enables/disables platform tracking.
164
164
  * @defaultValue `true`
165
165
  */
166
166
  platform?: boolean;
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: 'fetch' | 'xhr' | 'beacon';\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: 'fetch' | 'xhr' | 'beacon';\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables platform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=core.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=node.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=react-native.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=destination-context.js.map
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = void 0;
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":";;AAIA;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,4BAA4B;IAC5B,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAE/D;;GAEG;AACU,QAAA,8BAA8B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'video',\n 'audio',\n '[contenteditable=\"true\" i]',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allow the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\n/**\n * Default list of elements on the page should be tracked when the page changes.\n */\nexport const DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n\n /**\n * Debounce time in milliseconds for tracking events.\n * This is used to detect rage clicks.\n */\n debounceTime?: number;\n\n /**\n * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist\n */\n actionClickAllowlist?: string[];\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\n// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json\n// and never if it is not included\n// eslint-disable-next-line no-restricted-globals\ntype DomElement = typeof globalThis extends {\n Element: new (...args: any) => infer T;\n}\n ? T\n : never;\n"]}
1
+ {"version":3,"file":"element-interactions.js","sourceRoot":"","sources":["../../src/element-interactions.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG;IAC5C,GAAG;IACH,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,OAAO;IACP,OAAO;IACP,OAAO;IACP,4BAA4B;IAC5B,0BAA0B;IAC1B,oBAAoB;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAE/D;;GAEG;AACU,QAAA,8BAA8B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import { Logger } from './logger';\n\nexport type ActionType = 'click' | 'change';\n\n/**\n * Default CSS selectors to define which elements on the page to track.\n * Extend this list to include additional elements to track. For example:\n * ```\n * autocapturePlugin({\n * cssSelectorAllowlist: [...DEFAULT_CSS_SELECTOR_ALLOWLIST, \".my-class\"],\n * })\n * ```\n */\nexport const DEFAULT_CSS_SELECTOR_ALLOWLIST = [\n 'a',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'video',\n 'audio',\n '[contenteditable=\"true\" i]',\n '[data-amp-default-track]',\n '.amp-default-track',\n];\n\n/**\n * Default prefix to allow the plugin to capture data attributes as an event property.\n */\nexport const DEFAULT_DATA_ATTRIBUTE_PREFIX = 'data-amp-track-';\n\n/**\n * Default list of elements on the page should be tracked when the page changes.\n */\nexport const DEFAULT_ACTION_CLICK_ALLOWLIST = ['div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\nexport interface ElementInteractionsOptions {\n /**\n * List of CSS selectors to allow auto tracking on.\n * When provided, allow elements matching any selector to be tracked.\n * Default is ['a', 'button', 'input', 'select', 'textarea', 'label', '[data-amp-default-track]', '.amp-default-track'].\n */\n cssSelectorAllowlist?: string[];\n\n /**\n * List of page URLs to allow auto tracking on.\n * When provided, only allow tracking on these URLs.\n * Both full URLs and regex are supported.\n */\n pageUrlAllowlist?: (string | RegExp)[];\n\n /**\n * Function to determine whether an event should be tracked.\n * When provided, this function overwrites all other allowlists and configurations.\n * If the function returns true, the event will be tracked.\n * If the function returns false, the event will not be tracked.\n * @param actionType - The type of action that triggered the event.\n * @param element - The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that triggered the event.\n */\n shouldTrackEventResolver?: (actionType: ActionType, element: DomElement) => boolean;\n\n /**\n * Prefix for data attributes to allow auto collecting.\n * Default is 'data-amp-track-'.\n */\n dataAttributePrefix?: string;\n\n /**\n * Options for integrating visual tagging selector.\n */\n visualTaggingOptions?: {\n enabled?: boolean;\n messenger?: Messenger;\n };\n\n /**\n * Debounce time in milliseconds for tracking events.\n * This is used to detect rage clicks.\n */\n debounceTime?: number;\n\n /**\n * CSS selector allowlist for tracking clicks that result in a DOM change/navigation on elements not already allowed by the cssSelectorAllowlist\n */\n actionClickAllowlist?: string[];\n}\n\nexport interface Messenger {\n logger?: Logger;\n setup: () => void;\n}\n\n// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json\n// and never if it is not included\n// eslint-disable-next-line no-restricted-globals\ntype DomElement = typeof globalThis extends {\n Element: new (...args: any) => infer T;\n}\n ? T\n : never;\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=event-bridge.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=event-callback.js.map
@@ -55,6 +55,7 @@ export interface Revenue {
55
55
  setQuantity(quantity: number): Revenue;
56
56
  setPrice(price: number): Revenue;
57
57
  setRevenueType(revenueType: string): Revenue;
58
+ setCurrency(currency: string): Revenue;
58
59
  setEventProperties(properties: {
59
60
  [key: string]: any;
60
61
  }): Revenue;
@@ -65,6 +66,7 @@ export declare enum RevenueProperty {
65
66
  REVENUE_QUANTITY = "$quantity",
66
67
  REVENUE_PRICE = "$price",
67
68
  REVENUE_TYPE = "$revenueType",
69
+ REVENUE_CURRENCY = "$currency",
68
70
  REVENUE = "$revenue"
69
71
  }
70
72
  export interface RevenueEventProperties {
@@ -72,7 +74,7 @@ export interface RevenueEventProperties {
72
74
  [RevenueProperty.REVENUE_QUANTITY]?: number;
73
75
  [RevenueProperty.REVENUE_PRICE]?: number;
74
76
  [RevenueProperty.REVENUE_TYPE]?: string;
75
- [RevenueProperty.REVENUE_TYPE]?: string;
77
+ [RevenueProperty.REVENUE_CURRENCY]?: string;
76
78
  [RevenueProperty.REVENUE]?: number;
77
79
  }
78
80
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,QAAQ;IACvB,iBAAiB,IAAI,sBAAsB,CAAC;IAC5C,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC1D,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC7D,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC9D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IACjE,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAChE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBA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event.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.SpecialEventType = exports.RevenueProperty = exports.IdentifyOperation = void 0;
3
4
  var IdentifyOperation;
@@ -23,6 +24,7 @@ var RevenueProperty;
23
24
  RevenueProperty["REVENUE_QUANTITY"] = "$quantity";
24
25
  RevenueProperty["REVENUE_PRICE"] = "$price";
25
26
  RevenueProperty["REVENUE_TYPE"] = "$revenueType";
27
+ RevenueProperty["REVENUE_CURRENCY"] = "$currency";
26
28
  RevenueProperty["REVENUE"] = "$revenue";
27
29
  })(RevenueProperty = exports.RevenueProperty || (exports.RevenueProperty = {}));
28
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":";;AAgBA,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,gCAAgC;IAChC,iCAAY,CAAA;IACZ,0CAAqB,CAAA;IAErB,8CAA8C;IAC9C,iCAAY,CAAA;IACZ,uCAAkB,CAAA;IAClB,yCAAoB,CAAA;IACpB,uCAAkB,CAAA;IAElB,8DAA8D;IAC9D,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAE1B,+CAA+C;IAC/C,qCAAgB,CAAA;IAChB,4CAAuB,CAAA;AACzB,CAAC,EAlBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAkB5B;AAiDD,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,oDAAiC,CAAA;IACjC,iDAA8B,CAAA;IAC9B,2CAAwB,CAAA;IACxB,gDAA6B,CAAA;IAC7B,uCAAoB,CAAA;AACtB,CAAC,EANW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAM1B;AAWD;;;GAGG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,0CAAsB,CAAA;IACtB,qDAAiC,CAAA;IACjC,8CAA0B,CAAA;AAC5B,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B","sourcesContent":["import { BaseEvent } from './base-event';\n\nexport interface Identify {\n getUserProperties(): IdentifyUserProperties;\n set(property: string, value: ValidPropertyType): Identify;\n setOnce(property: string, value: ValidPropertyType): Identify;\n append(property: string, value: ValidPropertyType): Identify;\n prepend(property: string, value: ValidPropertyType): Identify;\n postInsert(property: string, value: ValidPropertyType): Identify;\n preInsert(property: string, value: ValidPropertyType): Identify;\n remove(property: string, value: ValidPropertyType): Identify;\n add(property: string, value: number): Identify;\n unset(property: string): Identify;\n clearAll(): Identify;\n}\n\nexport enum IdentifyOperation {\n // Base Operations to set values\n SET = '$set',\n SET_ONCE = '$setOnce',\n\n // Operations around modifying existing values\n ADD = '$add',\n APPEND = '$append',\n PREPEND = '$prepend',\n REMOVE = '$remove',\n\n // Operations around appending values *if* they aren't present\n PREINSERT = '$preInsert',\n POSTINSERT = '$postInsert',\n\n // Operations around removing properties/values\n UNSET = '$unset',\n CLEAR_ALL = '$clearAll',\n}\n\nexport type ValidPropertyType =\n | number\n | string\n | boolean\n | Array<string | number>\n | { [key: string]: ValidPropertyType }\n | Array<{ [key: string]: ValidPropertyType }>;\n\ninterface BaseOperationConfig {\n [key: string]: ValidPropertyType;\n}\n\nexport interface IdentifyUserProperties {\n // Add operations can only take numbers\n [IdentifyOperation.ADD]?: { [key: string]: number };\n\n // This reads the keys of the passed object, but the values are not used\n [IdentifyOperation.UNSET]?: BaseOperationConfig;\n // This option does not read the key as it unsets all user properties\n [IdentifyOperation.CLEAR_ALL]?: any;\n\n // These operations can take numbers, strings, or arrays of both.\n [IdentifyOperation.SET]?: BaseOperationConfig;\n [IdentifyOperation.SET_ONCE]?: BaseOperationConfig;\n [IdentifyOperation.APPEND]?: BaseOperationConfig;\n [IdentifyOperation.PREPEND]?: BaseOperationConfig;\n [IdentifyOperation.POSTINSERT]?: BaseOperationConfig;\n [IdentifyOperation.PREINSERT]?: BaseOperationConfig;\n [IdentifyOperation.REMOVE]?: BaseOperationConfig;\n}\n\nexport type UserProperties =\n | IdentifyUserProperties\n | {\n [key in Exclude<string, IdentifyOperation>]: any;\n };\n\nexport interface Revenue {\n getEventProperties(): RevenueEventProperties;\n setProductId(productId: string): Revenue;\n setQuantity(quantity: number): Revenue;\n setPrice(price: number): Revenue;\n setRevenueType(revenueType: string): Revenue;\n setEventProperties(properties: { [key: string]: any }): Revenue;\n setRevenue(revenue: number): Revenue;\n}\n\nexport enum RevenueProperty {\n REVENUE_PRODUCT_ID = '$productId',\n REVENUE_QUANTITY = '$quantity',\n REVENUE_PRICE = '$price',\n REVENUE_TYPE = '$revenueType',\n REVENUE = '$revenue',\n}\n\nexport interface RevenueEventProperties {\n [RevenueProperty.REVENUE_PRODUCT_ID]?: string;\n [RevenueProperty.REVENUE_QUANTITY]?: number;\n [RevenueProperty.REVENUE_PRICE]?: number;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE]?: number;\n}\n\n/**\n * Strings that have special meaning when used as an event's type\n * and have different specifications.\n */\nexport enum SpecialEventType {\n IDENTIFY = '$identify',\n GROUP_IDENTIFY = '$groupidentify',\n REVENUE = 'revenue_amount',\n}\n\nexport interface TrackEvent extends BaseEvent {\n event_type: Exclude<string, SpecialEventType>;\n}\n\nexport interface IdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.IDENTIFY;\n user_properties: UserProperties;\n}\n\nexport interface GroupIdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.GROUP_IDENTIFY;\n group_properties: UserProperties;\n}\n\nexport interface RevenueEvent extends BaseEvent {\n event_type: SpecialEventType.REVENUE;\n event_properties:\n | RevenueEventProperties\n | {\n [key: string]: any;\n };\n}\n\nexport type Event = TrackEvent | IdentifyEvent | GroupIdentifyEvent | RevenueEvent;\n"]}
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":";;;AAgBA,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,gCAAgC;IAChC,iCAAY,CAAA;IACZ,0CAAqB,CAAA;IAErB,8CAA8C;IAC9C,iCAAY,CAAA;IACZ,uCAAkB,CAAA;IAClB,yCAAoB,CAAA;IACpB,uCAAkB,CAAA;IAElB,8DAA8D;IAC9D,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAE1B,+CAA+C;IAC/C,qCAAgB,CAAA;IAChB,4CAAuB,CAAA;AACzB,CAAC,EAlBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAkB5B;AAkDD,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,oDAAiC,CAAA;IACjC,iDAA8B,CAAA;IAC9B,2CAAwB,CAAA;IACxB,gDAA6B,CAAA;IAC7B,iDAA8B,CAAA;IAC9B,uCAAoB,CAAA;AACtB,CAAC,EAPW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAO1B;AAWD;;;GAGG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,0CAAsB,CAAA;IACtB,qDAAiC,CAAA;IACjC,8CAA0B,CAAA;AAC5B,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B","sourcesContent":["import { BaseEvent } from './base-event';\n\nexport interface Identify {\n getUserProperties(): IdentifyUserProperties;\n set(property: string, value: ValidPropertyType): Identify;\n setOnce(property: string, value: ValidPropertyType): Identify;\n append(property: string, value: ValidPropertyType): Identify;\n prepend(property: string, value: ValidPropertyType): Identify;\n postInsert(property: string, value: ValidPropertyType): Identify;\n preInsert(property: string, value: ValidPropertyType): Identify;\n remove(property: string, value: ValidPropertyType): Identify;\n add(property: string, value: number): Identify;\n unset(property: string): Identify;\n clearAll(): Identify;\n}\n\nexport enum IdentifyOperation {\n // Base Operations to set values\n SET = '$set',\n SET_ONCE = '$setOnce',\n\n // Operations around modifying existing values\n ADD = '$add',\n APPEND = '$append',\n PREPEND = '$prepend',\n REMOVE = '$remove',\n\n // Operations around appending values *if* they aren't present\n PREINSERT = '$preInsert',\n POSTINSERT = '$postInsert',\n\n // Operations around removing properties/values\n UNSET = '$unset',\n CLEAR_ALL = '$clearAll',\n}\n\nexport type ValidPropertyType =\n | number\n | string\n | boolean\n | Array<string | number>\n | { [key: string]: ValidPropertyType }\n | Array<{ [key: string]: ValidPropertyType }>;\n\ninterface BaseOperationConfig {\n [key: string]: ValidPropertyType;\n}\n\nexport interface IdentifyUserProperties {\n // Add operations can only take numbers\n [IdentifyOperation.ADD]?: { [key: string]: number };\n\n // This reads the keys of the passed object, but the values are not used\n [IdentifyOperation.UNSET]?: BaseOperationConfig;\n // This option does not read the key as it unsets all user properties\n [IdentifyOperation.CLEAR_ALL]?: any;\n\n // These operations can take numbers, strings, or arrays of both.\n [IdentifyOperation.SET]?: BaseOperationConfig;\n [IdentifyOperation.SET_ONCE]?: BaseOperationConfig;\n [IdentifyOperation.APPEND]?: BaseOperationConfig;\n [IdentifyOperation.PREPEND]?: BaseOperationConfig;\n [IdentifyOperation.POSTINSERT]?: BaseOperationConfig;\n [IdentifyOperation.PREINSERT]?: BaseOperationConfig;\n [IdentifyOperation.REMOVE]?: BaseOperationConfig;\n}\n\nexport type UserProperties =\n | IdentifyUserProperties\n | {\n [key in Exclude<string, IdentifyOperation>]: any;\n };\n\nexport interface Revenue {\n getEventProperties(): RevenueEventProperties;\n setProductId(productId: string): Revenue;\n setQuantity(quantity: number): Revenue;\n setPrice(price: number): Revenue;\n setRevenueType(revenueType: string): Revenue;\n setCurrency(currency: string): Revenue;\n setEventProperties(properties: { [key: string]: any }): Revenue;\n setRevenue(revenue: number): Revenue;\n}\n\nexport enum RevenueProperty {\n REVENUE_PRODUCT_ID = '$productId',\n REVENUE_QUANTITY = '$quantity',\n REVENUE_PRICE = '$price',\n REVENUE_TYPE = '$revenueType',\n REVENUE_CURRENCY = '$currency',\n REVENUE = '$revenue',\n}\n\nexport interface RevenueEventProperties {\n [RevenueProperty.REVENUE_PRODUCT_ID]?: string;\n [RevenueProperty.REVENUE_QUANTITY]?: number;\n [RevenueProperty.REVENUE_PRICE]?: number;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE_CURRENCY]?: string;\n [RevenueProperty.REVENUE]?: number;\n}\n\n/**\n * Strings that have special meaning when used as an event's type\n * and have different specifications.\n */\nexport enum SpecialEventType {\n IDENTIFY = '$identify',\n GROUP_IDENTIFY = '$groupidentify',\n REVENUE = 'revenue_amount',\n}\n\nexport interface TrackEvent extends BaseEvent {\n event_type: Exclude<string, SpecialEventType>;\n}\n\nexport interface IdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.IDENTIFY;\n user_properties: UserProperties;\n}\n\nexport interface GroupIdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.GROUP_IDENTIFY;\n group_properties: UserProperties;\n}\n\nexport interface RevenueEvent extends BaseEvent {\n event_type: SpecialEventType.REVENUE;\n event_properties:\n | RevenueEventProperties\n | {\n [key: string]: any;\n };\n}\n\nexport type Event = TrackEvent | IdentifyEvent | GroupIdentifyEvent | RevenueEvent;\n"]}
package/lib/cjs/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.DEFAULT_ACTION_CLICK_ALLOWLIST = exports.DEFAULT_DATA_ATTRIBUTE_PREFIX = exports.DEFAULT_CSS_SELECTOR_ALLOWLIST = exports.OfflineDisabled = exports.Status = exports.ServerZone = exports.LogLevel = exports.RevenueProperty = exports.IdentifyOperation = exports.SpecialEventType = void 0;
3
4
  var event_1 = require("./event");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAkCA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,+DAOgC;AAH9B,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA;AAC7B,sIAAA,8BAA8B,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n} from './element-interactions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAkCA,iCAciB;AATf,yGAAA,gBAAgB,OAAA;AAChB,0GAAA,iBAAiB,OAAA;AAMjB,wGAAA,eAAe,OAAA;AAKjB,mCAAqE;AAApD,kGAAA,QAAQ,OAAA;AAQzB,6CAA2D;AAAlD,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAMf,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,+DAOgC;AAH9B,sIAAA,8BAA8B,OAAA;AAC9B,qIAAA,6BAA6B,OAAA;AAC7B,sIAAA,8BAA8B,OAAA","sourcesContent":["export { AmplitudeReturn } from './amplitude-promise';\nexport { BaseEvent, EventOptions } from './base-event';\nexport {\n Campaign,\n CampaignParser,\n CampaignTracker,\n CampaignTrackerOptions,\n CampaignTrackFunction,\n ClickIdParameters,\n ReferrerParameters,\n UTMParameters,\n} from './campaign';\nexport { BrowserClient, ReactNativeClient, NodeClient } from './client';\nexport {\n AttributionOptions,\n AutocaptureOptions,\n BrowserConfig,\n BrowserOptions,\n Config,\n DefaultTrackingOptions,\n Options,\n NodeConfig,\n NodeOptions,\n ReactNativeConfig,\n ReactNativeOptions,\n ReactNativeTrackingOptions,\n TrackingOptions,\n RequestMetadata,\n HistogramOptions,\n HistogramKey,\n BrowserRemoteConfig,\n} from './config';\nexport { CoreClient } from './client/core-client';\nexport { DestinationContext } from './destination-context';\nexport {\n Event,\n TrackEvent,\n IdentifyEvent,\n GroupIdentifyEvent,\n SpecialEventType,\n IdentifyOperation,\n IdentifyUserProperties,\n ValidPropertyType,\n Identify,\n Revenue,\n RevenueEvent,\n RevenueProperty,\n RevenueEventProperties,\n} from './event';\nexport { EventCallback } from './event-callback';\nexport { EventBridge, EventBridgeChannel, EventBridgeContainer, EventBridgeReceiver } from './event-bridge';\nexport { Logger, LogLevel, LogConfig, DebugContext } from './logger';\nexport { Payload } from './payload';\nexport { Plan } from './plan';\nexport { IngestionMetadata } from './ingestion-metadata';\nexport { Plugin, BeforePlugin, EnrichmentPlugin, DestinationPlugin, PluginType } from './plugin';\nexport { Result } from './result';\nexport { Response, SuccessResponse, InvalidResponse, PayloadTooLargeResponse, RateLimitResponse } from './response';\nexport { QueueProxy, InstanceProxy } from './proxy';\nexport { ServerZone, ServerZoneType } from './server-zone';\nexport { Status } from './status';\nexport { CookieStorageOptions, IdentityStorageType, Storage } from './storage';\nexport { Transport, TransportType } from './transport';\nexport { UserSession } from './user-session';\nexport { UTMData } from './utm';\nexport { PageTrackingOptions, PageTrackingTrackOn, PageTrackingHistoryChanges } from './page-view-tracking';\nexport { OfflineDisabled } from './offline';\nexport {\n Messenger,\n ElementInteractionsOptions,\n ActionType,\n DEFAULT_CSS_SELECTOR_ALLOWLIST,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_ACTION_CLICK_ALLOWLIST,\n} from './element-interactions';\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=ingestion-metadata.js.map
package/lib/cjs/logger.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.LogLevel = void 0;
3
4
  var LogLevel;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";;AASA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,6CAAW,CAAA;IACX,yCAAS,CAAA;AACX,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB","sourcesContent":["export interface Logger {\n disable(): void;\n enable(logLevel: LogLevel): void;\n log(...args: any[]): void;\n warn(...args: any[]): void;\n error(...args: any[]): void;\n debug(...args: any[]): void;\n}\n\nexport enum LogLevel {\n None = 0,\n Error = 1,\n Warn = 2,\n Verbose = 3,\n Debug = 4,\n}\n\nexport interface LogConfig {\n logger: Logger;\n logLevel: LogLevel;\n}\n\ntype TimeKey = 'start' | 'end';\n\nexport interface DebugContext {\n type: string;\n name: string;\n args: string[] | string;\n stacktrace?: string[] | string;\n time?: { [key in TimeKey]?: string };\n states?: { [key: string]: any };\n}\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";;;AASA,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,6CAAW,CAAA;IACX,yCAAS,CAAA;AACX,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB","sourcesContent":["export interface Logger {\n disable(): void;\n enable(logLevel: LogLevel): void;\n log(...args: any[]): void;\n warn(...args: any[]): void;\n error(...args: any[]): void;\n debug(...args: any[]): void;\n}\n\nexport enum LogLevel {\n None = 0,\n Error = 1,\n Warn = 2,\n Verbose = 3,\n Debug = 4,\n}\n\nexport interface LogConfig {\n logger: Logger;\n logLevel: LogLevel;\n}\n\ntype TimeKey = 'start' | 'end';\n\nexport interface DebugContext {\n type: string;\n name: string;\n args: string[] | string;\n stacktrace?: string[] | string;\n time?: { [key in TimeKey]?: string };\n states?: { [key: string]: any };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.OfflineDisabled = void 0;
3
4
  exports.OfflineDisabled = null;
@@ -1 +1 @@
1
- {"version":3,"file":"offline.js","sourceRoot":"","sources":["../../src/offline.ts"],"names":[],"mappings":";;AAAa,QAAA,eAAe,GAAG,IAAI,CAAC","sourcesContent":["export const OfflineDisabled = null;\n"]}
1
+ {"version":3,"file":"offline.js","sourceRoot":"","sources":["../../src/offline.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,IAAI,CAAC","sourcesContent":["export const OfflineDisabled = null;\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=page-view-tracking.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=payload.js.map
package/lib/cjs/plan.js CHANGED
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=plan.js.map
package/lib/cjs/plugin.js CHANGED
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=plugin.js.map
package/lib/cjs/proxy.js CHANGED
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=proxy.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=response.js.map
package/lib/cjs/result.js CHANGED
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=result.js.map
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.ServerZone = void 0;
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"server-zone.js","sourceRoot":"","sources":["../../src/server-zone.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uBAAS,CAAA;IACT,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB","sourcesContent":["/**\n * @deprecated use ServerZoneType instead\n */\nexport enum ServerZone {\n US = 'US',\n EU = 'EU',\n}\n\nexport type ServerZoneType = 'US' | 'EU';\n"]}
1
+ {"version":3,"file":"server-zone.js","sourceRoot":"","sources":["../../src/server-zone.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uBAAS,CAAA;IACT,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB","sourcesContent":["/**\n * @deprecated use ServerZoneType instead\n */\nexport enum ServerZone {\n US = 'US',\n EU = 'EU',\n}\n\nexport type ServerZoneType = 'US' | 'EU';\n"]}
package/lib/cjs/status.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.Status = void 0;
3
4
  /** The status of an event. */
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":";;AAAA,8BAA8B;AAC9B,IAAY,MAmBX;AAnBD,WAAY,MAAM;IAChB,0CAA0C;IAC1C,6BAAmB,CAAA;IACnB,+DAA+D;IAC/D,6BAAmB,CAAA;IACnB,uCAAuC;IACvC,6BAAmB,CAAA;IACnB,4FAA4F;IAC5F,kCAAwB,CAAA;IACxB,sDAAsD;IACtD,+CAAqC,CAAA;IACrC,wCAAwC;IACxC,6BAAmB,CAAA;IACnB,qDAAqD;IACrD,2BAAiB,CAAA;IACjB,4FAA4F;IAC5F,6BAAmB,CAAA;IACnB,wEAAwE;IACxE,qCAA2B,CAAA;AAC7B,CAAC,EAnBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAmBjB","sourcesContent":["/** The status of an event. */\nexport enum Status {\n /** The status could not be determined. */\n Unknown = 'unknown',\n /** The event was skipped due to configuration or callbacks. */\n Skipped = 'skipped',\n /** The event was sent successfully. */\n Success = 'success',\n /** A user or device in the payload is currently rate limited and should try again later. */\n RateLimit = 'rate_limit',\n /** The sent payload was too large to be processed. */\n PayloadTooLarge = 'payload_too_large',\n /** The event could not be processed. */\n Invalid = 'invalid',\n /** A server-side error ocurred during submission. */\n Failed = 'failed',\n /** a server or client side error occuring when a request takes too long and is cancelled */\n Timeout = 'Timeout',\n /** NodeJS runtime environment error.. E.g. disconnected from network */\n SystemError = 'SystemError',\n}\n"]}
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAC9B,IAAY,MAmBX;AAnBD,WAAY,MAAM;IAChB,0CAA0C;IAC1C,6BAAmB,CAAA;IACnB,+DAA+D;IAC/D,6BAAmB,CAAA;IACnB,uCAAuC;IACvC,6BAAmB,CAAA;IACnB,4FAA4F;IAC5F,kCAAwB,CAAA;IACxB,sDAAsD;IACtD,+CAAqC,CAAA;IACrC,wCAAwC;IACxC,6BAAmB,CAAA;IACnB,qDAAqD;IACrD,2BAAiB,CAAA;IACjB,4FAA4F;IAC5F,6BAAmB,CAAA;IACnB,wEAAwE;IACxE,qCAA2B,CAAA;AAC7B,CAAC,EAnBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAmBjB","sourcesContent":["/** The status of an event. */\nexport enum Status {\n /** The status could not be determined. */\n Unknown = 'unknown',\n /** The event was skipped due to configuration or callbacks. */\n Skipped = 'skipped',\n /** The event was sent successfully. */\n Success = 'success',\n /** A user or device in the payload is currently rate limited and should try again later. */\n RateLimit = 'rate_limit',\n /** The sent payload was too large to be processed. */\n PayloadTooLarge = 'payload_too_large',\n /** The event could not be processed. */\n Invalid = 'invalid',\n /** A server-side error ocurred during submission. */\n Failed = 'failed',\n /** a server or client side error occuring when a request takes too long and is cancelled */\n Timeout = 'Timeout',\n /** NodeJS runtime environment error.. E.g. disconnected from network */\n SystemError = 'SystemError',\n}\n"]}
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=storage.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=transport.js.map
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=user-session.js.map
package/lib/cjs/utm.js CHANGED
@@ -1,2 +1,3 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=utm.js.map
@@ -11,9 +11,6 @@ export interface BaseEvent extends EventOptions {
11
11
  group_properties?: {
12
12
  [key: string]: any;
13
13
  } | undefined;
14
- groups?: {
15
- [key: string]: any;
16
- } | undefined;
17
14
  }
18
15
  export interface EventOptions {
19
16
  user_id?: string;
@@ -46,6 +43,7 @@ export interface EventOptions {
46
43
  revenue?: number;
47
44
  productId?: string;
48
45
  revenueType?: string;
46
+ currency?: string;
49
47
  event_id?: number;
50
48
  session_id?: number;
51
49
  insert_id?: string;
@@ -57,5 +55,8 @@ export interface EventOptions {
57
55
  extra?: {
58
56
  [key: string]: any;
59
57
  };
58
+ groups?: {
59
+ [key: string]: any;
60
+ } | undefined;
60
61
  }
61
62
  //# sourceMappingURL=base-event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-event.d.ts","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,WAAW,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M,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kBAAkB,CAAC,EAAE,8BAA8B,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,SAAS,CAAC;CAC7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-event.js","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"","sourcesContent":["import { Plan } from './plan';\nimport { IngestionMetadataEventProperty } from './ingestion-metadata';\n\nexport interface BaseEvent extends EventOptions {\n event_type: string;\n event_properties?: { [key: string]: any } | undefined;\n user_properties?: { [key: string]: any } | undefined;\n group_properties?: { [key: string]: any } | undefined;\n groups?: { [key: string]: any } | undefined;\n}\n\nexport interface EventOptions {\n user_id?: string;\n device_id?: string;\n time?: number;\n location_lat?: number;\n location_lng?: number;\n app_version?: string;\n version_name?: string;\n library?: string;\n platform?: string;\n os_name?: string;\n os_version?: string;\n device_brand?: string;\n device_manufacturer?: string;\n device_model?: string;\n carrier?: string;\n country?: string;\n region?: string;\n city?: string;\n dma?: string;\n idfa?: string;\n idfv?: string;\n adid?: string;\n android_id?: string;\n language?: string;\n ip?: string;\n price?: number;\n quantity?: number;\n revenue?: number;\n productId?: string;\n revenueType?: string;\n event_id?: number;\n session_id?: number;\n insert_id?: string;\n plan?: Plan;\n ingestion_metadata?: IngestionMetadataEventProperty;\n partner_id?: string;\n user_agent?: string;\n android_app_set_id?: string;\n extra?: { [key: string]: any };\n}\n"]}
1
+ {"version":3,"file":"base-event.js","sourceRoot":"","sources":["../../src/base-event.ts"],"names":[],"mappings":"","sourcesContent":["import { Plan } from './plan';\nimport { IngestionMetadataEventProperty } from './ingestion-metadata';\n\nexport interface BaseEvent extends EventOptions {\n event_type: string;\n event_properties?: { [key: string]: any } | undefined;\n user_properties?: { [key: string]: any } | undefined;\n group_properties?: { [key: string]: any } | undefined;\n}\n\nexport interface EventOptions {\n user_id?: string;\n device_id?: string;\n time?: number;\n location_lat?: number;\n location_lng?: number;\n app_version?: string;\n version_name?: string;\n library?: string;\n platform?: string;\n os_name?: string;\n os_version?: string;\n device_brand?: string;\n device_manufacturer?: string;\n device_model?: string;\n carrier?: string;\n country?: string;\n region?: string;\n city?: string;\n dma?: string;\n idfa?: string;\n idfv?: string;\n adid?: string;\n android_id?: string;\n language?: string;\n ip?: string;\n price?: number;\n quantity?: number;\n revenue?: number;\n productId?: string;\n revenueType?: string;\n currency?: string;\n event_id?: number;\n session_id?: number;\n insert_id?: string;\n plan?: Plan;\n ingestion_metadata?: IngestionMetadataEventProperty;\n partner_id?: string;\n user_agent?: string;\n android_app_set_id?: string;\n extra?: { [key: string]: any };\n groups?: { [key: string]: any } | undefined;\n}\n"]}
@@ -160,7 +160,7 @@ export interface TrackingOptions {
160
160
  */
161
161
  language?: boolean;
162
162
  /**
163
- * Enables/disables plantform tracking.
163
+ * Enables/disables platform tracking.
164
164
  * @defaultValue `true`
165
165
  */
166
166
  platform?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: 'fetch' | 'xhr' | 'beacon';\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables plantform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/browser.ts"],"names":[],"mappings":"","sourcesContent":["import { UserSession } from '../user-session';\nimport { IdentityStorageType, Storage } from '../storage';\nimport { Transport } from '../transport';\nimport { Config } from './core';\nimport { PageTrackingOptions } from '../page-view-tracking';\nimport { ElementInteractionsOptions } from '../element-interactions';\n\nexport interface BrowserConfig extends ExternalBrowserConfig, InternalBrowserConfig {}\n\nexport interface ExternalBrowserConfig extends Config {\n /**\n * An app version for events tracked. This can be the version of your application.\n * @defaultValue `undefined`\n */\n appVersion?: string;\n /**\n * @deprecated This property is deprecated and will be removed in future versions. Please migrate to using `autocapture` instead.\n * The default event tracking configuration.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.\n * @defaultValue `true`\n */\n defaultTracking?: boolean | DefaultTrackingOptions;\n /**\n * The configurations for auto-captured events.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/autocapture/}.\n */\n autocapture?: boolean | AutocaptureOptions;\n /**\n * The identifier for the device running your application.\n * @defaultValue `UUID()`\n */\n deviceId?: string;\n /**\n * Configuration for cookie.\n */\n cookieOptions?: CookieOptions;\n /**\n * The storage for user identify.\n * @defaultValue `\"cookie\"`\n */\n identityStorage?: IdentityStorageType;\n /**\n * The partner identifier.\n * Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.\n * @defaultValue `undefined`\n */\n partnerId?: string;\n /**\n * The custom Session ID for the current session.\n * @defaultValue `timestamp`\n */\n sessionId?: number;\n /**\n * The period of inactivity from the last tracked event before a session expires in milliseconds.\n * @defaultValue `1,800,000` (30 minutes)\n */\n sessionTimeout: number;\n /**\n * The configurations for tracking additional properties.\n * See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.\n */\n trackingOptions: TrackingOptions;\n /**\n * Network transport mechanism used to send events.\n * @defaultValue `\"fetch\"`\n */\n transport?: 'fetch' | 'xhr' | 'beacon';\n /**\n * The identifier for the user being tracked.\n * @defaultValue `undefined`\n */\n userId?: string;\n /**\n * User's Nth instance of performing a default Page Viewed event within a session.\n * Used for landing page analysis.\n */\n pageCounter?: number;\n /**\n * Whether to fetch remote configuration.\n * @defaultValue `false`\n */\n fetchRemoteConfig?: boolean;\n}\n\ninterface InternalBrowserConfig {\n cookieStorage: Storage<UserSession>;\n lastEventTime?: number;\n lastEventId?: number;\n transportProvider: Transport;\n}\n\n/**\n * @deprecated This interface is deprecated and will be removed in future versions. Please migrate to using `AutocaptureOptions` instead.\n */\nexport interface DefaultTrackingOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n}\n\nexport interface AutocaptureOptions {\n /**\n * Enables/disables marketing attribution tracking or config with detailed attribution options.\n * @defaultValue `true`\n */\n attribution?: boolean | AttributionOptions;\n /**\n * Enables/disables form downloads tracking.\n * @defaultValue `true`\n */\n fileDownloads?: boolean;\n /**\n * Enables/disables form interaction tracking.\n * @defaultValue `true`\n */\n formInteractions?: boolean;\n /**\n * Enables/disables default page view tracking.\n * @defaultValue `true`\n */\n pageViews?: boolean | PageTrackingOptions;\n /**\n * Enables/disables session tracking.\n * @defaultValue `true`\n */\n sessions?: boolean;\n /**\n * Enables/disables user interactions tracking.\n * @defaultValue `false`\n */\n elementInteractions?: boolean | ElementInteractionsOptions;\n}\n\nexport interface TrackingOptions {\n /**\n * Enables/disables ip address tracking.\n * @defaultValue `true`\n */\n ipAddress?: boolean;\n /**\n * Enables/disables language tracking.\n * @defaultValue `true`\n */\n language?: boolean;\n /**\n * Enables/disables platform tracking.\n * @defaultValue `true`\n */\n platform?: boolean;\n}\n\nexport interface AttributionOptions {\n /**\n * The rules to determine which referrers are excluded from being tracked as traffic source.\n * @defaultValue `[/your-domain\\.com$/]`\n */\n excludeReferrers?: (string | RegExp)[];\n /**\n * The value to represent undefined/no initial campaign parameter for first-touch attribution.\n * @defaultValue `\"EMPTY\"`\n */\n initialEmptyValue?: string;\n /**\n * The flag of if Amplitude to start a new session if any campaign parameter changes.\n * @defaultValue `false`\n */\n resetSessionOnNewCampaign?: boolean;\n}\n\nexport interface CookieOptions {\n /**\n * The domain property of cookies created.\n * @defaultValue `Your top level domain`\n */\n domain?: string;\n /**\n * The expiration of cookies created in days.\n * @defaultValue `365`\n */\n expiration?: number;\n /**\n * How cookies are sent with cross-site requests.\n * @defaultValue `\"Lax\"`\n */\n sameSite?: 'Strict' | 'Lax' | 'None';\n /**\n * The flag of if send cookies over secure protocols.\n * @defaultValue `false`\n */\n secure?: boolean;\n /**\n * The flag of if upgrade the cookies created by maintenance Browser SDK.\n * @defaultValue `true`\n */\n upgrade?: boolean;\n}\n\ntype HiddenOptions = 'apiKey' | 'transportProvider' | 'requestMetadata';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BrowserOptions extends Omit<Partial<ExternalBrowserConfig>, HiddenOptions> {}\n\nexport type BrowserRemoteConfig = {\n browserSDK: {\n autocapture?: AutocaptureOptions | boolean;\n };\n};\n"]}
@@ -55,6 +55,7 @@ export interface Revenue {
55
55
  setQuantity(quantity: number): Revenue;
56
56
  setPrice(price: number): Revenue;
57
57
  setRevenueType(revenueType: string): Revenue;
58
+ setCurrency(currency: string): Revenue;
58
59
  setEventProperties(properties: {
59
60
  [key: string]: any;
60
61
  }): Revenue;
@@ -65,6 +66,7 @@ export declare enum RevenueProperty {
65
66
  REVENUE_QUANTITY = "$quantity",
66
67
  REVENUE_PRICE = "$price",
67
68
  REVENUE_TYPE = "$revenueType",
69
+ REVENUE_CURRENCY = "$currency",
68
70
  REVENUE = "$revenue"
69
71
  }
70
72
  export interface RevenueEventProperties {
@@ -72,7 +74,7 @@ export interface RevenueEventProperties {
72
74
  [RevenueProperty.REVENUE_QUANTITY]?: number;
73
75
  [RevenueProperty.REVENUE_PRICE]?: number;
74
76
  [RevenueProperty.REVENUE_TYPE]?: string;
75
- [RevenueProperty.REVENUE_TYPE]?: string;
77
+ [RevenueProperty.REVENUE_CURRENCY]?: string;
76
78
  [RevenueProperty.REVENUE]?: number;
77
79
  }
78
80
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,QAAQ;IACvB,iBAAiB,IAAI,sBAAsB,CAAC;IAC5C,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC1D,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;IAC9D,MAAM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AW,kBAAmB,SAAQ,SAAS;IACnD,UAAU,EAAE,gBAAgB,CAAC,cAAc,CAAC;IAC5C,gBAAgB,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACrC,gBAAgB,EACZ,sBAAsB,GACtB;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACP;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,aAAa,GAAG,kBAAkB,GAAG,YAAY,CAAC"}
package/lib/esm/event.js CHANGED
@@ -21,6 +21,7 @@ export var RevenueProperty;
21
21
  RevenueProperty["REVENUE_QUANTITY"] = "$quantity";
22
22
  RevenueProperty["REVENUE_PRICE"] = "$price";
23
23
  RevenueProperty["REVENUE_TYPE"] = "$revenueType";
24
+ RevenueProperty["REVENUE_CURRENCY"] = "$currency";
24
25
  RevenueProperty["REVENUE"] = "$revenue";
25
26
  })(RevenueProperty || (RevenueProperty = {}));
26
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,gCAAgC;IAChC,iCAAY,CAAA;IACZ,0CAAqB,CAAA;IAErB,8CAA8C;IAC9C,iCAAY,CAAA;IACZ,uCAAkB,CAAA;IAClB,yCAAoB,CAAA;IACpB,uCAAkB,CAAA;IAElB,8DAA8D;IAC9D,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAE1B,+CAA+C;IAC/C,qCAAgB,CAAA;IAChB,4CAAuB,CAAA;AACzB,CAAC,EAlBW,iBAAiB,KAAjB,iBAAiB,QAkB5B;AAiDD,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,oDAAiC,CAAA;IACjC,iDAA8B,CAAA;IAC9B,2CAAwB,CAAA;IACxB,gDAA6B,CAAA;IAC7B,uCAAoB,CAAA;AACtB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAWD;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,0CAAsB,CAAA;IACtB,qDAAiC,CAAA;IACjC,8CAA0B,CAAA;AAC5B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B","sourcesContent":["import { BaseEvent } from './base-event';\n\nexport interface Identify {\n getUserProperties(): IdentifyUserProperties;\n set(property: string, value: ValidPropertyType): Identify;\n setOnce(property: string, value: ValidPropertyType): Identify;\n append(property: string, value: ValidPropertyType): Identify;\n prepend(property: string, value: ValidPropertyType): Identify;\n postInsert(property: string, value: ValidPropertyType): Identify;\n preInsert(property: string, value: ValidPropertyType): Identify;\n remove(property: string, value: ValidPropertyType): Identify;\n add(property: string, value: number): Identify;\n unset(property: string): Identify;\n clearAll(): Identify;\n}\n\nexport enum IdentifyOperation {\n // Base Operations to set values\n SET = '$set',\n SET_ONCE = '$setOnce',\n\n // Operations around modifying existing values\n ADD = '$add',\n APPEND = '$append',\n PREPEND = '$prepend',\n REMOVE = '$remove',\n\n // Operations around appending values *if* they aren't present\n PREINSERT = '$preInsert',\n POSTINSERT = '$postInsert',\n\n // Operations around removing properties/values\n UNSET = '$unset',\n CLEAR_ALL = '$clearAll',\n}\n\nexport type ValidPropertyType =\n | number\n | string\n | boolean\n | Array<string | number>\n | { [key: string]: ValidPropertyType }\n | Array<{ [key: string]: ValidPropertyType }>;\n\ninterface BaseOperationConfig {\n [key: string]: ValidPropertyType;\n}\n\nexport interface IdentifyUserProperties {\n // Add operations can only take numbers\n [IdentifyOperation.ADD]?: { [key: string]: number };\n\n // This reads the keys of the passed object, but the values are not used\n [IdentifyOperation.UNSET]?: BaseOperationConfig;\n // This option does not read the key as it unsets all user properties\n [IdentifyOperation.CLEAR_ALL]?: any;\n\n // These operations can take numbers, strings, or arrays of both.\n [IdentifyOperation.SET]?: BaseOperationConfig;\n [IdentifyOperation.SET_ONCE]?: BaseOperationConfig;\n [IdentifyOperation.APPEND]?: BaseOperationConfig;\n [IdentifyOperation.PREPEND]?: BaseOperationConfig;\n [IdentifyOperation.POSTINSERT]?: BaseOperationConfig;\n [IdentifyOperation.PREINSERT]?: BaseOperationConfig;\n [IdentifyOperation.REMOVE]?: BaseOperationConfig;\n}\n\nexport type UserProperties =\n | IdentifyUserProperties\n | {\n [key in Exclude<string, IdentifyOperation>]: any;\n };\n\nexport interface Revenue {\n getEventProperties(): RevenueEventProperties;\n setProductId(productId: string): Revenue;\n setQuantity(quantity: number): Revenue;\n setPrice(price: number): Revenue;\n setRevenueType(revenueType: string): Revenue;\n setEventProperties(properties: { [key: string]: any }): Revenue;\n setRevenue(revenue: number): Revenue;\n}\n\nexport enum RevenueProperty {\n REVENUE_PRODUCT_ID = '$productId',\n REVENUE_QUANTITY = '$quantity',\n REVENUE_PRICE = '$price',\n REVENUE_TYPE = '$revenueType',\n REVENUE = '$revenue',\n}\n\nexport interface RevenueEventProperties {\n [RevenueProperty.REVENUE_PRODUCT_ID]?: string;\n [RevenueProperty.REVENUE_QUANTITY]?: number;\n [RevenueProperty.REVENUE_PRICE]?: number;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE]?: number;\n}\n\n/**\n * Strings that have special meaning when used as an event's type\n * and have different specifications.\n */\nexport enum SpecialEventType {\n IDENTIFY = '$identify',\n GROUP_IDENTIFY = '$groupidentify',\n REVENUE = 'revenue_amount',\n}\n\nexport interface TrackEvent extends BaseEvent {\n event_type: Exclude<string, SpecialEventType>;\n}\n\nexport interface IdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.IDENTIFY;\n user_properties: UserProperties;\n}\n\nexport interface GroupIdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.GROUP_IDENTIFY;\n group_properties: UserProperties;\n}\n\nexport interface RevenueEvent extends BaseEvent {\n event_type: SpecialEventType.REVENUE;\n event_properties:\n | RevenueEventProperties\n | {\n [key: string]: any;\n };\n}\n\nexport type Event = TrackEvent | IdentifyEvent | GroupIdentifyEvent | RevenueEvent;\n"]}
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,iBAkBX;AAlBD,WAAY,iBAAiB;IAC3B,gCAAgC;IAChC,iCAAY,CAAA;IACZ,0CAAqB,CAAA;IAErB,8CAA8C;IAC9C,iCAAY,CAAA;IACZ,uCAAkB,CAAA;IAClB,yCAAoB,CAAA;IACpB,uCAAkB,CAAA;IAElB,8DAA8D;IAC9D,6CAAwB,CAAA;IACxB,+CAA0B,CAAA;IAE1B,+CAA+C;IAC/C,qCAAgB,CAAA;IAChB,4CAAuB,CAAA;AACzB,CAAC,EAlBW,iBAAiB,KAAjB,iBAAiB,QAkB5B;AAkDD,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,oDAAiC,CAAA;IACjC,iDAA8B,CAAA;IAC9B,2CAAwB,CAAA;IACxB,gDAA6B,CAAA;IAC7B,iDAA8B,CAAA;IAC9B,uCAAoB,CAAA;AACtB,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAWD;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,0CAAsB,CAAA;IACtB,qDAAiC,CAAA;IACjC,8CAA0B,CAAA;AAC5B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B","sourcesContent":["import { BaseEvent } from './base-event';\n\nexport interface Identify {\n getUserProperties(): IdentifyUserProperties;\n set(property: string, value: ValidPropertyType): Identify;\n setOnce(property: string, value: ValidPropertyType): Identify;\n append(property: string, value: ValidPropertyType): Identify;\n prepend(property: string, value: ValidPropertyType): Identify;\n postInsert(property: string, value: ValidPropertyType): Identify;\n preInsert(property: string, value: ValidPropertyType): Identify;\n remove(property: string, value: ValidPropertyType): Identify;\n add(property: string, value: number): Identify;\n unset(property: string): Identify;\n clearAll(): Identify;\n}\n\nexport enum IdentifyOperation {\n // Base Operations to set values\n SET = '$set',\n SET_ONCE = '$setOnce',\n\n // Operations around modifying existing values\n ADD = '$add',\n APPEND = '$append',\n PREPEND = '$prepend',\n REMOVE = '$remove',\n\n // Operations around appending values *if* they aren't present\n PREINSERT = '$preInsert',\n POSTINSERT = '$postInsert',\n\n // Operations around removing properties/values\n UNSET = '$unset',\n CLEAR_ALL = '$clearAll',\n}\n\nexport type ValidPropertyType =\n | number\n | string\n | boolean\n | Array<string | number>\n | { [key: string]: ValidPropertyType }\n | Array<{ [key: string]: ValidPropertyType }>;\n\ninterface BaseOperationConfig {\n [key: string]: ValidPropertyType;\n}\n\nexport interface IdentifyUserProperties {\n // Add operations can only take numbers\n [IdentifyOperation.ADD]?: { [key: string]: number };\n\n // This reads the keys of the passed object, but the values are not used\n [IdentifyOperation.UNSET]?: BaseOperationConfig;\n // This option does not read the key as it unsets all user properties\n [IdentifyOperation.CLEAR_ALL]?: any;\n\n // These operations can take numbers, strings, or arrays of both.\n [IdentifyOperation.SET]?: BaseOperationConfig;\n [IdentifyOperation.SET_ONCE]?: BaseOperationConfig;\n [IdentifyOperation.APPEND]?: BaseOperationConfig;\n [IdentifyOperation.PREPEND]?: BaseOperationConfig;\n [IdentifyOperation.POSTINSERT]?: BaseOperationConfig;\n [IdentifyOperation.PREINSERT]?: BaseOperationConfig;\n [IdentifyOperation.REMOVE]?: BaseOperationConfig;\n}\n\nexport type UserProperties =\n | IdentifyUserProperties\n | {\n [key in Exclude<string, IdentifyOperation>]: any;\n };\n\nexport interface Revenue {\n getEventProperties(): RevenueEventProperties;\n setProductId(productId: string): Revenue;\n setQuantity(quantity: number): Revenue;\n setPrice(price: number): Revenue;\n setRevenueType(revenueType: string): Revenue;\n setCurrency(currency: string): Revenue;\n setEventProperties(properties: { [key: string]: any }): Revenue;\n setRevenue(revenue: number): Revenue;\n}\n\nexport enum RevenueProperty {\n REVENUE_PRODUCT_ID = '$productId',\n REVENUE_QUANTITY = '$quantity',\n REVENUE_PRICE = '$price',\n REVENUE_TYPE = '$revenueType',\n REVENUE_CURRENCY = '$currency',\n REVENUE = '$revenue',\n}\n\nexport interface RevenueEventProperties {\n [RevenueProperty.REVENUE_PRODUCT_ID]?: string;\n [RevenueProperty.REVENUE_QUANTITY]?: number;\n [RevenueProperty.REVENUE_PRICE]?: number;\n [RevenueProperty.REVENUE_TYPE]?: string;\n [RevenueProperty.REVENUE_CURRENCY]?: string;\n [RevenueProperty.REVENUE]?: number;\n}\n\n/**\n * Strings that have special meaning when used as an event's type\n * and have different specifications.\n */\nexport enum SpecialEventType {\n IDENTIFY = '$identify',\n GROUP_IDENTIFY = '$groupidentify',\n REVENUE = 'revenue_amount',\n}\n\nexport interface TrackEvent extends BaseEvent {\n event_type: Exclude<string, SpecialEventType>;\n}\n\nexport interface IdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.IDENTIFY;\n user_properties: UserProperties;\n}\n\nexport interface GroupIdentifyEvent extends BaseEvent {\n event_type: SpecialEventType.GROUP_IDENTIFY;\n group_properties: UserProperties;\n}\n\nexport interface RevenueEvent extends BaseEvent {\n event_type: SpecialEventType.REVENUE;\n event_properties:\n | RevenueEventProperties\n | {\n [key: string]: any;\n };\n}\n\nexport type Event = TrackEvent | IdentifyEvent | GroupIdentifyEvent | RevenueEvent;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-types",
3
- "version": "2.8.4",
3
+ "version": "2.9.1",
4
4
  "description": "",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -35,5 +35,5 @@
35
35
  "files": [
36
36
  "lib"
37
37
  ],
38
- "gitHead": "368f7d32ddf547a14395cebcc2bbc4dee477acdb"
38
+ "gitHead": "f9ad87802cf6ba3a3787cc78b7c6191da41104ac"
39
39
  }