zixflow-reactnative 1.0.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/LICENSE +21 -0
- package/README.md +451 -0
- package/android/build.gradle +155 -0
- package/android/cio-core.gradle +12 -0
- package/android/consumer-rules.pro +3 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +19 -0
- package/android/src/main/java/io/customer/reactnative/sdk/CustomerIOReactNativePackage.kt +85 -0
- package/android/src/main/java/io/customer/reactnative/sdk/NativeCustomerIOModule.kt +201 -0
- package/android/src/main/java/io/customer/reactnative/sdk/constant/Keys.kt +20 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/MapExtensions.kt +92 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/ReactExtensions.kt +11 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/StringExtensions.kt +3 -0
- package/android/src/main/java/io/customer/reactnative/sdk/extension/ViewExtensions.kt +34 -0
- package/android/src/main/java/io/customer/reactnative/sdk/location/NativeLocationModule.kt +66 -0
- package/android/src/main/java/io/customer/reactnative/sdk/logging/NativeCustomerIOLoggingModule.kt +90 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/InlineInAppMessageViewManager.kt +56 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NativeMessagingInAppModule.kt +215 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/NotificationInboxExtensions.kt +23 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppEventListener.kt +77 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInAppPlatformDelegate.kt +37 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactInlineInAppMessageView.kt +44 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messaginginapp/ReactNotificationInboxChangeListener.kt +47 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/NativeMessagingPushModule.kt +283 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PermissionStatus.kt +9 -0
- package/android/src/main/java/io/customer/reactnative/sdk/messagingpush/PushMessagingExtensions.kt +58 -0
- package/android/src/main/java/io/customer/reactnative/sdk/util/Preconditions.kt +35 -0
- package/android/src/main/res/values/customer_io_config.xml +13 -0
- package/customerio-reactnative.podspec +60 -0
- package/ios/CustomerioReactnative.xcodeproj/project.pbxproj +285 -0
- package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/CustomerioReactnative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/wrappers/CustomerioReactnative-Bridging-Header.h +2 -0
- package/ios/wrappers/NativeCustomerIO.mm +100 -0
- package/ios/wrappers/NativeCustomerIO.swift +162 -0
- package/ios/wrappers/inapp/InboxMessage+Conversion.swift +22 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.mm +122 -0
- package/ios/wrappers/inapp/NativeMessagingInApp.swift +214 -0
- package/ios/wrappers/inapp/ReactInAppEventListener.swift +74 -0
- package/ios/wrappers/inapp/inline/InlineInAppMessageStateEvent.swift +23 -0
- package/ios/wrappers/inapp/inline/RCTInlineMessageNative.h +18 -0
- package/ios/wrappers/inapp/inline/RCTInlineMessageNative.mm +168 -0
- package/ios/wrappers/inapp/inline/ReactInlineMessageView.h +42 -0
- package/ios/wrappers/inapp/inline/ReactInlineMessageView.swift +124 -0
- package/ios/wrappers/location/NativeLocation.mm +52 -0
- package/ios/wrappers/location/NativeLocation.swift +37 -0
- package/ios/wrappers/logging/NativeCustomerIOLogging.mm +81 -0
- package/ios/wrappers/logging/NativeCustomerIOLogging.swift +62 -0
- package/ios/wrappers/push/NativeMessagingPush.mm +87 -0
- package/ios/wrappers/push/NativeMessagingPush.swift +119 -0
- package/ios/wrappers/utils/CioConfigUtils.swift +63 -0
- package/ios/wrappers/utils/CioConstants.swift +25 -0
- package/ios/wrappers/utils/Preconditions.swift +20 -0
- package/ios/wrappers/utils/RCTCustomerIOUtils.h +19 -0
- package/lib/commonjs/cio-params.js +2 -0
- package/lib/commonjs/cio-params.js.map +1 -0
- package/lib/commonjs/components/InlineInAppMessageView.js +146 -0
- package/lib/commonjs/components/InlineInAppMessageView.js.map +1 -0
- package/lib/commonjs/components/index.js +14 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/customerio-cdp.js +163 -0
- package/lib/commonjs/customerio-cdp.js.map +1 -0
- package/lib/commonjs/customerio-inapp.js +107 -0
- package/lib/commonjs/customerio-inapp.js.map +1 -0
- package/lib/commonjs/customerio-location.js +53 -0
- package/lib/commonjs/customerio-location.js.map +1 -0
- package/lib/commonjs/customerio-push.js +115 -0
- package/lib/commonjs/customerio-push.js.map +1 -0
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/native-logger-listener.js +84 -0
- package/lib/commonjs/native-logger-listener.js.map +1 -0
- package/lib/commonjs/notification-inbox.js +132 -0
- package/lib/commonjs/notification-inbox.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/postInstall.js +13 -0
- package/lib/commonjs/postInstall.js.map +1 -0
- package/lib/commonjs/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/lib/commonjs/specs/modules/NativeCustomerIO.js +40 -0
- package/lib/commonjs/specs/modules/NativeCustomerIO.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js +15 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLocation.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js +19 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOLogging.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js +16 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js +15 -0
- package/lib/commonjs/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
- package/lib/commonjs/types/data-pipelines.js +123 -0
- package/lib/commonjs/types/data-pipelines.js.map +1 -0
- package/lib/commonjs/types/in-app.js +43 -0
- package/lib/commonjs/types/in-app.js.map +1 -0
- package/lib/commonjs/types/index.js +39 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/internal.js +2 -0
- package/lib/commonjs/types/internal.js.map +1 -0
- package/lib/commonjs/types/push.js +49 -0
- package/lib/commonjs/types/push.js.map +1 -0
- package/lib/commonjs/utils/native-bridge.js +31 -0
- package/lib/commonjs/utils/native-bridge.js.map +1 -0
- package/lib/commonjs/utils/param-validation.js +136 -0
- package/lib/commonjs/utils/param-validation.js.map +1 -0
- package/lib/commonjs/zixflow.js +71 -0
- package/lib/commonjs/zixflow.js.map +1 -0
- package/lib/module/cio-params.js +2 -0
- package/lib/module/cio-params.js.map +1 -0
- package/lib/module/components/InlineInAppMessageView.js +141 -0
- package/lib/module/components/InlineInAppMessageView.js.map +1 -0
- package/lib/module/components/index.js +6 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/customerio-cdp.js +157 -0
- package/lib/module/customerio-cdp.js.map +1 -0
- package/lib/module/customerio-inapp.js +92 -0
- package/lib/module/customerio-inapp.js.map +1 -0
- package/lib/module/customerio-location.js +48 -0
- package/lib/module/customerio-location.js.map +1 -0
- package/lib/module/customerio-push.js +111 -0
- package/lib/module/customerio-push.js.map +1 -0
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native-logger-listener.js +79 -0
- package/lib/module/native-logger-listener.js.map +1 -0
- package/lib/module/notification-inbox.js +127 -0
- package/lib/module/notification-inbox.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/postInstall.js +13 -0
- package/lib/module/postInstall.js.map +1 -0
- package/lib/module/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/lib/module/specs/modules/NativeCustomerIO.js +41 -0
- package/lib/module/specs/modules/NativeCustomerIO.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOLocation.js +13 -0
- package/lib/module/specs/modules/NativeCustomerIOLocation.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOLogging.js +18 -0
- package/lib/module/specs/modules/NativeCustomerIOLogging.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js +15 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingInApp.js.map +1 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js +13 -0
- package/lib/module/specs/modules/NativeCustomerIOMessagingPush.js.map +1 -0
- package/lib/module/types/data-pipelines.js +126 -0
- package/lib/module/types/data-pipelines.js.map +1 -0
- package/lib/module/types/in-app.js +42 -0
- package/lib/module/types/in-app.js.map +1 -0
- package/lib/module/types/index.js +6 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/internal.js +2 -0
- package/lib/module/types/internal.js.map +1 -0
- package/lib/module/types/push.js +47 -0
- package/lib/module/types/push.js.map +1 -0
- package/lib/module/utils/native-bridge.js +25 -0
- package/lib/module/utils/native-bridge.js.map +1 -0
- package/lib/module/utils/param-validation.js +132 -0
- package/lib/module/utils/param-validation.js.map +1 -0
- package/lib/module/zixflow.js +23 -0
- package/lib/module/zixflow.js.map +1 -0
- package/lib/typescript/commonjs/cio-params.d.ts +5 -0
- package/lib/typescript/commonjs/cio-params.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts +41 -0
- package/lib/typescript/commonjs/components/InlineInAppMessageView.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-cdp.d.ts +40 -0
- package/lib/typescript/commonjs/customerio-cdp.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-inapp.d.ts +48 -0
- package/lib/typescript/commonjs/customerio-inapp.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-location.d.ts +31 -0
- package/lib/typescript/commonjs/customerio-location.d.ts.map +1 -0
- package/lib/typescript/commonjs/customerio-push.d.ts +56 -0
- package/lib/typescript/commonjs/customerio-push.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/native-logger-listener.d.ts +8 -0
- package/lib/typescript/commonjs/native-logger-listener.d.ts.map +1 -0
- package/lib/typescript/commonjs/notification-inbox.d.ts +57 -0
- package/lib/typescript/commonjs/notification-inbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/postInstall.d.ts +2 -0
- package/lib/typescript/commonjs/postInstall.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts +40 -0
- package/lib/typescript/commonjs/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts +46 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIO.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
- package/lib/typescript/commonjs/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/data-pipelines.d.ts +143 -0
- package/lib/typescript/commonjs/types/data-pipelines.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/in-app.d.ts +67 -0
- package/lib/typescript/commonjs/types/in-app.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/index.d.ts +4 -0
- package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/internal.d.ts +20 -0
- package/lib/typescript/commonjs/types/internal.d.ts.map +1 -0
- package/lib/typescript/commonjs/types/push.d.ts +49 -0
- package/lib/typescript/commonjs/types/push.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/native-bridge.d.ts +9 -0
- package/lib/typescript/commonjs/utils/native-bridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts +44 -0
- package/lib/typescript/commonjs/utils/param-validation.d.ts.map +1 -0
- package/lib/typescript/commonjs/zixflow.d.ts +14 -0
- package/lib/typescript/commonjs/zixflow.d.ts.map +1 -0
- package/lib/typescript/module/cio-params.d.ts +5 -0
- package/lib/typescript/module/cio-params.d.ts.map +1 -0
- package/lib/typescript/module/components/InlineInAppMessageView.d.ts +41 -0
- package/lib/typescript/module/components/InlineInAppMessageView.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/customerio-cdp.d.ts +40 -0
- package/lib/typescript/module/customerio-cdp.d.ts.map +1 -0
- package/lib/typescript/module/customerio-inapp.d.ts +48 -0
- package/lib/typescript/module/customerio-inapp.d.ts.map +1 -0
- package/lib/typescript/module/customerio-location.d.ts +31 -0
- package/lib/typescript/module/customerio-location.d.ts.map +1 -0
- package/lib/typescript/module/customerio-push.d.ts +56 -0
- package/lib/typescript/module/customerio-push.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +8 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/native-logger-listener.d.ts +8 -0
- package/lib/typescript/module/native-logger-listener.d.ts.map +1 -0
- package/lib/typescript/module/notification-inbox.d.ts +57 -0
- package/lib/typescript/module/notification-inbox.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/postInstall.d.ts +2 -0
- package/lib/typescript/module/postInstall.d.ts.map +1 -0
- package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts +40 -0
- package/lib/typescript/module/specs/components/InlineMessageNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts +46 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIO.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts +14 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLocation.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts +18 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOLogging.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts +23 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingInApp.d.ts.map +1 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts +20 -0
- package/lib/typescript/module/specs/modules/NativeCustomerIOMessagingPush.d.ts.map +1 -0
- package/lib/typescript/module/types/data-pipelines.d.ts +143 -0
- package/lib/typescript/module/types/data-pipelines.d.ts.map +1 -0
- package/lib/typescript/module/types/in-app.d.ts +67 -0
- package/lib/typescript/module/types/in-app.d.ts.map +1 -0
- package/lib/typescript/module/types/index.d.ts +4 -0
- package/lib/typescript/module/types/index.d.ts.map +1 -0
- package/lib/typescript/module/types/internal.d.ts +20 -0
- package/lib/typescript/module/types/internal.d.ts.map +1 -0
- package/lib/typescript/module/types/push.d.ts +49 -0
- package/lib/typescript/module/types/push.d.ts.map +1 -0
- package/lib/typescript/module/utils/native-bridge.d.ts +9 -0
- package/lib/typescript/module/utils/native-bridge.d.ts.map +1 -0
- package/lib/typescript/module/utils/param-validation.d.ts +44 -0
- package/lib/typescript/module/utils/param-validation.d.ts.map +1 -0
- package/lib/typescript/module/zixflow.d.ts +14 -0
- package/lib/typescript/module/zixflow.d.ts.map +1 -0
- package/package.json +165 -0
- package/src/cio-params.ts +4 -0
- package/src/components/InlineInAppMessageView.tsx +187 -0
- package/src/components/index.ts +3 -0
- package/src/customerio-cdp.ts +190 -0
- package/src/customerio-inapp.ts +127 -0
- package/src/customerio-location.ts +56 -0
- package/src/customerio-push.ts +127 -0
- package/src/index.ts +9 -0
- package/src/native-logger-listener.ts +84 -0
- package/src/notification-inbox.ts +154 -0
- package/src/postInstall.js +10 -0
- package/src/specs/components/InlineMessageNativeComponent.ts +59 -0
- package/src/specs/modules/NativeCustomerIO.ts +55 -0
- package/src/specs/modules/NativeCustomerIOLocation.ts +15 -0
- package/src/specs/modules/NativeCustomerIOLogging.ts +24 -0
- package/src/specs/modules/NativeCustomerIOMessagingInApp.ts +30 -0
- package/src/specs/modules/NativeCustomerIOMessagingPush.ts +27 -0
- package/src/types/data-pipelines.ts +150 -0
- package/src/types/in-app.ts +69 -0
- package/src/types/index.ts +3 -0
- package/src/types/internal.ts +20 -0
- package/src/types/push.ts +50 -0
- package/src/utils/native-bridge.ts +30 -0
- package/src/utils/param-validation.ts +178 -0
- package/src/zixflow.ts +24 -0
- package/zixflow-reactnative-richpush.podspec +42 -0
- package/zixflow-reactnative.podspec +66 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScreenView = exports.MetricEvent = exports.CioRegion = exports.CioLogLevel = exports.CioLocationTrackingMode = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Key-value pairs for custom user attributes and event properties.
|
|
9
|
+
*
|
|
10
|
+
* Provides a type-safe interface for passing custom data to CustomerIO.
|
|
11
|
+
* While the native bridge uses generic Object types for Codegen compatibility,
|
|
12
|
+
* this type gives developers better TypeScript intellisense and validation.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const attributes: CustomAttributes = {
|
|
17
|
+
* age: 25,
|
|
18
|
+
* email: 'user@example.com',
|
|
19
|
+
* preferences: { theme: 'dark' }
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for identifying a user in CustomerIO.
|
|
27
|
+
*
|
|
28
|
+
* @param userId - Unique identifier for the user (email, username, etc.)
|
|
29
|
+
* @param traits - Additional user attributes and properties
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Configuration options for initializing the CustomerIO SDK.
|
|
35
|
+
*
|
|
36
|
+
* @param cdpApiKey - Customer Data Platform API key from CustomerIO dashboard
|
|
37
|
+
* @param migrationSiteId - Legacy site ID for migrating from tracking API
|
|
38
|
+
* @param region - Data center region (US or EU)
|
|
39
|
+
* @param logLevel - SDK logging verbosity level
|
|
40
|
+
* @param apiHost - Override the CDP API host. Use to route SDK traffic through a first-party proxy.
|
|
41
|
+
* @param cdnHost - Override the CDN host. Use to route SDK traffic through a first-party proxy.
|
|
42
|
+
* @param flushAt - Number of events to batch before sending
|
|
43
|
+
* @param flushInterval - Time interval (seconds) to flush events
|
|
44
|
+
* @param screenViewUse - How to handle screen view tracking
|
|
45
|
+
* @param trackApplicationLifecycleEvents - Auto-track app lifecycle events
|
|
46
|
+
* @param autoTrackDeviceAttributes - Auto-track device information
|
|
47
|
+
* @param inApp - In-app messaging configuration
|
|
48
|
+
* @param push - Push notification configuration
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Log levels for CustomerIO SDK debugging and monitoring.
|
|
54
|
+
*
|
|
55
|
+
* Controls the verbosity of SDK logging output for debugging purposes.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
let CioLogLevel = exports.CioLogLevel = /*#__PURE__*/function (CioLogLevel) {
|
|
60
|
+
/** No logging output */
|
|
61
|
+
CioLogLevel["None"] = "none";
|
|
62
|
+
/** Only error messages */
|
|
63
|
+
CioLogLevel["Error"] = "error";
|
|
64
|
+
/** Error and informational messages */
|
|
65
|
+
CioLogLevel["Info"] = "info";
|
|
66
|
+
/** All messages including debug information */
|
|
67
|
+
CioLogLevel["Debug"] = "debug";
|
|
68
|
+
return CioLogLevel;
|
|
69
|
+
}({});
|
|
70
|
+
/**
|
|
71
|
+
* Data center regions for CustomerIO API endpoints.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
let CioRegion = exports.CioRegion = /*#__PURE__*/function (CioRegion) {
|
|
76
|
+
CioRegion["US"] = "US";
|
|
77
|
+
CioRegion["EU"] = "EU";
|
|
78
|
+
return CioRegion;
|
|
79
|
+
}({});
|
|
80
|
+
/**
|
|
81
|
+
* Screen view tracking behavior configuration.
|
|
82
|
+
*
|
|
83
|
+
* Defines how the SDK should handle automatic screen view events
|
|
84
|
+
* for analytics and in-app message targeting.
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
let ScreenView = exports.ScreenView = /*#__PURE__*/function (ScreenView) {
|
|
89
|
+
/** Send screen events to destinations and display in-app messages */
|
|
90
|
+
ScreenView["All"] = "all";
|
|
91
|
+
/** Only display in-app messages, don't send to destinations */
|
|
92
|
+
ScreenView["InApp"] = "inApp";
|
|
93
|
+
return ScreenView;
|
|
94
|
+
}({});
|
|
95
|
+
/**
|
|
96
|
+
* Location tracking mode for the CustomerIO Location module.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
let CioLocationTrackingMode = exports.CioLocationTrackingMode = /*#__PURE__*/function (CioLocationTrackingMode) {
|
|
101
|
+
/** Location tracking is disabled. All location operations no-op. */
|
|
102
|
+
CioLocationTrackingMode["Off"] = "OFF";
|
|
103
|
+
/** Host app controls when location is captured (default when location config is provided). */
|
|
104
|
+
CioLocationTrackingMode["Manual"] = "MANUAL";
|
|
105
|
+
/** SDK auto-captures location once per app launch when the app becomes active. */
|
|
106
|
+
CioLocationTrackingMode["OnAppStart"] = "ON_APP_START";
|
|
107
|
+
return CioLocationTrackingMode;
|
|
108
|
+
}({});
|
|
109
|
+
/**
|
|
110
|
+
* Enum to specify the type of metric for tracking
|
|
111
|
+
*
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
let MetricEvent = exports.MetricEvent = /*#__PURE__*/function (MetricEvent) {
|
|
115
|
+
/** Push notification was delivered to the device */
|
|
116
|
+
MetricEvent["Delivered"] = "delivered";
|
|
117
|
+
/** Push notification was opened by the user */
|
|
118
|
+
MetricEvent["Opened"] = "opened";
|
|
119
|
+
/** Push notification resulted in a conversion */
|
|
120
|
+
MetricEvent["Converted"] = "converted";
|
|
121
|
+
return MetricEvent;
|
|
122
|
+
}({});
|
|
123
|
+
//# sourceMappingURL=data-pipelines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CioLogLevel","exports","CioRegion","ScreenView","CioLocationTrackingMode","MetricEvent"],"sourceRoot":"../../../src","sources":["types/data-pipelines.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA2BA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EACrB;EADUA,WAAW;EAGrB;EAHUA,WAAW;EAKrB;EALUA,WAAW;EAOrB;EAPUA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAWvB;AACA;AACA;AACA;AACA;AAJA,IAKYE,SAAS,GAAAD,OAAA,CAAAC,SAAA,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAKrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,UAAU,GAAAF,OAAA,CAAAE,UAAA,0BAAVA,UAAU;EACpB;EADUA,UAAU;EAGpB;EAHUA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAOtB;AACA;AACA;AACA;AACA;AAJA,IAKYC,uBAAuB,GAAAH,OAAA,CAAAG,uBAAA,0BAAvBA,uBAAuB;EACjC;EADUA,uBAAuB;EAGjC;EAHUA,uBAAuB;EAKjC;EALUA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AASnC;AACA;AACA;AACA;AACA;AAJA,IAKYC,WAAW,GAAAJ,OAAA,CAAAI,WAAA,0BAAXA,WAAW;EACrB;EADUA,WAAW;EAGrB;EAHUA,WAAW;EAKrB;EALUA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InAppMessageEventType = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* In-app message data structure for event callbacks.
|
|
9
|
+
*
|
|
10
|
+
* Contains metadata about displayed in-app messages that can be used
|
|
11
|
+
* for tracking user interactions and message performance analytics.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Enum to represent the type of event triggered by in-app event callback.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
let InAppMessageEventType = exports.InAppMessageEventType = /*#__PURE__*/function (InAppMessageEventType) {
|
|
21
|
+
InAppMessageEventType["errorWithMessage"] = "errorWithMessage";
|
|
22
|
+
InAppMessageEventType["messageActionTaken"] = "messageActionTaken";
|
|
23
|
+
InAppMessageEventType["messageDismissed"] = "messageDismissed";
|
|
24
|
+
InAppMessageEventType["messageShown"] = "messageShown";
|
|
25
|
+
return InAppMessageEventType;
|
|
26
|
+
}({});
|
|
27
|
+
/**
|
|
28
|
+
* Represents an inbox message for a user.
|
|
29
|
+
*
|
|
30
|
+
* Inbox messages are persistent messages that can be displayed in a message center or inbox UI.
|
|
31
|
+
* They support read/unread states, expiration, and custom properties.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Listener for notification inbox message changes.
|
|
37
|
+
*
|
|
38
|
+
* Receives real-time notifications when inbox messages are added, updated, or removed.
|
|
39
|
+
* Callbacks are invoked on the main thread for safe UI updates.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
//# sourceMappingURL=in-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InAppMessageEventType","exports"],"sourceRoot":"../../../src","sources":["types/in-app.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AAJA,IAKYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAOjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _dataPipelines = require("./data-pipelines.js");
|
|
7
|
+
Object.keys(_dataPipelines).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _dataPipelines[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _dataPipelines[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _inApp = require("./in-app.js");
|
|
18
|
+
Object.keys(_inApp).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _inApp[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _inApp[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _push = require("./push.js");
|
|
29
|
+
Object.keys(_push).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _push[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _push[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_dataPipelines","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_inApp","_push"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,KAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,KAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,KAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,KAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/internal.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PushClickBehaviorAndroid = exports.CioPushPermissionStatus = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Android-specific behavior when a push notification is clicked.
|
|
9
|
+
*
|
|
10
|
+
* Controls how the Android system handles activity lifecycle
|
|
11
|
+
* when users tap on push notifications.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
let PushClickBehaviorAndroid = exports.PushClickBehaviorAndroid = /*#__PURE__*/function (PushClickBehaviorAndroid) {
|
|
16
|
+
/** Clear the activity task stack and start fresh */
|
|
17
|
+
PushClickBehaviorAndroid["ResetTaskStack"] = "RESET_TASK_STACK";
|
|
18
|
+
/** Prevent the current activity from restarting */
|
|
19
|
+
PushClickBehaviorAndroid["ActivityPreventRestart"] = "ACTIVITY_PREVENT_RESTART";
|
|
20
|
+
/** Use default behavior without special flags */
|
|
21
|
+
PushClickBehaviorAndroid["ActivityNoFlags"] = "ACTIVITY_NO_FLAGS";
|
|
22
|
+
return PushClickBehaviorAndroid;
|
|
23
|
+
}({});
|
|
24
|
+
/**
|
|
25
|
+
* Push notification permission request options.
|
|
26
|
+
*
|
|
27
|
+
* Configure which types of notifications to request permission for
|
|
28
|
+
* on different platforms.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Current push notification permission status.
|
|
34
|
+
*
|
|
35
|
+
* Indicates whether the user has granted, denied, or not yet
|
|
36
|
+
* responded to push notification permission requests.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
let CioPushPermissionStatus = exports.CioPushPermissionStatus = /*#__PURE__*/function (CioPushPermissionStatus) {
|
|
41
|
+
/** User has granted push notification permissions */
|
|
42
|
+
CioPushPermissionStatus["Granted"] = "GRANTED";
|
|
43
|
+
/** User has denied push notification permissions */
|
|
44
|
+
CioPushPermissionStatus["Denied"] = "DENIED";
|
|
45
|
+
/** User may not yet have been asked for permissions and permission status is unknown */
|
|
46
|
+
CioPushPermissionStatus["NotDetermined"] = "NOTDETERMINED";
|
|
47
|
+
return CioPushPermissionStatus;
|
|
48
|
+
}({});
|
|
49
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PushClickBehaviorAndroid","exports","CioPushPermissionStatus"],"sourceRoot":"../../../src","sources":["types/push.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYA,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,0BAAxBA,wBAAwB;EAClC;EADUA,wBAAwB;EAGlC;EAHUA,wBAAwB;EAKlC;EALUA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA;AASpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYE,uBAAuB,GAAAD,OAAA,CAAAC,uBAAA,0BAAvBA,uBAAuB;EACjC;EADUA,uBAAuB;EAGjC;EAHUA,uBAAuB;EAKjC;EALUA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.callNativeModule = void 0;
|
|
7
|
+
exports.ensureNativeModule = ensureNativeModule;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
const LINKING_ERROR = `The package 'customerio-reactnative' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
10
|
+
ios: "- You have run 'pod install'\n",
|
|
11
|
+
default: ''
|
|
12
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Ensures the native module is available, otherwise throws a helpful linking error.
|
|
16
|
+
*/
|
|
17
|
+
function ensureNativeModule(nativeModule) {
|
|
18
|
+
if (!nativeModule) {
|
|
19
|
+
throw new Error(LINKING_ERROR);
|
|
20
|
+
}
|
|
21
|
+
return nativeModule;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Calls a method on a native module with type-safe access.
|
|
26
|
+
*/
|
|
27
|
+
const callNativeModule = (nativeModule, fn) => {
|
|
28
|
+
return fn(nativeModule);
|
|
29
|
+
};
|
|
30
|
+
exports.callNativeModule = callNativeModule;
|
|
31
|
+
//# sourceMappingURL=native-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","ensureNativeModule","nativeModule","Error","callNativeModule","fn","exports"],"sourceRoot":"../../../src","sources":["utils/native-bridge.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,iFAAiF,GACjFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;;AAE/C;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,YAAiC,EACnB;EACd,IAAI,CAACA,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;EAEA,OAAOM,YAAY;AACrB;;AAEA;AACA;AACA;AACO,MAAME,gBAAgB,GAAGA,CAC9BF,YAAkB,EAClBG,EAA4B,KACjB;EACX,OAAOA,EAAE,CAACH,YAAY,CAAC;AACzB,CAAC;AAACI,OAAA,CAAAF,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validate = exports.assert = void 0;
|
|
7
|
+
// Argument validation utilities for SDK internal use
|
|
8
|
+
// Ensures input safety and throws clear errors when validation fails
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Builds a standardized error message for validation failures.
|
|
12
|
+
*/
|
|
13
|
+
function buildErrorMessage(usage, fieldName, error) {
|
|
14
|
+
const prefix = usage ? `${usage} ` : '';
|
|
15
|
+
return `${prefix}"${fieldName}" ${error}.`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if the value is undefined or null.
|
|
20
|
+
*/
|
|
21
|
+
function isUndefined(value) {
|
|
22
|
+
return value === undefined || value === null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Throws an error if the condition is true.
|
|
27
|
+
* Use this to fail validation checks with cleaner syntax.
|
|
28
|
+
*/
|
|
29
|
+
function failIf(condition, message) {
|
|
30
|
+
if (__DEV__ && condition) {
|
|
31
|
+
throw new Error(`[CustomerIO] ${message()}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Validates that a value is defined (not undefined or null).
|
|
37
|
+
* Useful for checking required fields.
|
|
38
|
+
*/
|
|
39
|
+
function failIfUndefined(value, fieldName, usage) {
|
|
40
|
+
failIf(isUndefined(value), () => buildErrorMessage(usage, fieldName, 'is required'));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Validates that a value is a string.
|
|
45
|
+
* Throws if the value is not a string, or if it's empty (unless allowEmpty is true).
|
|
46
|
+
*/
|
|
47
|
+
function validateString(value, fieldName, options = {
|
|
48
|
+
allowEmpty: true
|
|
49
|
+
}) {
|
|
50
|
+
const {
|
|
51
|
+
allowEmpty,
|
|
52
|
+
usage,
|
|
53
|
+
optional
|
|
54
|
+
} = options;
|
|
55
|
+
if (optional && isUndefined(value)) {
|
|
56
|
+
return; // Skip validation for optional fields
|
|
57
|
+
}
|
|
58
|
+
const prefix = usage ? `${usage} ` : '';
|
|
59
|
+
failIfUndefined(value, fieldName, usage);
|
|
60
|
+
failIf(typeof value !== 'string', () => `${prefix}"${fieldName}" must be a string.`);
|
|
61
|
+
// Since typeof value is already checked to be a string,
|
|
62
|
+
// we can safely cast it here without additional checks.
|
|
63
|
+
const typedValue = value;
|
|
64
|
+
failIf(!allowEmpty && typedValue.trim() === '', () => `${prefix}"${fieldName}" must be a non-empty string.`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Validates that a value is a plain object (not null or an array).
|
|
69
|
+
*/
|
|
70
|
+
function validateRecord(value, fieldName, options = {}) {
|
|
71
|
+
const {
|
|
72
|
+
usage,
|
|
73
|
+
expectedType,
|
|
74
|
+
optional
|
|
75
|
+
} = options;
|
|
76
|
+
if (optional && isUndefined(value)) {
|
|
77
|
+
return; // Skip validation for optional fields
|
|
78
|
+
}
|
|
79
|
+
const prefix = usage ? `${usage} ` : '';
|
|
80
|
+
const typeName = expectedType ?? 'plain';
|
|
81
|
+
failIfUndefined(value, fieldName, usage);
|
|
82
|
+
failIf(typeof value !== 'object' || Array.isArray(value), () => `${prefix}"${fieldName}" must be a valid ${typeName} object.`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Validates that a value is a valid CustomAttributes object.
|
|
87
|
+
* Automatically converts Map objects to plain objects for compatibility.
|
|
88
|
+
* This is a specialized version of validateRecord optimized for attribute validation.
|
|
89
|
+
*/
|
|
90
|
+
function validateAttributes(value, fieldName, options = {}) {
|
|
91
|
+
const exists = !isUndefined(value);
|
|
92
|
+
if (options.optional && !exists) {
|
|
93
|
+
return; // Skip validation for optional fields
|
|
94
|
+
}
|
|
95
|
+
let attributes;
|
|
96
|
+
if (exists && value instanceof Map) {
|
|
97
|
+
// Convert Map to plain object for native serialization
|
|
98
|
+
attributes = Object.fromEntries(value);
|
|
99
|
+
} else {
|
|
100
|
+
attributes = value;
|
|
101
|
+
}
|
|
102
|
+
validateRecord(attributes, fieldName, options);
|
|
103
|
+
return attributes;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Validates that the given value is a valid CioConfig object.
|
|
108
|
+
* Throws if required fields are missing or incorrectly typed.
|
|
109
|
+
*/
|
|
110
|
+
function validateConfig(value) {
|
|
111
|
+
const fieldName = 'config';
|
|
112
|
+
const usage = 'SDK';
|
|
113
|
+
validateRecord(value, fieldName, {
|
|
114
|
+
expectedType: 'CioConfig',
|
|
115
|
+
usage: usage
|
|
116
|
+
});
|
|
117
|
+
const obj = value;
|
|
118
|
+
validateString(obj.cdpApiKey, `${fieldName}.cdpApiKey`, {
|
|
119
|
+
allowEmpty: false,
|
|
120
|
+
usage: usage
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// For type safety, we define a ConfigValidator type that asserts the value is a CioConfig
|
|
125
|
+
// This allows us to use it in the assert object without needing to redefine the function signature
|
|
126
|
+
|
|
127
|
+
const assert = exports.assert = {
|
|
128
|
+
string: validateString,
|
|
129
|
+
record: validateRecord,
|
|
130
|
+
attributes: validateAttributes,
|
|
131
|
+
config: validateConfig
|
|
132
|
+
};
|
|
133
|
+
const validate = exports.validate = {
|
|
134
|
+
isUndefined: isUndefined
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=param-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["buildErrorMessage","usage","fieldName","error","prefix","isUndefined","value","undefined","failIf","condition","message","__DEV__","Error","failIfUndefined","validateString","options","allowEmpty","optional","typedValue","trim","validateRecord","expectedType","typeName","Array","isArray","validateAttributes","exists","attributes","Map","Object","fromEntries","validateConfig","obj","cdpApiKey","assert","exports","string","record","config","validate"],"sourceRoot":"../../../src","sources":["utils/param-validation.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Zixflow: true,
|
|
8
|
+
CustomerIOInAppMessaging: true,
|
|
9
|
+
CustomerIOLocation: true,
|
|
10
|
+
CustomerIOPushMessaging: true
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "CustomerIOInAppMessaging", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _customerioInapp.CustomerIOInAppMessaging;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CustomerIOLocation", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _customerioLocation.CustomerIOLocation;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CustomerIOPushMessaging", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _customerioPush.CustomerIOPushMessaging;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
exports.Zixflow = void 0;
|
|
31
|
+
var _customerioCdp = require("./customerio-cdp.js");
|
|
32
|
+
var _customerioInapp = require("./customerio-inapp.js");
|
|
33
|
+
var _customerioLocation = require("./customerio-location.js");
|
|
34
|
+
var _customerioPush = require("./customerio-push.js");
|
|
35
|
+
var _index = require("./types/index.js");
|
|
36
|
+
Object.keys(_index).forEach(function (key) {
|
|
37
|
+
if (key === "default" || key === "__esModule") return;
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
40
|
+
Object.defineProperty(exports, key, {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _index[key];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
var _notificationInbox = require("./notification-inbox.js");
|
|
48
|
+
Object.keys(_notificationInbox).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
+
if (key in exports && exports[key] === _notificationInbox[key]) return;
|
|
52
|
+
Object.defineProperty(exports, key, {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _notificationInbox[key];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Zixflow SDK - Main entry point
|
|
61
|
+
*
|
|
62
|
+
* This provides the Zixflow-branded API that wraps the underlying Customer.io implementation.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
// Re-export the CustomerIO class as Zixflow for branding
|
|
66
|
+
const Zixflow = exports.Zixflow = _customerioCdp.CustomerIO;
|
|
67
|
+
|
|
68
|
+
// Re-export all types and utilities
|
|
69
|
+
|
|
70
|
+
// Export sub-modules with their original names (they work with the main Zixflow class)
|
|
71
|
+
//# sourceMappingURL=zixflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_customerioCdp","require","_customerioInapp","_customerioLocation","_customerioPush","_index","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_notificationInbox","Zixflow","CustomerIO"],"sourceRoot":"../../src","sources":["zixflow.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAMA,IAAAI,MAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,kBAAA,GAAAjB,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAW,kBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,kBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,kBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAhBA;AACA;AACA;AACA;AACA;;AAOA;AACO,MAAMU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAGC,yBAAU;;AAEjC;;AAIA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["cio-params.ts"],"mappings":"","ignoreList":[]}
|