react-native-mytatva-rn-sdk 1.2.20 → 1.2.21
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/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +300 -247
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +371 -427
- package/lib/commonjs/CGMConnect.js +9 -4
- package/lib/commonjs/CGMConnect.js.map +1 -1
- package/lib/module/CGMConnect.js +9 -4
- package/lib/module/CGMConnect.js.map +1 -1
- package/package.json +1 -1
- package/src/CGMConnect.ts +18 -12
|
@@ -77,10 +77,15 @@ exports.reconnectCGM = reconnectCGM;
|
|
|
77
77
|
const observeAllGlucoseDataHandler = async token => {
|
|
78
78
|
console.log('observeAllGlucoseDataHandler====');
|
|
79
79
|
try {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
81
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
82
|
+
const deviceStatus = await cgmLib.observeDeviceStatus(token);
|
|
83
|
+
console.log(result);
|
|
84
|
+
console.log(deviceStatus);
|
|
85
|
+
} else if (_reactNative.Platform.OS === 'ios') {
|
|
86
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
87
|
+
console.log(result);
|
|
88
|
+
}
|
|
84
89
|
} catch (error) {
|
|
85
90
|
console.log('error====', error);
|
|
86
91
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","eventSubscription","LINKING_ERROR","Platform","select","ios","default","cgmLib","NativeModules","CgmTrackyLib","Proxy","get","Error","initializeCGMEventListener","callback","iosEventEmitter","NativeEventEmitter","remove","OS","DeviceEventEmitter","addListener","eventData","status","removeCGMEventListener","startCGM","token","console","log","result","startCgmTracky","error","exports","reconnectCGM","reconnectCgmTracky","observeAllGlucoseDataHandler","observeAllGlucoseData","deviceStatus","observeDeviceStatus","helpCGM","openHelpSupport","observeTransmitterUnbindStatusHandler","observeTransmitterUnbindStatus","stopCGM"],"sources":["CGMConnect.ts"],"sourcesContent":["import { DeviceEventEmitter, EmitterSubscription, NativeEventEmitter, NativeModules, Platform } from \"react-native\";\n\n\n\n\nlet eventSubscription: EmitterSubscription | null = null;\n\nconst LINKING_ERROR =\n `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst cgmLib = NativeModules.CgmTrackyLib\n ? NativeModules.CgmTrackyLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n\n\nfunction initializeCGMEventListener(\n callback: (eventData: any) => void\n) {\n const iosEventEmitter = new NativeEventEmitter(cgmLib);\n if (eventSubscription) {\n eventSubscription.remove();\n }\n\n if (Platform.OS === 'android') {\n eventSubscription = DeviceEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n } \n else if (Platform.OS === 'ios' && iosEventEmitter) {\n eventSubscription = iosEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n }\n}\n\nfunction removeCGMEventListener() {\n if (eventSubscription) {\n eventSubscription.remove();\n eventSubscription = null;\n }\n}\n\n\n\nconst startCGM = async (token: string) => {\n console.log('token====startCGM', token);\n try {\n const result = await cgmLib.startCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const reconnectCGM = async (token: string) => {\n console.log('reconnectCGM====');\n try {\n const result = await cgmLib.reconnectCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n\n
|
|
1
|
+
{"version":3,"names":["_reactNative","require","eventSubscription","LINKING_ERROR","Platform","select","ios","default","cgmLib","NativeModules","CgmTrackyLib","Proxy","get","Error","initializeCGMEventListener","callback","iosEventEmitter","NativeEventEmitter","remove","OS","DeviceEventEmitter","addListener","eventData","status","removeCGMEventListener","startCGM","token","console","log","result","startCgmTracky","error","exports","reconnectCGM","reconnectCgmTracky","observeAllGlucoseDataHandler","observeAllGlucoseData","deviceStatus","observeDeviceStatus","helpCGM","openHelpSupport","observeTransmitterUnbindStatusHandler","observeTransmitterUnbindStatus","stopCGM"],"sources":["CGMConnect.ts"],"sourcesContent":["import { DeviceEventEmitter, EmitterSubscription, NativeEventEmitter, NativeModules, Platform } from \"react-native\";\n\n\n\n\nlet eventSubscription: EmitterSubscription | null = null;\n\nconst LINKING_ERROR =\n `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst cgmLib = NativeModules.CgmTrackyLib\n ? NativeModules.CgmTrackyLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n\n\nfunction initializeCGMEventListener(\n callback: (eventData: any) => void\n) {\n const iosEventEmitter = new NativeEventEmitter(cgmLib);\n if (eventSubscription) {\n eventSubscription.remove();\n }\n\n if (Platform.OS === 'android') {\n eventSubscription = DeviceEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n } \n else if (Platform.OS === 'ios' && iosEventEmitter) {\n eventSubscription = iosEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n }\n}\n\nfunction removeCGMEventListener() {\n if (eventSubscription) {\n eventSubscription.remove();\n eventSubscription = null;\n }\n}\n\n\n\nconst startCGM = async (token: string) => {\n console.log('token====startCGM', token);\n try {\n const result = await cgmLib.startCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const reconnectCGM = async (token: string) => {\n console.log('reconnectCGM====');\n try {\n const result = await cgmLib.reconnectCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n\n const observeAllGlucoseDataHandler = async (token: string) => {\n console.log('observeAllGlucoseDataHandler====');\n try {\n if(Platform.OS === 'android') { \n const result = await cgmLib.observeAllGlucoseData(token);\n const deviceStatus = await cgmLib.observeDeviceStatus(token);\n console.log(result);\n console.log(deviceStatus);\n }\n else if(Platform.OS === 'ios') {\n const result = await cgmLib.observeAllGlucoseData(token);\n console.log(result);\n }\n } catch (error) {\n console.log('error====', error);\n console.error(error);\n }\n };\n\n\nconst helpCGM = async (token: string) => {\n console.log('helpCGM====');\n try {\n const result = await cgmLib.openHelpSupport();\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n};\n\nconst observeTransmitterUnbindStatusHandler = async (token: string) => {\n console.log('observeTransmitterUnbindStatusHandler====');\n try {\n const result = await cgmLib.observeTransmitterUnbindStatus(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n};\n\n\n\nconst stopCGM = async () => {\n // Implementation\n};\n\nexport { startCGM, stopCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler };"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAIC,iBAA6C,GAAG,IAAI;AAExD,MAAMC,aAAa,GACjB,sFAAsF,GACtFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD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AK,CAAC;MACxDC,OAAO,CAACC,GAAG,CAACC,MAAM,CAAC;IACrB;EACF,CAAC,CAAC,OAAOE,KAAK,EAAE;IACdJ,OAAO,CAACC,GAAG,CAAC,WAAW,EAAEG,KAAK,CAAC;IAC/BJ,OAAO,CAACI,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC;AAACC,OAAA,CAAAG,4BAAA,GAAAA,4BAAA;AAGR,MAAMI,OAAO,GAAG,MAAOb,KAAa,IAAK;EACvCC,OAAO,CAACC,GAAG,CAAC,aAAa,CAAC;EAC1B,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMrB,MAAM,CAACgC,eAAe,CAAC,CAAC;IAC7Cb,OAAO,CAACC,GAAG,CAACC,MAAM,CAAC;EACrB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACdJ,OAAO,CAACI,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC;AAACC,OAAA,CAAAO,OAAA,GAAAA,OAAA;AAEF,MAAME,qCAAqC,GAAG,MAAOf,KAAa,IAAK;EACrEC,OAAO,CAACC,GAAG,CAAC,2CAA2C,CAAC;EACxD,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMrB,MAAM,CAACkC,8BAA8B,CAAChB,KAAK,CAAC;IACjEC,OAAO,CAACC,GAAG,CAACC,MAAM,CAAC;EACrB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACdJ,OAAO,CAACI,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC;AAACC,OAAA,CAAAS,qCAAA,GAAAA,qCAAA;AAIF,MAAME,OAAO,GAAG,MAAAA,CAAA,KAAY;EAC1B;AAAA,CACD;AAACX,OAAA,CAAAW,OAAA,GAAAA,OAAA","ignoreList":[]}
|
package/lib/module/CGMConnect.js
CHANGED
|
@@ -65,10 +65,15 @@ const reconnectCGM = async token => {
|
|
|
65
65
|
const observeAllGlucoseDataHandler = async token => {
|
|
66
66
|
console.log('observeAllGlucoseDataHandler====');
|
|
67
67
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
if (Platform.OS === 'android') {
|
|
69
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
70
|
+
const deviceStatus = await cgmLib.observeDeviceStatus(token);
|
|
71
|
+
console.log(result);
|
|
72
|
+
console.log(deviceStatus);
|
|
73
|
+
} else if (Platform.OS === 'ios') {
|
|
74
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
75
|
+
console.log(result);
|
|
76
|
+
}
|
|
72
77
|
} catch (error) {
|
|
73
78
|
console.log('error====', error);
|
|
74
79
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceEventEmitter","NativeEventEmitter","NativeModules","Platform","eventSubscription","LINKING_ERROR","select","ios","default","cgmLib","CgmTrackyLib","Proxy","get","Error","initializeCGMEventListener","callback","iosEventEmitter","remove","OS","addListener","eventData","status","removeCGMEventListener","startCGM","token","console","log","result","startCgmTracky","error","reconnectCGM","reconnectCgmTracky","observeAllGlucoseDataHandler","observeAllGlucoseData","deviceStatus","observeDeviceStatus","helpCGM","openHelpSupport","observeTransmitterUnbindStatusHandler","observeTransmitterUnbindStatus","stopCGM"],"sources":["CGMConnect.ts"],"sourcesContent":["import { DeviceEventEmitter, EmitterSubscription, NativeEventEmitter, NativeModules, Platform } from \"react-native\";\n\n\n\n\nlet eventSubscription: EmitterSubscription | null = null;\n\nconst LINKING_ERROR =\n `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst cgmLib = NativeModules.CgmTrackyLib\n ? NativeModules.CgmTrackyLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n\n\nfunction initializeCGMEventListener(\n callback: (eventData: any) => void\n) {\n const iosEventEmitter = new NativeEventEmitter(cgmLib);\n if (eventSubscription) {\n eventSubscription.remove();\n }\n\n if (Platform.OS === 'android') {\n eventSubscription = DeviceEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n } \n else if (Platform.OS === 'ios' && iosEventEmitter) {\n eventSubscription = iosEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n }\n}\n\nfunction removeCGMEventListener() {\n if (eventSubscription) {\n eventSubscription.remove();\n eventSubscription = null;\n }\n}\n\n\n\nconst startCGM = async (token: string) => {\n console.log('token====startCGM', token);\n try {\n const result = await cgmLib.startCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const reconnectCGM = async (token: string) => {\n console.log('reconnectCGM====');\n try {\n const result = await cgmLib.reconnectCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n\n
|
|
1
|
+
{"version":3,"names":["DeviceEventEmitter","NativeEventEmitter","NativeModules","Platform","eventSubscription","LINKING_ERROR","select","ios","default","cgmLib","CgmTrackyLib","Proxy","get","Error","initializeCGMEventListener","callback","iosEventEmitter","remove","OS","addListener","eventData","status","removeCGMEventListener","startCGM","token","console","log","result","startCgmTracky","error","reconnectCGM","reconnectCgmTracky","observeAllGlucoseDataHandler","observeAllGlucoseData","deviceStatus","observeDeviceStatus","helpCGM","openHelpSupport","observeTransmitterUnbindStatusHandler","observeTransmitterUnbindStatus","stopCGM"],"sources":["CGMConnect.ts"],"sourcesContent":["import { DeviceEventEmitter, EmitterSubscription, NativeEventEmitter, NativeModules, Platform } from \"react-native\";\n\n\n\n\nlet eventSubscription: EmitterSubscription | null = null;\n\nconst LINKING_ERROR =\n `The package 'react-native-mytatva-rn-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst cgmLib = NativeModules.CgmTrackyLib\n ? NativeModules.CgmTrackyLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n\n\nfunction initializeCGMEventListener(\n callback: (eventData: any) => void\n) {\n const iosEventEmitter = new NativeEventEmitter(cgmLib);\n if (eventSubscription) {\n eventSubscription.remove();\n }\n\n if (Platform.OS === 'android') {\n eventSubscription = DeviceEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n } \n else if (Platform.OS === 'ios' && iosEventEmitter) {\n eventSubscription = iosEventEmitter.addListener(\n 'cgmDeviceEvent',\n (eventData: any) => {\n const { status } = eventData;\n if (status === 'WARM_PERIOD_STARTED') {\n callback(eventData);\n } else {\n callback(eventData);\n }\n }\n );\n }\n}\n\nfunction removeCGMEventListener() {\n if (eventSubscription) {\n eventSubscription.remove();\n eventSubscription = null;\n }\n}\n\n\n\nconst startCGM = async (token: string) => {\n console.log('token====startCGM', token);\n try {\n const result = await cgmLib.startCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n const reconnectCGM = async (token: string) => {\n console.log('reconnectCGM====');\n try {\n const result = await cgmLib.reconnectCgmTracky(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n };\n\n\n const observeAllGlucoseDataHandler = async (token: string) => {\n console.log('observeAllGlucoseDataHandler====');\n try {\n if(Platform.OS === 'android') { \n const result = await cgmLib.observeAllGlucoseData(token);\n const deviceStatus = await cgmLib.observeDeviceStatus(token);\n console.log(result);\n console.log(deviceStatus);\n }\n else if(Platform.OS === 'ios') {\n const result = await cgmLib.observeAllGlucoseData(token);\n console.log(result);\n }\n } catch (error) {\n console.log('error====', error);\n console.error(error);\n }\n };\n\n\nconst helpCGM = async (token: string) => {\n console.log('helpCGM====');\n try {\n const result = await cgmLib.openHelpSupport();\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n};\n\nconst observeTransmitterUnbindStatusHandler = async (token: string) => {\n console.log('observeTransmitterUnbindStatusHandler====');\n try {\n const result = await cgmLib.observeTransmitterUnbindStatus(token);\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n};\n\n\n\nconst stopCGM = async () => {\n // Implementation\n};\n\nexport { startCGM, stopCGM, initializeCGMEventListener, removeCGMEventListener, observeAllGlucoseDataHandler, reconnectCGM, helpCGM, observeTransmitterUnbindStatusHandler };"],"mappings":"AAAA,SAASA,kBAAkB,EAAuBC,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAKnH,IAAIC,iBAA6C,GAAG,IAAI;AAExD,MAAMC,aAAa,GACjB,sFAAsF,GACtFF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,MAAM,GAAGP,aAAa,CAACQ,YAAY,GACrCR,aAAa,CAACQ,YAAY,GAC1B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAIL,SAASS,0BAA0BA,CACjCC,QAAkC,EAClC;EACA,MAAMC,eAAe,GAAG,IAAIf,kBAAkB,CAACQ,MAAM,CAAC;EACtD,IAAIL,iBAAiB,EAAE;IACrBA,iBAAiB,CAACa,MAAM,CAAC,CAAC;EAC5B;EAEA,IAAId,QAAQ,CAACe,EAAE,KAAK,SAAS,EAAE;IAC7Bd,iBAAiB,GAAGJ,kBAAkB,CAACmB,WAAW,CAChD,gBAAgB,EACfC,SAAc,IAAK;MA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;EACxD,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMlB,MAAM,CAAC8B,8BAA8B,CAACf,KAAK,CAAC;IACjEC,OAAO,CAACC,GAAG,CAACC,MAAM,CAAC;EACrB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACdJ,OAAO,CAACI,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC;AAID,MAAMW,OAAO,GAAG,MAAAA,CAAA,KAAY;EAC1B;AAAA,CACD;AAED,SAASjB,QAAQ,EAAEiB,OAAO,EAAE1B,0BAA0B,EAAEQ,sBAAsB,EAAEU,4BAA4B,EAAEF,YAAY,EAAEM,OAAO,EAAEE,qCAAqC","ignoreList":[]}
|
package/package.json
CHANGED
package/src/CGMConnect.ts
CHANGED
|
@@ -90,18 +90,24 @@ const startCGM = async (token: string) => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
const observeAllGlucoseDataHandler = async (token: string) => {
|
|
94
|
+
console.log('observeAllGlucoseDataHandler====');
|
|
95
|
+
try {
|
|
96
|
+
if(Platform.OS === 'android') {
|
|
97
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
98
|
+
const deviceStatus = await cgmLib.observeDeviceStatus(token);
|
|
99
|
+
console.log(result);
|
|
100
|
+
console.log(deviceStatus);
|
|
101
|
+
}
|
|
102
|
+
else if(Platform.OS === 'ios') {
|
|
103
|
+
const result = await cgmLib.observeAllGlucoseData(token);
|
|
104
|
+
console.log(result);
|
|
105
|
+
}
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.log('error====', error);
|
|
108
|
+
console.error(error);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
105
111
|
|
|
106
112
|
|
|
107
113
|
const helpCGM = async (token: string) => {
|