react-native-smallcase-gateway 5.3.2 → 6.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/reactnativesmallcasegateway/SCGatewayBridgeEmitter.kt +112 -0
  4. package/android/src/main/java/com/reactnativesmallcasegateway/SCLoansBridgeEmitter.kt +117 -0
  5. package/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt +0 -5
  6. package/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayPackage.kt +5 -1
  7. package/ios/SCGatewayBridgeEmitter.m +20 -0
  8. package/ios/SCGatewayEmitter.swift +117 -0
  9. package/ios/SCLoansBridgeEmitter.m +20 -0
  10. package/ios/SCLoansEmitter.swift +115 -0
  11. package/ios/SmallcaseGateway-Bridging-Header.h +7 -0
  12. package/lib/commonjs/SCGatewayEventEmitter.js +107 -0
  13. package/lib/commonjs/SCGatewayEventEmitter.js.map +1 -0
  14. package/lib/commonjs/SCLoansEventEmitter.js +103 -0
  15. package/lib/commonjs/SCLoansEventEmitter.js.map +1 -0
  16. package/lib/commonjs/SmallcaseGateway.js.map +1 -1
  17. package/lib/commonjs/index.js +27 -0
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/module/SCGatewayEventEmitter.js +102 -0
  20. package/lib/module/SCGatewayEventEmitter.js.map +1 -0
  21. package/lib/module/SCLoansEventEmitter.js +98 -0
  22. package/lib/module/SCLoansEventEmitter.js.map +1 -0
  23. package/lib/module/SmallcaseGateway.js.map +1 -1
  24. package/lib/module/index.js +3 -1
  25. package/lib/module/index.js.map +1 -1
  26. package/package.json +1 -1
  27. package/react-native-smallcase-gateway.podspec +2 -2
  28. package/src/SCGatewayEventEmitter.js +121 -0
  29. package/src/SCLoansEventEmitter.js +116 -0
  30. package/src/SmallcaseGateway.js +1 -1
  31. package/src/index.js +3 -1
  32. package/types/index.d.ts +45 -2
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.SCGatewayEventTypes = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * @typedef {Object} GatewayEvent
10
+ * @property {string} type - Event type
11
+ * @property {any} data - Event payload data
12
+ * @property {number} timestamp - Event timestamp
13
+ *
14
+ * @typedef {Object} GatewayEventSubscription
15
+ * @property {() => void} remove - Method to unsubscribe from gateway events
16
+ *
17
+ */
18
+
19
+ const nativeModule = _reactNative.NativeModules.SCGatewayBridgeEmitter;
20
+ const SCGatewayEventTypes = exports.SCGatewayEventTypes = {
21
+ ANALYTICS_EVENT: 'scgateway_analytics_event',
22
+ SUPER_PROPERTIES_UPDATED: 'scgateway_super_properties_updated',
23
+ USER_RESET: 'scgateway_user_reset',
24
+ USER_IDENTIFY: 'scgateway_user_identify'
25
+ };
26
+ const SCGatewayNotificationEvent = 'scg_notification';
27
+ class SCGatewayEvents {
28
+ constructor() {
29
+ this.eventEmitter = null;
30
+ this.subscriptions = [];
31
+ this.initialize();
32
+ }
33
+ get isInitialized() {
34
+ return this.eventEmitter !== null;
35
+ }
36
+ initialize() {
37
+ if (nativeModule) {
38
+ this.eventEmitter = new _reactNative.NativeEventEmitter(nativeModule);
39
+ } else {
40
+ console.warn('[SCGatewayEvents] Native module not available');
41
+ }
42
+ }
43
+
44
+ // ===== GATEWAY EVENT METHODS =====
45
+ /**
46
+ * Subscribe to Gateway Events
47
+ * @param {(event: GatewayEvent) => void} callback - Callback function to handle gateway events
48
+ * @returns {GatewayEventSubscription} subscription - Subscription object with remove() method
49
+ */
50
+ subscribeToGatewayEvents(callback) {
51
+ if (!this.isInitialized) {
52
+ console.warn('[SCGatewayEvents] Event emitter not initialized');
53
+ return null;
54
+ }
55
+ if (typeof callback !== 'function') {
56
+ console.warn('[SCGatewayEvents] Invalid callback provided for subscription');
57
+ return null;
58
+ }
59
+ const subscription = this.eventEmitter.addListener(SCGatewayNotificationEvent, jsonString => {
60
+ if (!jsonString) {
61
+ console.warn('[SCGatewayEvents] Received null/undefined event data');
62
+ return;
63
+ }
64
+ let eventData;
65
+ try {
66
+ eventData = JSON.parse(jsonString);
67
+ } catch (error) {
68
+ console.warn('[SCGatewayEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);
69
+ return;
70
+ }
71
+ if (!eventData.type) {
72
+ console.warn('[SCGatewayEvents] Dropping event - missing event type:', eventData);
73
+ return;
74
+ }
75
+ const normalizedEvent = {
76
+ type: eventData.type,
77
+ data: eventData.data,
78
+ timestamp: eventData.timestamp || Date.now()
79
+ };
80
+ callback(normalizedEvent);
81
+ });
82
+ this.subscriptions.push(subscription);
83
+ return subscription;
84
+ }
85
+
86
+ /**
87
+ * Unsubscribe from Gateway Events
88
+ * @param {GatewayEventSubscription} subscription - Subscription returned from subscribeToGatewayEvents
89
+ */
90
+ unsubscribeFromGatewayEvents(subscription) {
91
+ if (subscription && typeof subscription.remove === 'function') {
92
+ subscription.remove();
93
+ this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);
94
+ }
95
+ }
96
+ cleanup() {
97
+ this.subscriptions.forEach(subscription => {
98
+ if (subscription && typeof subscription.remove === 'function') {
99
+ subscription.remove();
100
+ }
101
+ });
102
+ this.subscriptions = [];
103
+ }
104
+ }
105
+ const scGatewayEventManager = new SCGatewayEvents();
106
+ var _default = exports.default = scGatewayEventManager;
107
+ //# sourceMappingURL=SCGatewayEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","nativeModule","NativeModules","SCGatewayBridgeEmitter","SCGatewayEventTypes","exports","ANALYTICS_EVENT","SUPER_PROPERTIES_UPDATED","USER_RESET","USER_IDENTIFY","SCGatewayNotificationEvent","SCGatewayEvents","constructor","eventEmitter","subscriptions","initialize","isInitialized","NativeEventEmitter","console","warn","subscribeToGatewayEvents","callback","subscription","addListener","jsonString","eventData","JSON","parse","error","type","normalizedEvent","data","timestamp","Date","now","push","unsubscribeFromGatewayEvents","remove","filter","sub","cleanup","forEach","scGatewayEventManager","_default","default"],"sources":["SCGatewayEventEmitter.js"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n Platform\n} from 'react-native';\n\n/**\n * @typedef {Object} GatewayEvent\n * @property {string} type - Event type\n * @property {any} data - Event payload data\n * @property {number} timestamp - Event timestamp\n *\n * @typedef {Object} GatewayEventSubscription\n * @property {() => void} remove - Method to unsubscribe from gateway events\n *\n */\n\nconst nativeModule = NativeModules.SCGatewayBridgeEmitter;\n\nexport const SCGatewayEventTypes = {\n ANALYTICS_EVENT: 'scgateway_analytics_event',\n SUPER_PROPERTIES_UPDATED: 'scgateway_super_properties_updated',\n USER_RESET: 'scgateway_user_reset',\n USER_IDENTIFY: 'scgateway_user_identify',\n};\n\nconst SCGatewayNotificationEvent = 'scg_notification';\n\nclass SCGatewayEvents {\n constructor() {\n this.eventEmitter = null;\n this.subscriptions = [];\n this.initialize();\n }\n\n get isInitialized() {\n return this.eventEmitter !== null;\n }\n\n initialize() {\n if (nativeModule) {\n this.eventEmitter = new NativeEventEmitter(nativeModule);\n } else {\n console.warn('[SCGatewayEvents] Native module not available');\n }\n }\n\n // ===== GATEWAY EVENT METHODS =====\n /**\n * Subscribe to Gateway Events\n * @param {(event: GatewayEvent) => void} callback - Callback function to handle gateway events\n * @returns {GatewayEventSubscription} subscription - Subscription object with remove() method\n */\n subscribeToGatewayEvents(callback) {\n if (!this.isInitialized) {\n console.warn('[SCGatewayEvents] Event emitter not initialized');\n return null;\n }\n\n if (typeof callback !== 'function') {\n console.warn('[SCGatewayEvents] Invalid callback provided for subscription');\n return null;\n }\n\n const subscription = this.eventEmitter.addListener(SCGatewayNotificationEvent, (jsonString) => {\n if (!jsonString) {\n console.warn('[SCGatewayEvents] Received null/undefined event data');\n return;\n }\n\n let eventData;\n try {\n eventData = JSON.parse(jsonString);\n } catch (error) {\n console.warn('[SCGatewayEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);\n return;\n }\n\n if (!eventData.type) {\n console.warn('[SCGatewayEvents] Dropping event - missing event type:', eventData);\n return;\n }\n\n const normalizedEvent = {\n type: eventData.type,\n data: eventData.data,\n timestamp: eventData.timestamp || Date.now()\n };\n\n callback(normalizedEvent);\n });\n\n this.subscriptions.push(subscription);\n\n return subscription;\n }\n\n /**\n * Unsubscribe from Gateway Events\n * @param {GatewayEventSubscription} subscription - Subscription returned from subscribeToGatewayEvents\n */\n unsubscribeFromGatewayEvents(subscription) {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);\n }\n }\n\n cleanup() {\n this.subscriptions.forEach(subscription => {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n }\n });\n this.subscriptions = [];\n }\n}\n\nconst scGatewayEventManager = new SCGatewayEvents();\n\nexport default scGatewayEventManager;"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,YAAY,GAAGC,0BAAa,CAACC,sBAAsB;AAElD,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAC/BE,eAAe,EAAE,2BAA2B;EAC5CC,wBAAwB,EAAE,oCAAoC;EAC9DC,UAAU,EAAE,sBAAsB;EAClCC,aAAa,EAAE;AACnB,CAAC;AAED,MAAMC,0BAA0B,GAAG,kBAAkB;AAErD,MAAMC,eAAe,CAAC;EAClBC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,YAAY,GAAG,IAAI;IACxB,IAAI,CAACC,aAAa,GAAG,EAAE;IACvB,IAAI,CAACC,UAAU,CAAC,CAAC;EACrB;EAEA,IAAIC,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACH,YAAY,KAAK,IAAI;EACrC;EAEAE,UAAUA,CAAA,EAAG;IACT,IAAId,YAAY,EA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AY,CAAC;IAErC,OAAOA,YAAY;EACvB;;EAEA;AACJ;AACA;AACA;EACIc,4BAA4BA,CAACd,YAAY,EAAE;IACvC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;MAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACrB,IAAI,CAACvB,aAAa,GAAG,IAAI,CAACA,aAAa,CAACwB,MAAM,CAACC,GAAG,IAAIA,GAAG,KAAKjB,YAAY,CAAC;IAC/E;EACJ;EAEAkB,OAAOA,CAAA,EAAG;IACN,IAAI,CAAC1B,aAAa,CAAC2B,OAAO,CAACnB,YAAY,IAAI;MACvC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;QAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACzB;IACJ,CAAC,CAAC;IACF,IAAI,CAACvB,aAAa,GAAG,EAAE;EAC3B;AACJ;AAEA,MAAM4B,qBAAqB,GAAG,IAAI/B,eAAe,CAAC,CAAC;AAAC,IAAAgC,QAAA,GAAAtC,OAAA,CAAAuC,OAAA,GAErCF,qBAAqB","ignoreList":[]}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.SCLoansEventTypes = void 0;
7
+ var _reactNative = require("react-native");
8
+ /**
9
+ * @typedef {Object} LoansEvent
10
+ * @property {string} type - Event type
11
+ * @property {number} timestamp - Event timestamp
12
+ *
13
+ * @typedef {Object} LoansEventSubscription
14
+ * @property {() => void} remove - Method to unsubscribe from loans events
15
+ */
16
+
17
+ const nativeModule = _reactNative.NativeModules.SCLoansBridgeEmitter;
18
+ const SCLoansEventTypes = exports.SCLoansEventTypes = {
19
+ ANALYTICS_EVENT: 'scloans_analytics_event',
20
+ SUPER_PROPERTIES_UPDATED: 'scloans_super_properties_updated'
21
+ };
22
+ const SCLoansNotificationEvent = 'scloans_notification';
23
+ class SCLoansEvents {
24
+ constructor() {
25
+ this.eventEmitter = null;
26
+ this.subscriptions = [];
27
+ this.initialize();
28
+ }
29
+ get isInitialized() {
30
+ return this.eventEmitter !== null;
31
+ }
32
+ initialize() {
33
+ if (nativeModule) {
34
+ this.eventEmitter = new _reactNative.NativeEventEmitter(nativeModule);
35
+ } else {
36
+ console.warn('[SCLoansEvents] Native module not available');
37
+ }
38
+ }
39
+
40
+ // ===== LOANS EVENT METHODS =====
41
+ /**
42
+ * Subscribe to Loans Events
43
+ * @param {(event: LoansEvent) => void} callback - Callback function to handle loans events
44
+ * @returns {LoansEventSubscription} subscription - Subscription object with remove() method
45
+ */
46
+ subscribeToLoansEvent(callback) {
47
+ if (!this.isInitialized) {
48
+ console.warn('[SCLoansEvents] Event emitter not initialized');
49
+ return null;
50
+ }
51
+ if (typeof callback !== 'function') {
52
+ console.warn('[SCLoansEvents] Invalid callback provided for subscription');
53
+ return null;
54
+ }
55
+ const subscription = this.eventEmitter.addListener(SCLoansNotificationEvent, jsonString => {
56
+ if (!jsonString) {
57
+ console.warn('[SCLoansEvents] Received null/undefined event data');
58
+ return;
59
+ }
60
+ let eventData;
61
+ try {
62
+ eventData = JSON.parse(jsonString);
63
+ } catch (error) {
64
+ console.warn('[SCLoansEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);
65
+ return;
66
+ }
67
+ if (!eventData.type) {
68
+ console.warn('[SCLoansEvents] Dropping event - missing event type:', eventData);
69
+ return;
70
+ }
71
+ const normalizedEvent = {
72
+ type: eventData.type,
73
+ data: eventData.data,
74
+ timestamp: eventData.timestamp || Date.now()
75
+ };
76
+ callback(normalizedEvent);
77
+ });
78
+ this.subscriptions.push(subscription);
79
+ return subscription;
80
+ }
81
+
82
+ /**
83
+ * Unsubscribe from Loans Events
84
+ * @param {LoansEventSubscription} subscription - Subscription returned from subscribeToLoansEvents
85
+ */
86
+ unsubscribeFromLoansEvent(subscription) {
87
+ if (subscription && typeof subscription.remove === 'function') {
88
+ subscription.remove();
89
+ this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);
90
+ }
91
+ }
92
+ cleanup() {
93
+ this.subscriptions.forEach(subscription => {
94
+ if (subscription && typeof subscription.remove === 'function') {
95
+ subscription.remove();
96
+ }
97
+ });
98
+ this.subscriptions = [];
99
+ }
100
+ }
101
+ const scLoansEventManager = new SCLoansEvents();
102
+ var _default = exports.default = scLoansEventManager;
103
+ //# sourceMappingURL=SCLoansEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","nativeModule","NativeModules","SCLoansBridgeEmitter","SCLoansEventTypes","exports","ANALYTICS_EVENT","SUPER_PROPERTIES_UPDATED","SCLoansNotificationEvent","SCLoansEvents","constructor","eventEmitter","subscriptions","initialize","isInitialized","NativeEventEmitter","console","warn","subscribeToLoansEvent","callback","subscription","addListener","jsonString","eventData","JSON","parse","error","type","normalizedEvent","data","timestamp","Date","now","push","unsubscribeFromLoansEvent","remove","filter","sub","cleanup","forEach","scLoansEventManager","_default","default"],"sources":["SCLoansEventEmitter.js"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n Platform\n} from 'react-native';\n\n/**\n * @typedef {Object} LoansEvent\n * @property {string} type - Event type\n * @property {number} timestamp - Event timestamp\n *\n * @typedef {Object} LoansEventSubscription\n * @property {() => void} remove - Method to unsubscribe from loans events\n */\n\nconst nativeModule = NativeModules.SCLoansBridgeEmitter;\n\nexport const SCLoansEventTypes = {\n ANALYTICS_EVENT: 'scloans_analytics_event',\n SUPER_PROPERTIES_UPDATED: 'scloans_super_properties_updated',\n};\n\nconst SCLoansNotificationEvent = 'scloans_notification';\nclass SCLoansEvents {\n constructor() {\n this.eventEmitter = null;\n this.subscriptions = [];\n this.initialize();\n }\n\n get isInitialized() {\n return this.eventEmitter !== null;\n }\n\n initialize() {\n if (nativeModule) {\n this.eventEmitter = new NativeEventEmitter(nativeModule);\n } else {\n console.warn('[SCLoansEvents] Native module not available');\n }\n }\n\n // ===== LOANS EVENT METHODS =====\n /**\n * Subscribe to Loans Events\n * @param {(event: LoansEvent) => void} callback - Callback function to handle loans events\n * @returns {LoansEventSubscription} subscription - Subscription object with remove() method\n */\n subscribeToLoansEvent(callback) {\n if (!this.isInitialized) {\n console.warn('[SCLoansEvents] Event emitter not initialized');\n return null;\n }\n\n if (typeof callback !== 'function') {\n console.warn('[SCLoansEvents] Invalid callback provided for subscription');\n return null;\n }\n\n const subscription = this.eventEmitter.addListener(SCLoansNotificationEvent, (jsonString) => {\n if (!jsonString) {\n console.warn('[SCLoansEvents] Received null/undefined event data');\n return;\n }\n\n let eventData;\n try {\n eventData = JSON.parse(jsonString);\n } catch (error) {\n console.warn('[SCLoansEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);\n return;\n }\n\n if (!eventData.type) {\n console.warn('[SCLoansEvents] Dropping event - missing event type:', eventData);\n return;\n }\n\n const normalizedEvent = {\n type: eventData.type,\n data: eventData.data,\n timestamp: eventData.timestamp || Date.now()\n };\n\n callback(normalizedEvent);\n });\n\n this.subscriptions.push(subscription);\n\n return subscription;\n }\n\n /**\n * Unsubscribe from Loans Events\n * @param {LoansEventSubscription} subscription - Subscription returned from subscribeToLoansEvents\n */\n unsubscribeFromLoansEvent(subscription) {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);\n }\n }\n\n cleanup() {\n this.subscriptions.forEach(subscription => {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n }\n });\n this.subscriptions = [];\n }\n}\n\nconst scLoansEventManager = new SCLoansEvents();\n\nexport default scLoansEventManager;"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,YAAY,GAAGC,0BAAa,CAACC,oBAAoB;AAEhD,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC7BE,eAAe,EAAE,yBAAyB;EAC1CC,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jBX,OAAO,CAACC,IAAI,CAAC,sDAAsD,EAAEM,SAAS,CAAC;QAC/E;MACJ;MAEA,MAAMK,eAAe,GAAG;QACpBD,IAAI,EAAEJ,SAAS,CAACI,IAAI;QACpBE,IAAI,EAAEN,SAAS,CAACM,IAAI;QACpBC,SAAS,EAAEP,SAAS,CAACO,SAAS,IAAIC,IAAI,CAACC,GAAG,CAAC;MAC/C,CAAC;MAEDb,QAAQ,CAACS,eAAe,CAAC;IAC7B,CAAC,CAAC;IAEF,IAAI,CAAChB,aAAa,CAACqB,IAAI,CAACb,YAAY,CAAC;IAErC,OAAOA,YAAY;EACvB;;EAEA;AACJ;AACA;AACA;EACIc,yBAAyBA,CAACd,YAAY,EAAE;IACpC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;MAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACrB,IAAI,CAACvB,aAAa,GAAG,IAAI,CAACA,aAAa,CAACwB,MAAM,CAACC,GAAG,IAAIA,GAAG,KAAKjB,YAAY,CAAC;IAC/E;EACJ;EAEAkB,OAAOA,CAAA,EAAG;IACN,IAAI,CAAC1B,aAAa,CAAC2B,OAAO,CAACnB,YAAY,IAAI;MACvC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;QAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACzB;IACJ,CAAC,CAAC;IACF,IAAI,CAACvB,aAAa,GAAG,EAAE;EAC3B;AACJ;AAEA,MAAM4B,mBAAmB,GAAG,IAAI/B,aAAa,CAAC,CAAC;AAAC,IAAAgC,QAAA,GAAApC,OAAA,CAAAqC,OAAA,GAEjCF,mBAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_constants","_util","_package","SmallcaseGateway","SmallcaseGatewayNative","NativeModules","defaultBrokerList","setConfigEnvironment","envConfig","safeConfig","safeObject","setHybridSdkVersion","version","brokerList","gatewayName","isLeprechaun","isAmoEnabled","environmentName","safeIsLeprechaun","Boolean","safeIsAmoEnabled","safeBrokerList","Array","isArray","safeGatewayName","safeEnvName","ENV","PROD","init","sdkToken","safeToken","triggerTransaction","transactionId","utmParams","safeUtm","safeId","length","triggerMfTransaction","console","warn","safeTransactionId","launchSmallplug","targetEndpoint","params","safeEndpoint","safeParams","launchSmallplugWithBranding","headerColor","headerOpacity","backIconColor","backIconOpacity","safeHeaderColor","platformSpecificColorHex","safeHeaderOpacity","safeBackIconColor","safeBackIconOpacity","logoutUser","showOrders","triggerLeadGen","userDetails","triggerLeadGenWithStatus","triggerLeadGenWithLoginCta","showLoginCta","safeShowLoginCta","archiveSmallcase","iscid","safeIscid","getSdkVersion","_default","exports","default"],"sources":["SmallcaseGateway.js"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport { ENV } from './constants';\nimport { safeObject, platformSpecificColorHex } from './util';\nimport { version } from '../package.json';\nconst { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules;\n\n/**\n *\n * @typedef {Object} envConfig\n * @property {string} gatewayName - unique name on consumer\n * @property {boolean} isLeprechaun - leprechaun mode toggle\n * @property {boolean} isAmoEnabled - support AMO (subject to broker support)\n * @property {Array<string>} brokerList - list of broker names\n * @property {'production' | 'staging' | 'development'} environmentName - environment name\n *\n * @typedef {Object} transactionRes\n * @property {string} data - response data\n * @property {boolean} success - success flag\n * @property {Number} [errorCode] - error code\n * @property {string} transaction - transaction name\n *\n * @typedef {Object} userDetails\n * @property {String} name - name of user\n * @property {String} email - email of user\n * @property {String} contact - contact of user\n * @property {String} pinCode - pin-code of user\n *\n * @typedef {Object} SmallplugUiConfig\n * @property {String} headerColor - color of the header background\n * @property {Number} headerOpacity - opacity of the header background\n * @property {String} backIconColor - color of the back icon\n * @property {Number} backIconOpacity - opacity of the back icon\n *\n */\n\nlet defaultBrokerList = [];\n\n/**\n * configure the sdk with\n * @param {envConfig} envConfig\n */\nconst setConfigEnvironment = async (envConfig) => {\n const safeConfig = safeObject(envConfig);\n\n await SmallcaseGatewayNative.setHybridSdkVersion(version);\n\n const {\n brokerList,\n gatewayName,\n isLeprechaun,\n isAmoEnabled,\n environmentName,\n } = safeConfig;\n\n const safeIsLeprechaun = Boolean(isLeprechaun);\n const safeIsAmoEnabled = Boolean(isAmoEnabled);\n const safeBrokerList = Array.isArray(brokerList) ? brokerList : [];\n const safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';\n const safeEnvName =\n typeof environmentName === 'string' ? environmentName : ENV.PROD;\n\n defaultBrokerList = safeBrokerList;\n\n await SmallcaseGatewayNative.setConfigEnvironment(\n safeEnvName,\n safeGatewayName,\n safeIsLeprechaun,\n safeIsAmoEnabled,\n safeBrokerList\n );\n};\n\n/**\n * initialize sdk with a session\n *\n * note: this must be called after `setConfigEnvironment()`\n * @param {string} sdkToken\n */\nconst init = async (sdkToken) => {\n const safeToken = typeof sdkToken === 'string' ? sdkToken : '';\n return SmallcaseGatewayNative.init(safeToken);\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @param {Object} [utmParams]\n * @param {Array<string>} [brokerList]\n * @returns {Promise<transactionRes>}\n */\nconst triggerTransaction = async (transactionId, utmParams, brokerList) => {\n const safeUtm = safeObject(utmParams);\n const safeId = typeof transactionId === 'string' ? transactionId : '';\n\n const safeBrokerList =\n Array.isArray(brokerList) && brokerList.length\n ? brokerList\n : defaultBrokerList;\n\n return SmallcaseGatewayNative.triggerTransaction(\n safeId,\n safeUtm,\n safeBrokerList\n );\n};\n\n/**\n * triggers a transaction with a transaction id\n * @deprecated triggerMfTransaction will be removed soon. Please use triggerTransaction.\n * @param {string} transactionId\n * @returns {Promise<transactionRes>}\n */\nconst triggerMfTransaction = async (transactionId) => {\n console.warn(\n 'Calling deprecated function! triggerMfTransaction will be removed soon. Please use triggerTransaction.'\n );\n const safeTransactionId =\n typeof transactionId === 'string' ? transactionId : '';\n\n return SmallcaseGatewayNative.triggerMfTransaction(safeTransactionId);\n};\n\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n */\nconst launchSmallplug = async (targetEndpoint, params) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n\n return SmallcaseGatewayNative.launchSmallplug(safeEndpoint, safeParams);\n};\n\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n * @param {string} headerColor\n * @param {number} headerOpacity\n * @param {string} backIconColor\n * @param {number} backIconOpacity\n */\nconst launchSmallplugWithBranding = async (\n targetEndpoint,\n params,\n headerColor,\n headerOpacity,\n backIconColor,\n backIconOpacity\n) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n const safeHeaderColor =\n typeof headerColor === 'string'\n ? headerColor\n : platformSpecificColorHex('2F363F');\n const safeHeaderOpacity =\n typeof headerOpacity === 'number' ? headerOpacity : 1;\n const safeBackIconColor =\n typeof backIconColor === 'string'\n ? backIconColor\n : platformSpecificColorHex('FFFFFF');\n const safeBackIconOpacity =\n typeof backIconOpacity === 'number' ? backIconOpacity : 1;\n\nreturn SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint,\n safeParams,\n safeHeaderColor,\n safeHeaderOpacity,\n safeBackIconColor,\n safeBackIconOpacity\n );\n};\n\n/**\n * Logs the user out and removes the web session.\n *\n * This promise will be rejected if logout was unsuccessful\n *\n * @returns {Promise}\n */\nconst logoutUser = async () => {\n return SmallcaseGatewayNative.logoutUser();\n};\n\n/**\n * This will display a list of all the orders that a user recently placed.\n * This includes pending, successful, and failed orders.\n * @returns\n */\nconst showOrders = async () => {\n return SmallcaseGatewayNative.showOrders();\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n */\nconst triggerLeadGen = (userDetails, utmParams) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n\n return SmallcaseGatewayNative.triggerLeadGen(safeParams, safeUtm);\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * * @returns {Promise}\n */\nconst triggerLeadGenWithStatus = async (userDetails) => {\n const safeParams = safeObject(userDetails);\n\n return SmallcaseGatewayNative.triggerLeadGenWithStatus(safeParams);\n};\n\n/**\n * triggers the lead gen flow with an option of \"login here\" cta\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n * @param {boolean} [showLoginCta]\n * @returns {Promise}\n */\nconst triggerLeadGenWithLoginCta = async (\n userDetails,\n utmParams,\n showLoginCta\n) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n const safeShowLoginCta = Boolean(showLoginCta);\n\n return SmallcaseGatewayNative.triggerLeadGenWithLoginCta(\n safeParams,\n safeUtm,\n safeShowLoginCta\n );\n};\n\n/**\n * Marks a smallcase as archived\n *\n * @param {String} iscid\n */\nconst archiveSmallcase = async (iscid) => {\n const safeIscid = typeof iscid === 'string' ? iscid : '';\n\n return SmallcaseGatewayNative.archiveSmallcase(safeIscid);\n};\n\n/**\n * Returns the native android/ios and react-native sdk version\n * (internal-tracking)\n * @returns {Promise}\n */\nconst getSdkVersion = async () => {\n return SmallcaseGatewayNative.getSdkVersion(version);\n};\n\nconst SmallcaseGateway = {\n init,\n logoutUser,\n triggerLeadGen,\n triggerLeadGenWithStatus,\n triggerLeadGenWithLoginCta,\n archiveSmallcase,\n triggerTransaction,\n triggerMfTransaction,\n setConfigEnvironment,\n launchSmallplug,\n launchSmallplugWithBranding,\n getSdkVersion,\n showOrders,\n};\n\nexport default SmallcaseGateway;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,MAAM;EAAEI,gBAAgB,EAAEC;AAAuB,CAAC,GAAGC,0BAAa;;AA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","_constants","_util","_package","SmallcaseGateway","SmallcaseGatewayNative","NativeModules","defaultBrokerList","setConfigEnvironment","envConfig","safeConfig","safeObject","setHybridSdkVersion","version","brokerList","gatewayName","isLeprechaun","isAmoEnabled","environmentName","safeIsLeprechaun","Boolean","safeIsAmoEnabled","safeBrokerList","Array","isArray","safeGatewayName","safeEnvName","ENV","PROD","init","sdkToken","safeToken","triggerTransaction","transactionId","utmParams","safeUtm","safeId","length","triggerMfTransaction","console","warn","safeTransactionId","launchSmallplug","targetEndpoint","params","safeEndpoint","safeParams","launchSmallplugWithBranding","headerColor","headerOpacity","backIconColor","backIconOpacity","safeHeaderColor","platformSpecificColorHex","safeHeaderOpacity","safeBackIconColor","safeBackIconOpacity","logoutUser","showOrders","triggerLeadGen","userDetails","triggerLeadGenWithStatus","triggerLeadGenWithLoginCta","showLoginCta","safeShowLoginCta","archiveSmallcase","iscid","safeIscid","getSdkVersion","_default","exports","default"],"sources":["SmallcaseGateway.js"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport { ENV } from './constants';\nimport { safeObject, platformSpecificColorHex } from './util';\nimport { version } from '../package.json';\nconst { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules;\n\n/**\n *\n * @typedef {Object} envConfig\n * @property {string} gatewayName - unique name on consumer\n * @property {boolean} isLeprechaun - leprechaun mode toggle\n * @property {boolean} isAmoEnabled - support AMO (subject to broker support)\n * @property {Array<string>} brokerList - list of broker names\n * @property {'production' | 'staging' | 'development'} environmentName - environment name\n *\n * @typedef {Object} transactionRes\n * @property {string} data - response data\n * @property {boolean} success - success flag\n * @property {Number} [errorCode] - error code\n * @property {string} transaction - transaction name\n *\n * @typedef {Object} userDetails\n * @property {String} name - name of user\n * @property {String} email - email of user\n * @property {String} contact - contact of user\n * @property {String} pinCode - pin-code of user\n *\n * @typedef {Object} SmallplugUiConfig\n * @property {String} headerColor - color of the header background\n * @property {Number} headerOpacity - opacity of the header background\n * @property {String} backIconColor - color of the back icon\n * @property {Number} backIconOpacity - opacity of the back icon\n *\n */\n\nlet defaultBrokerList = [];\n\n/**\n * configure the sdk with\n * @param {envConfig} envConfig\n */\nconst setConfigEnvironment = async (envConfig) => {\n const safeConfig = safeObject(envConfig);\n\n await SmallcaseGatewayNative.setHybridSdkVersion(version);\n\n const {\n brokerList,\n gatewayName,\n isLeprechaun,\n isAmoEnabled,\n environmentName,\n } = safeConfig;\n\n const safeIsLeprechaun = Boolean(isLeprechaun);\n const safeIsAmoEnabled = Boolean(isAmoEnabled);\n const safeBrokerList = Array.isArray(brokerList) ? brokerList : [];\n const safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';\n const safeEnvName =\n typeof environmentName === 'string' ? environmentName : ENV.PROD;\n\n defaultBrokerList = safeBrokerList;\n\n await SmallcaseGatewayNative.setConfigEnvironment(\n safeEnvName,\n safeGatewayName,\n safeIsLeprechaun,\n safeIsAmoEnabled,\n safeBrokerList\n );\n};\n\n/**\n * initialize sdk with a session\n *\n * note: this must be called after `setConfigEnvironment()`\n * @param {string} sdkToken\n */\nconst init = async (sdkToken) => {\n const safeToken = typeof sdkToken === 'string' ? sdkToken : '';\n return SmallcaseGatewayNative.init(safeToken);\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @param {Object} [utmParams]\n * @param {Array<string>} [brokerList]\n * @returns {Promise<transactionRes>}\n */\nconst triggerTransaction = async (transactionId, utmParams, brokerList) => {\n const safeUtm = safeObject(utmParams);\n const safeId = typeof transactionId === 'string' ? transactionId : '';\n\n const safeBrokerList =\n Array.isArray(brokerList) && brokerList.length\n ? brokerList\n : defaultBrokerList;\n\n return SmallcaseGatewayNative.triggerTransaction(\n safeId,\n safeUtm,\n safeBrokerList\n );\n};\n\n/**\n * triggers a transaction with a transaction id\n * @deprecated triggerMfTransaction will be removed soon. Please use triggerTransaction.\n * @param {string} transactionId\n * @returns {Promise<transactionRes>}\n */\nconst triggerMfTransaction = async (transactionId) => {\n console.warn(\n 'Calling deprecated function! triggerMfTransaction will be removed soon. Please use triggerTransaction.'\n );\n const safeTransactionId =\n typeof transactionId === 'string' ? transactionId : '';\n\n return SmallcaseGatewayNative.triggerMfTransaction(safeTransactionId);\n};\n\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n */\nconst launchSmallplug = async (targetEndpoint, params) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n\n return SmallcaseGatewayNative.launchSmallplug(safeEndpoint, safeParams);\n};\n\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n * @param {string} headerColor\n * @param {number} headerOpacity\n * @param {string} backIconColor\n * @param {number} backIconOpacity\n */\nconst launchSmallplugWithBranding = async (\n targetEndpoint,\n params,\n headerColor,\n headerOpacity,\n backIconColor,\n backIconOpacity\n) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n const safeHeaderColor =\n typeof headerColor === 'string'\n ? headerColor\n : platformSpecificColorHex('2F363F');\n const safeHeaderOpacity =\n typeof headerOpacity === 'number' ? headerOpacity : 1;\n const safeBackIconColor =\n typeof backIconColor === 'string'\n ? backIconColor\n : platformSpecificColorHex('FFFFFF');\n const safeBackIconOpacity =\n typeof backIconOpacity === 'number' ? backIconOpacity : 1;\n\nreturn SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint,\n safeParams,\n safeHeaderColor,\n safeHeaderOpacity,\n safeBackIconColor,\n safeBackIconOpacity\n );\n};\n\n/**\n * Logs the user out and removes the web session.\n *\n * This promise will be rejected if logout was unsuccessful\n *\n * @returns {Promise}\n */\nconst logoutUser = async () => {\n return SmallcaseGatewayNative.logoutUser();\n};\n\n/**\n * This will display a list of all the orders that a user recently placed.\n * This includes pending, successful, and failed orders.\n * @returns\n */\nconst showOrders = async () => {\n return SmallcaseGatewayNative.showOrders();\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n */\nconst triggerLeadGen = (userDetails, utmParams) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n\n return SmallcaseGatewayNative.triggerLeadGen(safeParams, safeUtm);\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * * @returns {Promise}\n */\nconst triggerLeadGenWithStatus = async (userDetails) => {\n const safeParams = safeObject(userDetails);\n\n return SmallcaseGatewayNative.triggerLeadGenWithStatus(safeParams);\n};\n\n/**\n * triggers the lead gen flow with an option of \"login here\" cta\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n * @param {boolean} [showLoginCta]\n * @returns {Promise}\n */\nconst triggerLeadGenWithLoginCta = async (\n userDetails,\n utmParams,\n showLoginCta\n) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n const safeShowLoginCta = Boolean(showLoginCta);\n\n return SmallcaseGatewayNative.triggerLeadGenWithLoginCta(\n safeParams,\n safeUtm,\n safeShowLoginCta\n );\n};\n\n/**\n * Marks a smallcase as archived\n *\n * @param {String} iscid\n */\nconst archiveSmallcase = async (iscid) => {\n const safeIscid = typeof iscid === 'string' ? iscid : '';\n\n return SmallcaseGatewayNative.archiveSmallcase(safeIscid);\n};\n\n/**\n * Returns the native android/ios and react-native sdk version\n * (internal-tracking)\n * @returns {Promise}\n */\nconst getSdkVersion = async () => {\n return SmallcaseGatewayNative.getSdkVersion(version);\n};\n\nconst SmallcaseGateway = {\n init,\n logoutUser,\n triggerLeadGen,\n triggerLeadGenWithStatus,\n triggerLeadGenWithLoginCta,\n archiveSmallcase,\n triggerTransaction,\n triggerMfTransaction,\n setConfigEnvironment,\n launchSmallplug,\n launchSmallplugWithBranding,\n getSdkVersion,\n showOrders,\n};\n\nexport default SmallcaseGateway;"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE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;EACbV;AACF,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEanE,gBAAgB","ignoreList":[]}
@@ -3,6 +3,30 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "SCGatewayEventManager", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _SCGatewayEventEmitter.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "SCGatewayEventTypes", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _SCGatewayEventEmitter.SCGatewayEventTypes;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SCLoansEventManager", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _SCLoansEventEmitter.default;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "SCLoansEventTypes", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _SCLoansEventEmitter.SCLoansEventTypes;
28
+ }
29
+ });
6
30
  Object.defineProperty(exports, "ScLoan", {
7
31
  enumerable: true,
8
32
  get: function () {
@@ -12,7 +36,10 @@ Object.defineProperty(exports, "ScLoan", {
12
36
  exports.default = void 0;
13
37
  var _SmallcaseGateway = _interopRequireDefault(require("./SmallcaseGateway"));
14
38
  var _ScLoan = _interopRequireDefault(require("./ScLoan"));
39
+ var _SCGatewayEventEmitter = _interopRequireWildcard(require("./SCGatewayEventEmitter"));
40
+ var _SCLoansEventEmitter = _interopRequireWildcard(require("./SCLoansEventEmitter"));
15
41
  var _constants = require("./constants");
42
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
43
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
44
  var _default = exports.default = {
18
45
  ..._SmallcaseGateway.default,
@@ -1 +1 @@
1
- {"version":3,"names":["_SmallcaseGateway","_interopRequireDefault","require","_ScLoan","_constants","e","__esModule","default","_default","exports","SmallcaseGateway","ENV","ERROR_MSG","TRANSACTION_TYPE"],"sources":["index.js"],"sourcesContent":["import SmallcaseGateway from \"./SmallcaseGateway\";\nimport ScLoan from \"./ScLoan\";\nimport { ENV, TRANSACTION_TYPE, ERROR_MSG } from \"./constants\";\n\nexport { ScLoan }\nexport default { ...SmallcaseGateway, ENV, ERROR_MSG, TRANSACTION_TYPE };\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAA+D,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAGhD;EAAE,GAAGG,yBAAgB;EAAEC,GAAG,EAAHA,cAAG;EAAEC,SAAS,EAATA,oBAAS;EAAEC,gBAAgB,EAAhBA;AAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_SmallcaseGateway","_interopRequireDefault","require","_ScLoan","_SCGatewayEventEmitter","_interopRequireWildcard","_SCLoansEventEmitter","_constants","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_default","exports","SmallcaseGateway","ENV","ERROR_MSG","TRANSACTION_TYPE"],"sources":["index.js"],"sourcesContent":["import SmallcaseGateway from \"./SmallcaseGateway\";\nimport ScLoan from \"./ScLoan\";\nimport scGatewayEventManager, { SCGatewayEventTypes } from './SCGatewayEventEmitter';\nimport scLoansEventManager, { SCLoansEventTypes } from './SCLoansEventEmitter';\nimport { ENV, TRANSACTION_TYPE, ERROR_MSG } from \"./constants\";\n\nexport { ScLoan, scGatewayEventManager as SCGatewayEventManager, scLoansEventManager as SCLoansEventManager, SCGatewayEventTypes, SCLoansEventTypes }\nexport default { ...SmallcaseGateway, ENV, ERROR_MSG, TRANSACTION_TYPE };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAA+D,SAAAG,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAR,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA;AAAA,IAAAmB,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAGhD;EAAE,GAAGW,yBAAgB;EAAEC,GAAG,EAAHA,cAAG;EAAEC,SAAS,EAATA,oBAAS;EAAEC,gBAAgB,EAAhBA;AAAiB,CAAC","ignoreList":[]}
@@ -0,0 +1,102 @@
1
+ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+
3
+ /**
4
+ * @typedef {Object} GatewayEvent
5
+ * @property {string} type - Event type
6
+ * @property {any} data - Event payload data
7
+ * @property {number} timestamp - Event timestamp
8
+ *
9
+ * @typedef {Object} GatewayEventSubscription
10
+ * @property {() => void} remove - Method to unsubscribe from gateway events
11
+ *
12
+ */
13
+
14
+ const nativeModule = NativeModules.SCGatewayBridgeEmitter;
15
+ export const SCGatewayEventTypes = {
16
+ ANALYTICS_EVENT: 'scgateway_analytics_event',
17
+ SUPER_PROPERTIES_UPDATED: 'scgateway_super_properties_updated',
18
+ USER_RESET: 'scgateway_user_reset',
19
+ USER_IDENTIFY: 'scgateway_user_identify'
20
+ };
21
+ const SCGatewayNotificationEvent = 'scg_notification';
22
+ class SCGatewayEvents {
23
+ constructor() {
24
+ this.eventEmitter = null;
25
+ this.subscriptions = [];
26
+ this.initialize();
27
+ }
28
+ get isInitialized() {
29
+ return this.eventEmitter !== null;
30
+ }
31
+ initialize() {
32
+ if (nativeModule) {
33
+ this.eventEmitter = new NativeEventEmitter(nativeModule);
34
+ } else {
35
+ console.warn('[SCGatewayEvents] Native module not available');
36
+ }
37
+ }
38
+
39
+ // ===== GATEWAY EVENT METHODS =====
40
+ /**
41
+ * Subscribe to Gateway Events
42
+ * @param {(event: GatewayEvent) => void} callback - Callback function to handle gateway events
43
+ * @returns {GatewayEventSubscription} subscription - Subscription object with remove() method
44
+ */
45
+ subscribeToGatewayEvents(callback) {
46
+ if (!this.isInitialized) {
47
+ console.warn('[SCGatewayEvents] Event emitter not initialized');
48
+ return null;
49
+ }
50
+ if (typeof callback !== 'function') {
51
+ console.warn('[SCGatewayEvents] Invalid callback provided for subscription');
52
+ return null;
53
+ }
54
+ const subscription = this.eventEmitter.addListener(SCGatewayNotificationEvent, jsonString => {
55
+ if (!jsonString) {
56
+ console.warn('[SCGatewayEvents] Received null/undefined event data');
57
+ return;
58
+ }
59
+ let eventData;
60
+ try {
61
+ eventData = JSON.parse(jsonString);
62
+ } catch (error) {
63
+ console.warn('[SCGatewayEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);
64
+ return;
65
+ }
66
+ if (!eventData.type) {
67
+ console.warn('[SCGatewayEvents] Dropping event - missing event type:', eventData);
68
+ return;
69
+ }
70
+ const normalizedEvent = {
71
+ type: eventData.type,
72
+ data: eventData.data,
73
+ timestamp: eventData.timestamp || Date.now()
74
+ };
75
+ callback(normalizedEvent);
76
+ });
77
+ this.subscriptions.push(subscription);
78
+ return subscription;
79
+ }
80
+
81
+ /**
82
+ * Unsubscribe from Gateway Events
83
+ * @param {GatewayEventSubscription} subscription - Subscription returned from subscribeToGatewayEvents
84
+ */
85
+ unsubscribeFromGatewayEvents(subscription) {
86
+ if (subscription && typeof subscription.remove === 'function') {
87
+ subscription.remove();
88
+ this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);
89
+ }
90
+ }
91
+ cleanup() {
92
+ this.subscriptions.forEach(subscription => {
93
+ if (subscription && typeof subscription.remove === 'function') {
94
+ subscription.remove();
95
+ }
96
+ });
97
+ this.subscriptions = [];
98
+ }
99
+ }
100
+ const scGatewayEventManager = new SCGatewayEvents();
101
+ export default scGatewayEventManager;
102
+ //# sourceMappingURL=SCGatewayEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","nativeModule","SCGatewayBridgeEmitter","SCGatewayEventTypes","ANALYTICS_EVENT","SUPER_PROPERTIES_UPDATED","USER_RESET","USER_IDENTIFY","SCGatewayNotificationEvent","SCGatewayEvents","constructor","eventEmitter","subscriptions","initialize","isInitialized","console","warn","subscribeToGatewayEvents","callback","subscription","addListener","jsonString","eventData","JSON","parse","error","type","normalizedEvent","data","timestamp","Date","now","push","unsubscribeFromGatewayEvents","remove","filter","sub","cleanup","forEach","scGatewayEventManager"],"sources":["SCGatewayEventEmitter.js"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n Platform\n} from 'react-native';\n\n/**\n * @typedef {Object} GatewayEvent\n * @property {string} type - Event type\n * @property {any} data - Event payload data\n * @property {number} timestamp - Event timestamp\n *\n * @typedef {Object} GatewayEventSubscription\n * @property {() => void} remove - Method to unsubscribe from gateway events\n *\n */\n\nconst nativeModule = NativeModules.SCGatewayBridgeEmitter;\n\nexport const SCGatewayEventTypes = {\n ANALYTICS_EVENT: 'scgateway_analytics_event',\n SUPER_PROPERTIES_UPDATED: 'scgateway_super_properties_updated',\n USER_RESET: 'scgateway_user_reset',\n USER_IDENTIFY: 'scgateway_user_identify',\n};\n\nconst SCGatewayNotificationEvent = 'scg_notification';\n\nclass SCGatewayEvents {\n constructor() {\n this.eventEmitter = null;\n this.subscriptions = [];\n this.initialize();\n }\n\n get isInitialized() {\n return this.eventEmitter !== null;\n }\n\n initialize() {\n if (nativeModule) {\n this.eventEmitter = new NativeEventEmitter(nativeModule);\n } else {\n console.warn('[SCGatewayEvents] Native module not available');\n }\n }\n\n // ===== GATEWAY EVENT METHODS =====\n /**\n * Subscribe to Gateway Events\n * @param {(event: GatewayEvent) => void} callback - Callback function to handle gateway events\n * @returns {GatewayEventSubscription} subscription - Subscription object with remove() method\n */\n subscribeToGatewayEvents(callback) {\n if (!this.isInitialized) {\n console.warn('[SCGatewayEvents] Event emitter not initialized');\n return null;\n }\n\n if (typeof callback !== 'function') {\n console.warn('[SCGatewayEvents] Invalid callback provided for subscription');\n return null;\n }\n\n const subscription = this.eventEmitter.addListener(SCGatewayNotificationEvent, (jsonString) => {\n if (!jsonString) {\n console.warn('[SCGatewayEvents] Received null/undefined event data');\n return;\n }\n\n let eventData;\n try {\n eventData = JSON.parse(jsonString);\n } catch (error) {\n console.warn('[SCGatewayEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);\n return;\n }\n\n if (!eventData.type) {\n console.warn('[SCGatewayEvents] Dropping event - missing event type:', eventData);\n return;\n }\n\n const normalizedEvent = {\n type: eventData.type,\n data: eventData.data,\n timestamp: eventData.timestamp || Date.now()\n };\n\n callback(normalizedEvent);\n });\n\n this.subscriptions.push(subscription);\n\n return subscription;\n }\n\n /**\n * Unsubscribe from Gateway Events\n * @param {GatewayEventSubscription} subscription - Subscription returned from subscribeToGatewayEvents\n */\n unsubscribeFromGatewayEvents(subscription) {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);\n }\n }\n\n cleanup() {\n this.subscriptions.forEach(subscription => {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n }\n });\n this.subscriptions = [];\n }\n}\n\nconst scGatewayEventManager = new SCGatewayEvents();\n\nexport default scGatewayEventManager;"],"mappings":"AAAA,SACIA,kBAAkB,EAClBC,aAAa,EACbC,QAAQ,QACL,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,YAAY,GAAGF,aAAa,CAACG,sBAAsB;AAEzD,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,eAAe,EAAE,2BAA2B;EAC5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AAC;QAC7F;MACJ;MAEA,IAAI,CAACC,SAAS,CAACI,IAAI,EAAE;QACjBX,OAAO,CAACC,IAAI,CAAC,wDAAwD,EAAEM,SAAS,CAAC;QACjF;MACJ;MAEA,MAAMK,eAAe,GAAG;QACpBD,IAAI,EAAEJ,SAAS,CAACI,IAAI;QACpBE,IAAI,EAAEN,SAAS,CAACM,IAAI;QACpBC,SAAS,EAAEP,SAAS,CAACO,SAAS,IAAIC,IAAI,CAACC,GAAG,CAAC;MAC/C,CAAC;MAEDb,QAAQ,CAACS,eAAe,CAAC;IAC7B,CAAC,CAAC;IAEF,IAAI,CAACf,aAAa,CAACoB,IAAI,CAACb,YAAY,CAAC;IAErC,OAAOA,YAAY;EACvB;;EAEA;AACJ;AACA;AACA;EACIc,4BAA4BA,CAACd,YAAY,EAAE;IACvC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;MAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACrB,IAAI,CAACtB,aAAa,GAAG,IAAI,CAACA,aAAa,CAACuB,MAAM,CAACC,GAAG,IAAIA,GAAG,KAAKjB,YAAY,CAAC;IAC/E;EACJ;EAEAkB,OAAOA,CAAA,EAAG;IACN,IAAI,CAACzB,aAAa,CAAC0B,OAAO,CAACnB,YAAY,IAAI;MACvC,IAAIA,YAAY,IAAI,OAAOA,YAAY,CAACe,MAAM,KAAK,UAAU,EAAE;QAC3Df,YAAY,CAACe,MAAM,CAAC,CAAC;MACzB;IACJ,CAAC,CAAC;IACF,IAAI,CAACtB,aAAa,GAAG,EAAE;EAC3B;AACJ;AAEA,MAAM2B,qBAAqB,GAAG,IAAI9B,eAAe,CAAC,CAAC;AAEnD,eAAe8B,qBAAqB","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+
3
+ /**
4
+ * @typedef {Object} LoansEvent
5
+ * @property {string} type - Event type
6
+ * @property {number} timestamp - Event timestamp
7
+ *
8
+ * @typedef {Object} LoansEventSubscription
9
+ * @property {() => void} remove - Method to unsubscribe from loans events
10
+ */
11
+
12
+ const nativeModule = NativeModules.SCLoansBridgeEmitter;
13
+ export const SCLoansEventTypes = {
14
+ ANALYTICS_EVENT: 'scloans_analytics_event',
15
+ SUPER_PROPERTIES_UPDATED: 'scloans_super_properties_updated'
16
+ };
17
+ const SCLoansNotificationEvent = 'scloans_notification';
18
+ class SCLoansEvents {
19
+ constructor() {
20
+ this.eventEmitter = null;
21
+ this.subscriptions = [];
22
+ this.initialize();
23
+ }
24
+ get isInitialized() {
25
+ return this.eventEmitter !== null;
26
+ }
27
+ initialize() {
28
+ if (nativeModule) {
29
+ this.eventEmitter = new NativeEventEmitter(nativeModule);
30
+ } else {
31
+ console.warn('[SCLoansEvents] Native module not available');
32
+ }
33
+ }
34
+
35
+ // ===== LOANS EVENT METHODS =====
36
+ /**
37
+ * Subscribe to Loans Events
38
+ * @param {(event: LoansEvent) => void} callback - Callback function to handle loans events
39
+ * @returns {LoansEventSubscription} subscription - Subscription object with remove() method
40
+ */
41
+ subscribeToLoansEvent(callback) {
42
+ if (!this.isInitialized) {
43
+ console.warn('[SCLoansEvents] Event emitter not initialized');
44
+ return null;
45
+ }
46
+ if (typeof callback !== 'function') {
47
+ console.warn('[SCLoansEvents] Invalid callback provided for subscription');
48
+ return null;
49
+ }
50
+ const subscription = this.eventEmitter.addListener(SCLoansNotificationEvent, jsonString => {
51
+ if (!jsonString) {
52
+ console.warn('[SCLoansEvents] Received null/undefined event data');
53
+ return;
54
+ }
55
+ let eventData;
56
+ try {
57
+ eventData = JSON.parse(jsonString);
58
+ } catch (error) {
59
+ console.warn('[SCLoansEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);
60
+ return;
61
+ }
62
+ if (!eventData.type) {
63
+ console.warn('[SCLoansEvents] Dropping event - missing event type:', eventData);
64
+ return;
65
+ }
66
+ const normalizedEvent = {
67
+ type: eventData.type,
68
+ data: eventData.data,
69
+ timestamp: eventData.timestamp || Date.now()
70
+ };
71
+ callback(normalizedEvent);
72
+ });
73
+ this.subscriptions.push(subscription);
74
+ return subscription;
75
+ }
76
+
77
+ /**
78
+ * Unsubscribe from Loans Events
79
+ * @param {LoansEventSubscription} subscription - Subscription returned from subscribeToLoansEvents
80
+ */
81
+ unsubscribeFromLoansEvent(subscription) {
82
+ if (subscription && typeof subscription.remove === 'function') {
83
+ subscription.remove();
84
+ this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);
85
+ }
86
+ }
87
+ cleanup() {
88
+ this.subscriptions.forEach(subscription => {
89
+ if (subscription && typeof subscription.remove === 'function') {
90
+ subscription.remove();
91
+ }
92
+ });
93
+ this.subscriptions = [];
94
+ }
95
+ }
96
+ const scLoansEventManager = new SCLoansEvents();
97
+ export default scLoansEventManager;
98
+ //# sourceMappingURL=SCLoansEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","nativeModule","SCLoansBridgeEmitter","SCLoansEventTypes","ANALYTICS_EVENT","SUPER_PROPERTIES_UPDATED","SCLoansNotificationEvent","SCLoansEvents","constructor","eventEmitter","subscriptions","initialize","isInitialized","console","warn","subscribeToLoansEvent","callback","subscription","addListener","jsonString","eventData","JSON","parse","error","type","normalizedEvent","data","timestamp","Date","now","push","unsubscribeFromLoansEvent","remove","filter","sub","cleanup","forEach","scLoansEventManager"],"sources":["SCLoansEventEmitter.js"],"sourcesContent":["import {\n NativeEventEmitter,\n NativeModules,\n Platform\n} from 'react-native';\n\n/**\n * @typedef {Object} LoansEvent\n * @property {string} type - Event type\n * @property {number} timestamp - Event timestamp\n *\n * @typedef {Object} LoansEventSubscription\n * @property {() => void} remove - Method to unsubscribe from loans events\n */\n\nconst nativeModule = NativeModules.SCLoansBridgeEmitter;\n\nexport const SCLoansEventTypes = {\n ANALYTICS_EVENT: 'scloans_analytics_event',\n SUPER_PROPERTIES_UPDATED: 'scloans_super_properties_updated',\n};\n\nconst SCLoansNotificationEvent = 'scloans_notification';\nclass SCLoansEvents {\n constructor() {\n this.eventEmitter = null;\n this.subscriptions = [];\n this.initialize();\n }\n\n get isInitialized() {\n return this.eventEmitter !== null;\n }\n\n initialize() {\n if (nativeModule) {\n this.eventEmitter = new NativeEventEmitter(nativeModule);\n } else {\n console.warn('[SCLoansEvents] Native module not available');\n }\n }\n\n // ===== LOANS EVENT METHODS =====\n /**\n * Subscribe to Loans Events\n * @param {(event: LoansEvent) => void} callback - Callback function to handle loans events\n * @returns {LoansEventSubscription} subscription - Subscription object with remove() method\n */\n subscribeToLoansEvent(callback) {\n if (!this.isInitialized) {\n console.warn('[SCLoansEvents] Event emitter not initialized');\n return null;\n }\n\n if (typeof callback !== 'function') {\n console.warn('[SCLoansEvents] Invalid callback provided for subscription');\n return null;\n }\n\n const subscription = this.eventEmitter.addListener(SCLoansNotificationEvent, (jsonString) => {\n if (!jsonString) {\n console.warn('[SCLoansEvents] Received null/undefined event data');\n return;\n }\n\n let eventData;\n try {\n eventData = JSON.parse(jsonString);\n } catch (error) {\n console.warn('[SCLoansEvents] Failed to parse event JSON:', error, 'Raw data:', jsonString);\n return;\n }\n\n if (!eventData.type) {\n console.warn('[SCLoansEvents] Dropping event - missing event type:', eventData);\n return;\n }\n\n const normalizedEvent = {\n type: eventData.type,\n data: eventData.data,\n timestamp: eventData.timestamp || Date.now()\n };\n\n callback(normalizedEvent);\n });\n\n this.subscriptions.push(subscription);\n\n return subscription;\n }\n\n /**\n * Unsubscribe from Loans Events\n * @param {LoansEventSubscription} subscription - Subscription returned from subscribeToLoansEvents\n */\n unsubscribeFromLoansEvent(subscription) {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n this.subscriptions = this.subscriptions.filter(sub => sub !== subscription);\n }\n }\n\n cleanup() {\n this.subscriptions.forEach(subscription => {\n if (subscription && typeof subscription.remove === 'function') {\n subscription.remove();\n }\n });\n this.subscriptions = [];\n }\n}\n\nconst scLoansEventManager = new SCLoansEvents();\n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