react-native-nitro-sse 2.4.1 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +209 -95
  2. package/android/src/main/java/com/margelo/nitro/nitrosse/AndroidSseDispatcher.kt +5 -0
  3. package/android/src/main/java/com/margelo/nitro/nitrosse/JsonUtils.kt +11 -18
  4. package/android/src/main/java/com/margelo/nitro/nitrosse/NetworkInspector.kt +79 -38
  5. package/android/src/main/java/com/margelo/nitro/nitrosse/NitroSse.kt +194 -100
  6. package/android/src/main/java/com/margelo/nitro/nitrosse/SseConnectionHandler.kt +40 -15
  7. package/android/src/main/java/com/margelo/nitro/nitrosse/SseDispatcher.kt +1 -0
  8. package/android/src/main/java/com/margelo/nitro/nitrosse/SseEventBuffer.kt +34 -28
  9. package/android/src/main/java/com/margelo/nitro/nitrosse/SseLifecycleManager.kt +8 -1
  10. package/android/src/main/java/com/margelo/nitro/nitrosse/SseNetworkMonitor.kt +7 -4
  11. package/android/src/main/java/com/margelo/nitro/nitrosse/SseReconnectStrategy.kt +6 -4
  12. package/ios/NitroSse.swift +244 -190
  13. package/ios/SseConfig+CopyWith.swift +2 -1
  14. package/ios/SseConnectionHandler.swift +59 -29
  15. package/ios/SseDispatchQueueDispatcher.swift +15 -2
  16. package/ios/SseDispatcher.swift +7 -1
  17. package/ios/SseEventBuffer.swift +23 -7
  18. package/ios/SseLifecycleManager.swift +10 -1
  19. package/ios/SseNetworkMonitor.swift +8 -2
  20. package/ios/SseReconnectStrategy.swift +9 -3
  21. package/lib/module/MockSseEngine.js +203 -0
  22. package/lib/module/NitroSseClient.js +411 -214
  23. package/lib/module/NitroSseError.js +61 -0
  24. package/lib/module/SseDriver.js +156 -0
  25. package/lib/module/index.js +6 -3
  26. package/lib/module/useNitroSse.js +359 -0
  27. package/lib/typescript/src/MockSseEngine.d.ts +31 -0
  28. package/lib/typescript/src/NitroSse.nitro.d.ts +25 -2
  29. package/lib/typescript/src/NitroSseClient.d.ts +25 -7
  30. package/lib/typescript/src/NitroSseError.d.ts +38 -0
  31. package/lib/typescript/src/SseDriver.d.ts +80 -0
  32. package/lib/typescript/src/SseInterface.d.ts +25 -7
  33. package/lib/typescript/src/index.d.ts +4 -2
  34. package/lib/typescript/src/useNitroSse.d.ts +69 -0
  35. package/nitrogen/generated/android/c++/JSseConfig.hpp +7 -1
  36. package/nitrogen/generated/android/c++/JSseMockConfig.hpp +2 -0
  37. package/nitrogen/generated/android/c++/JSseMockEvent.hpp +9 -3
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrosse/SseConfig.kt +9 -4
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrosse/SseMockEvent.kt +9 -4
  40. package/nitrogen/generated/ios/NitroSse-Swift-Cxx-Bridge.hpp +15 -15
  41. package/nitrogen/generated/ios/c++/HybridNitroSseSpecSwift.hpp +3 -3
  42. package/nitrogen/generated/ios/swift/SseConfig.swift +19 -1
  43. package/nitrogen/generated/ios/swift/SseMockEvent.swift +12 -1
  44. package/nitrogen/generated/shared/c++/SseConfig.hpp +5 -1
  45. package/nitrogen/generated/shared/c++/SseMockEvent.hpp +9 -2
  46. package/package.json +10 -11
  47. package/android/jacoco.gradle +0 -33
  48. package/lib/module/NitroSse.nitro.js.map +0 -1
  49. package/lib/module/NitroSseClient.js.map +0 -1
  50. package/lib/module/SseInterface.js.map +0 -1
  51. package/lib/module/index.js.map +0 -1
  52. package/lib/typescript/src/NitroSse.nitro.d.ts.map +0 -1
  53. package/lib/typescript/src/NitroSseClient.d.ts.map +0 -1
  54. package/lib/typescript/src/SseInterface.d.ts.map +0 -1
  55. package/lib/typescript/src/index.d.ts.map +0 -1
  56. package/src/NitroSse.nitro.ts +0 -58
  57. package/src/NitroSseClient.ts +0 -337
  58. package/src/SseInterface.ts +0 -272
  59. package/src/index.ts +0 -31
@@ -18,7 +18,7 @@ public extension SseMockEvent {
18
18
  /**
19
19
  * Create a new instance of `SseMockEvent`.
20
20
  */
21
- init(type: SseEventType?, data: String?, parsedData: AnyMap?, id: String?, event: String?, message: String?, statusCode: Double?, retry: Double?, delayMs: Double?) {
21
+ init(type: SseEventType?, data: String?, parsedData: AnyMap?, id: String?, event: String?, message: String?, statusCode: Double?, retry: Double?, delayMs: Double?, state: SseState?) {
22
22
  self.init({ () -> bridge.std__optional_SseEventType_ in
23
23
  if let __unwrappedValue = type {
24
24
  return bridge.create_std__optional_SseEventType_(__unwrappedValue)
@@ -73,6 +73,12 @@ public extension SseMockEvent {
73
73
  } else {
74
74
  return .init()
75
75
  }
76
+ }(), { () -> bridge.std__optional_SseState_ in
77
+ if let __unwrappedValue = state {
78
+ return bridge.create_std__optional_SseState_(__unwrappedValue)
79
+ } else {
80
+ return .init()
81
+ }
76
82
  }())
77
83
  }
78
84
 
@@ -176,4 +182,9 @@ public extension SseMockEvent {
176
182
  }
177
183
  }()
178
184
  }
185
+
186
+ @inline(__always)
187
+ var state: SseState? {
188
+ return self.__state.value
189
+ }
179
190
  }
@@ -61,6 +61,7 @@ namespace margelo::nitro::nitrosse {
61
61
  std::optional<double> maxRetryIntervalMs SWIFT_PRIVATE;
62
62
  std::optional<double> jitterFactor SWIFT_PRIVATE;
63
63
  std::optional<double> maxReconnectAttempts SWIFT_PRIVATE;
64
+ std::optional<double> maxAuthRetries SWIFT_PRIVATE;
64
65
  std::optional<bool> autoParseJSON SWIFT_PRIVATE;
65
66
  std::optional<bool> monitorNetwork SWIFT_PRIVATE;
66
67
  std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>> onBeforeRequest SWIFT_PRIVATE;
@@ -68,7 +69,7 @@ namespace margelo::nitro::nitrosse {
68
69
 
69
70
  public:
70
71
  SseConfig() = default;
71
- explicit SseConfig(std::string url, std::optional<HttpMethod> method, std::optional<std::unordered_map<std::string, std::string>> headers, std::optional<std::string> body, std::optional<bool> backgroundExecution, std::optional<double> batchingIntervalMs, std::optional<double> maxBufferSize, std::optional<double> connectionTimeoutMs, std::optional<double> readTimeoutMs, std::optional<double> retryIntervalMs, std::optional<double> maxRetryIntervalMs, std::optional<double> jitterFactor, std::optional<double> maxReconnectAttempts, std::optional<bool> autoParseJSON, std::optional<bool> monitorNetwork, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>> onBeforeRequest, std::optional<SseMockConfig> mock): url(url), method(method), headers(headers), body(body), backgroundExecution(backgroundExecution), batchingIntervalMs(batchingIntervalMs), maxBufferSize(maxBufferSize), connectionTimeoutMs(connectionTimeoutMs), readTimeoutMs(readTimeoutMs), retryIntervalMs(retryIntervalMs), maxRetryIntervalMs(maxRetryIntervalMs), jitterFactor(jitterFactor), maxReconnectAttempts(maxReconnectAttempts), autoParseJSON(autoParseJSON), monitorNetwork(monitorNetwork), onBeforeRequest(onBeforeRequest), mock(mock) {}
72
+ explicit SseConfig(std::string url, std::optional<HttpMethod> method, std::optional<std::unordered_map<std::string, std::string>> headers, std::optional<std::string> body, std::optional<bool> backgroundExecution, std::optional<double> batchingIntervalMs, std::optional<double> maxBufferSize, std::optional<double> connectionTimeoutMs, std::optional<double> readTimeoutMs, std::optional<double> retryIntervalMs, std::optional<double> maxRetryIntervalMs, std::optional<double> jitterFactor, std::optional<double> maxReconnectAttempts, std::optional<double> maxAuthRetries, std::optional<bool> autoParseJSON, std::optional<bool> monitorNetwork, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>> onBeforeRequest, std::optional<SseMockConfig> mock): url(url), method(method), headers(headers), body(body), backgroundExecution(backgroundExecution), batchingIntervalMs(batchingIntervalMs), maxBufferSize(maxBufferSize), connectionTimeoutMs(connectionTimeoutMs), readTimeoutMs(readTimeoutMs), retryIntervalMs(retryIntervalMs), maxRetryIntervalMs(maxRetryIntervalMs), jitterFactor(jitterFactor), maxReconnectAttempts(maxReconnectAttempts), maxAuthRetries(maxAuthRetries), autoParseJSON(autoParseJSON), monitorNetwork(monitorNetwork), onBeforeRequest(onBeforeRequest), mock(mock) {}
72
73
 
73
74
  public:
74
75
  // SseConfig is not equatable because these properties are not equatable: onBeforeRequest
@@ -97,6 +98,7 @@ namespace margelo::nitro {
97
98
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxRetryIntervalMs"))),
98
99
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jitterFactor"))),
99
100
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxReconnectAttempts"))),
101
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxAuthRetries"))),
100
102
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoParseJSON"))),
101
103
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "monitorNetwork"))),
102
104
  JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onBeforeRequest"))),
@@ -118,6 +120,7 @@ namespace margelo::nitro {
118
120
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxRetryIntervalMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxRetryIntervalMs));
119
121
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "jitterFactor"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.jitterFactor));
120
122
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxReconnectAttempts"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxReconnectAttempts));
123
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "maxAuthRetries"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.maxAuthRetries));
121
124
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoParseJSON"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.autoParseJSON));
122
125
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "monitorNetwork"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.monitorNetwork));
123
126
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "onBeforeRequest"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>>>::toJSI(runtime, arg.onBeforeRequest));
@@ -145,6 +148,7 @@ namespace margelo::nitro {
145
148
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxRetryIntervalMs")))) return false;
146
149
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jitterFactor")))) return false;
147
150
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxReconnectAttempts")))) return false;
151
+ if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "maxAuthRetries")))) return false;
148
152
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoParseJSON")))) return false;
149
153
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "monitorNetwork")))) return false;
150
154
  if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>>>>()>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onBeforeRequest")))) return false;
@@ -30,11 +30,14 @@
30
30
 
31
31
  // Forward declaration of `SseEventType` to properly resolve imports.
32
32
  namespace margelo::nitro::nitrosse { enum class SseEventType; }
33
+ // Forward declaration of `SseState` to properly resolve imports.
34
+ namespace margelo::nitro::nitrosse { enum class SseState; }
33
35
 
34
36
  #include "SseEventType.hpp"
35
37
  #include <optional>
36
38
  #include <string>
37
39
  #include <NitroModules/AnyMap.hpp>
40
+ #include "SseState.hpp"
38
41
 
39
42
  namespace margelo::nitro::nitrosse {
40
43
 
@@ -52,10 +55,11 @@ namespace margelo::nitro::nitrosse {
52
55
  std::optional<double> statusCode SWIFT_PRIVATE;
53
56
  std::optional<double> retry SWIFT_PRIVATE;
54
57
  std::optional<double> delayMs SWIFT_PRIVATE;
58
+ std::optional<SseState> state SWIFT_PRIVATE;
55
59
 
56
60
  public:
57
61
  SseMockEvent() = default;
58
- explicit SseMockEvent(std::optional<SseEventType> type, std::optional<std::string> data, std::optional<std::shared_ptr<AnyMap>> parsedData, std::optional<std::string> id, std::optional<std::string> event, std::optional<std::string> message, std::optional<double> statusCode, std::optional<double> retry, std::optional<double> delayMs): type(type), data(data), parsedData(parsedData), id(id), event(event), message(message), statusCode(statusCode), retry(retry), delayMs(delayMs) {}
62
+ explicit SseMockEvent(std::optional<SseEventType> type, std::optional<std::string> data, std::optional<std::shared_ptr<AnyMap>> parsedData, std::optional<std::string> id, std::optional<std::string> event, std::optional<std::string> message, std::optional<double> statusCode, std::optional<double> retry, std::optional<double> delayMs, std::optional<SseState> state): type(type), data(data), parsedData(parsedData), id(id), event(event), message(message), statusCode(statusCode), retry(retry), delayMs(delayMs), state(state) {}
59
63
 
60
64
  public:
61
65
  friend bool operator==(const SseMockEvent& lhs, const SseMockEvent& rhs) = default;
@@ -79,7 +83,8 @@ namespace margelo::nitro {
79
83
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message"))),
80
84
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusCode"))),
81
85
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retry"))),
82
- JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "delayMs")))
86
+ JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "delayMs"))),
87
+ JSIConverter<std::optional<margelo::nitro::nitrosse::SseState>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state")))
83
88
  );
84
89
  }
85
90
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrosse::SseMockEvent& arg) {
@@ -93,6 +98,7 @@ namespace margelo::nitro {
93
98
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "statusCode"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.statusCode));
94
99
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "retry"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.retry));
95
100
  obj.setProperty(runtime, PropNameIDCache::get(runtime, "delayMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.delayMs));
101
+ obj.setProperty(runtime, PropNameIDCache::get(runtime, "state"), JSIConverter<std::optional<margelo::nitro::nitrosse::SseState>>::toJSI(runtime, arg.state));
96
102
  return obj;
97
103
  }
98
104
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -112,6 +118,7 @@ namespace margelo::nitro {
112
118
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "statusCode")))) return false;
113
119
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "retry")))) return false;
114
120
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "delayMs")))) return false;
121
+ if (!JSIConverter<std::optional<margelo::nitro::nitrosse::SseState>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "state")))) return false;
115
122
  return true;
116
123
  }
117
124
  };
package/package.json CHANGED
@@ -1,35 +1,33 @@
1
1
  {
2
2
  "name": "react-native-nitro-sse",
3
- "version": "2.4.1",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "High-performance Server-Sent Events (SSE) for React Native, powered by Nitro Modules.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "source": "./src/index.tsx",
10
9
  "types": "./lib/typescript/src/index.d.ts",
11
10
  "default": "./lib/module/index.js"
12
11
  },
13
12
  "./package.json": "./package.json"
14
13
  },
15
14
  "files": [
16
- "src",
17
15
  "lib",
18
16
  "android",
19
17
  "ios",
20
- "cpp",
21
18
  "nitrogen",
22
19
  "nitro.json",
23
20
  "*.podspec",
24
- "react-native.config.js",
25
21
  "!ios/build",
26
22
  "!ios/Tests",
27
23
  "!android/build",
28
24
  "!android/src/test",
25
+ "!android/jacoco.gradle",
29
26
  "!android/gradle",
30
27
  "!android/gradlew",
31
28
  "!android/gradlew.bat",
32
29
  "!android/local.properties",
30
+ "!lib/**/*.map",
33
31
  "!**/__tests__",
34
32
  "!**/__fixtures__",
35
33
  "!**/__mocks__",
@@ -42,12 +40,13 @@
42
40
  "nitrogen": "nitrogen",
43
41
  "typecheck": "tsc",
44
42
  "test": "jest",
45
- "test:android": "cd example/android && ./gradlew :react-native-nitro-sse:testDebugUnitTest",
46
- "test:ios": "cd example/ios && xcodebuild test -workspace NitroSseExample.xcworkspace -scheme NitroSse -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16e'",
43
+ "test:android": "(cd example/android && ./gradlew :react-native-nitro-sse:testDebugUnitTest)",
44
+ "test:ios": "(cd example/ios && xcodebuild test -workspace NitroSseExample.xcworkspace -scheme NitroSse-Unit-Tests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16e')",
47
45
  "test:native": "yarn test:android && yarn test:ios",
48
- "ci": "yarn lint && yarn typecheck && yarn test && yarn prepare && yarn test:native && yarn turbo run build:android build:ios",
46
+ "ci": "yarn lint && yarn typecheck && yarn test && yarn prepare && (cd example/ios && pod install) && yarn test:native && yarn turbo run build:android build:ios",
49
47
  "release": "release-it --only-version",
50
- "server": "node example/sse-server.js",
48
+ "server": "node example/script/sse-server.mjs",
49
+ "bench:server": "node example/script/sse-benchmark-server.mjs",
51
50
  "lint": "eslint \"**/*.{js,ts,tsx}\""
52
51
  },
53
52
  "keywords": [
@@ -91,12 +90,12 @@
91
90
  "eslint-plugin-prettier": "^5.5.4",
92
91
  "jest": "^29.7.0",
93
92
  "lefthook": "^2.0.3",
94
- "nitrogen": "0.36.5",
93
+ "nitrogen": "0.37.1",
95
94
  "prettier": "^2.8.8",
96
95
  "react": "19.2.3",
97
96
  "react-native": "0.85.3",
98
97
  "react-native-builder-bob": "^0.40.17",
99
- "react-native-nitro-modules": "0.36.5",
98
+ "react-native-nitro-modules": "0.37.1",
100
99
  "release-it": "^19.0.4",
101
100
  "turbo": "^2.5.6",
102
101
  "typescript": "^5.9.2"
@@ -1,33 +0,0 @@
1
- apply plugin: "jacoco"
2
-
3
- jacoco {
4
- toolVersion = "0.8.11"
5
- }
6
-
7
- tasks.withType(Test) {
8
- jacoco.includeNoLocationClasses = true
9
- jacoco.excludes = ['jdk.internal.*']
10
- }
11
-
12
- task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
13
- reports {
14
- xml.required = true
15
- html.required = true
16
- html.outputLocation = layout.buildDirectory.dir('reports/jacoco')
17
- }
18
-
19
- def fileFilter = [
20
- '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*',
21
- '**/*Test*.*', 'android/**/*.*', '**/NitroSsePackage.*', '**/NetworkInspector.*'
22
- ]
23
-
24
- // For Kotlin projects in Android, classes are usually in build/tmp/kotlin-classes/debug
25
- def debugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
26
- def mainSrc = "${projectDir}/src/main/java"
27
-
28
- sourceDirectories.setFrom(files([mainSrc]))
29
- classDirectories.setFrom(files([debugTree]))
30
- executionData.setFrom(fileTree(dir: "${buildDir}", includes: [
31
- 'jacoco/testDebugUnitTest.exec'
32
- ]))
33
- }
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["NitroSse.nitro.ts"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NitroSseClient","_listeners","Map","_mockIndex","constructor","native","_native","_setMockState","state","_mockState","stateEvent","type","statusCode","_legacyCallback","_emit","setup","config","onEvent","_config","undefined","isDev","__DEV__","mock","console","warn","mode","toUpperCase","eventsPerSecond","_mockIntervalId","clearTimeout","events","event","addEventListener","listener","has","set","Set","get","add","removeEventListener","delete","listeners","forEach","e","error","_createSseEvent","rawMock","data","parsedData","id","message","retry","start","loop","errorRate","validatedEventsPerSecond","Number","isNaN","isFinite","validatedErrorRate","Math","max","min","delayMs","batchSize","round","intervalMs","scheduleNext","length","closeEvent","random","errorEvent","setTimeout","currentItem","hasCustomDelay","batch","push","i","nextItem","nextDelay","firstItem","firstDelay","openEvent","stop","restart","flush","isConnected","getStats","totalBytesReceived","reconnectCount","getState","updateHeaders","headers","setLastProcessedId","injectMockEvent","sseEvent"],"sourceRoot":"../../src","sources":["NitroSseClient.ts"],"mappings":";;AAYA,OAAO,MAAMA,cAAc,CAAsB;EAEvCC,UAAU,GAAkC,IAAIC,GAAG,CAAC,CAAC;EAIrDC,UAAU,GAAW,CAAC;EAI9BC,WAAWA,CAACC,MAAgB,EAAE;IAC5B,IAAI,CAACC,OAAO,GAAGD,MAAM;EACvB;EAEQE,aAAaA,CAACC,KAAe,EAAQ;IAC3C,IAAI,IAAI,CAACC,UAAU,KAAKD,KAAK,EAAE;MAC7B,IAAI,CAACC,UAAU,GAAGD,KAAK;MACvB,MAAME,UAAoB,GAAG;QAAEC,IAAI,EAAE,OAAO;QAAEH,KAAK;QAAEI,UAAU,EAAE;MAAI,CAAC;MACtE,IAAI,CAACC,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I,IAAI,EAAEG,IAAI,KAAK,SAAS,EAAE;MAC1C,OAAO,IAAI,CAAChB,UAAU,IAAI,MAAM;IAClC;IACA,OAAO,IAAI,CAACH,OAAO,CAACoF,QAAQ,CAAC,CAAC;EAChC;EAEAC,aAAaA,CAACC,OAA+B,EAAQ;IACnD,IAAI,CAACtF,OAAO,CAACqF,aAAa,CAACC,OAAO,CAAC;EACrC;EAEAC,kBAAkBA,CAAC5C,EAAU,EAAQ;IACnC,IAAI,CAAC3C,OAAO,CAACuF,kBAAkB,CAAC5C,EAAE,CAAC;EACrC;EAEA6C,eAAeA,CAAC/D,KAAwB,EAAQ;IAC9C,MAAMgE,QAAQ,GAAG,IAAI,CAAClD,eAAe,CAACd,KAAK,CAAC;IAC5C,IAAI,CAAClB,eAAe,GAAG,CAACkF,QAAQ,CAAC,CAAC;IAClC,IAAI,CAACjF,KAAK,CAACiF,QAAQ,CAACpF,IAAI,EAAEoF,QAAQ,CAAC;IACnC,IAAIA,QAAQ,CAAChE,KAAK,IAAIgE,QAAQ,CAAChE,KAAK,KAAKgE,QAAQ,CAACpF,IAAI,EAAE;MACtD,IAAI,CAACG,KAAK,CAACiF,QAAQ,CAAChE,KAAK,EAAEgE,QAAQ,CAAC;IACtC;EACF;AACF","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["SseInterface.ts"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NitroModules","NitroSseClient","createNitroSse","nativeSse","createHybridObject","console","debug","Error"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,cAAc,QAAQ,qBAAkB;AAGjD,cAAc,mBAAgB;AAC9B,cAAc,qBAAkB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAc;EAC1C,IAAIC,SAA+B;EACnC,IAAI;IACFA,SAAS,GAAGH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zC,KAAK,IAAI,IAAI,CAAC;IACd,uBAAuB;IACvB,WAAW,IAAI,OAAO,CAAC;IACvB,iBAAiB;IACjB,QAAQ,IAAI,QAAQ,CAAC;IACrB,+BAA+B;IAC/B,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACrD,yBAAyB;IACzB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,4EAA4E;IAC5E,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAChD,oCAAoC;IACpC,QAAQ,IAAI,QAAQ,CAAC;CACtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,SAAS,CAgB1C"}
@@ -1,58 +0,0 @@
1
- import type { HybridObject } from 'react-native-nitro-modules';
2
- import type { SseConfig, SseEvent, SseStats, SseState } from './SseInterface';
3
-
4
- export interface NitroSse
5
- extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
6
- /**
7
- * Configure SSE and setup event callback.
8
- */
9
- setup(config: SseConfig, onEvent: (events: SseEvent[]) => void): void;
10
-
11
- /**
12
- * Start the SSE connection.
13
- */
14
- start(): void;
15
-
16
- /**
17
- * Stop the SSE connection.
18
- */
19
- stop(): void;
20
-
21
- /**
22
- * Set the last processed event ID.
23
- * Native will use this ID to resume connection if interrupted.
24
- */
25
- setLastProcessedId(id: string): void;
26
-
27
- /**
28
- * Update HTTP headers dynamically (e.g., when token expires).
29
- * These headers will be used for subsequent connection/reconnection attempts.
30
- */
31
- updateHeaders(headers: Record<string, string>): void;
32
-
33
- /**
34
- * Get connection statistics.
35
- */
36
- getStats(): SseStats;
37
- /**
38
- * Manually flush the event buffer.
39
- * Useful when batching is enabled but you need to process pending events immediately.
40
- */
41
- flush(): void;
42
-
43
- /**
44
- * Force a reconnection.
45
- * This resets the connection state and attempts to reconnect immediately.
46
- */
47
- restart(): void;
48
-
49
- /**
50
- * Check if the connection is currently active.
51
- */
52
- isConnected(): boolean;
53
-
54
- /**
55
- * Get the current state of the connection.
56
- */
57
- getState(): SseState;
58
- }