@npaw/forge-react-native 10.0.0 → 10.0.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.
@@ -28,7 +28,7 @@ def safeExtGet(prop, fallback) {
28
28
  // FORGE_CORE_VERSION (see scripts/react-native/hydrate-natives.sh).
29
29
  def forgeCoreVersion = project.hasProperty('NpawForge_forgeCoreVersion')
30
30
  ? project.property('NpawForge_forgeCoreVersion')
31
- : (System.getenv('FORGE_CORE_VERSION') ?: '10.0.0')
31
+ : (System.getenv('FORGE_CORE_VERSION') ?: '10.0.1')
32
32
 
33
33
  android {
34
34
  namespace 'com.npaw.forge.reactnative'
@@ -186,7 +186,9 @@ public final class ForgeDtoMapper {
186
186
  nullableLong(map, "requestBytes"),
187
187
  nullableLong(map, "responseBytes"),
188
188
  Collections.emptyMap(),
189
- Collections.emptyMap());
189
+ Collections.emptyMap(),
190
+ Collections.emptyMap(),
191
+ nullableString(map, "requestType"));
190
192
  }
191
193
 
192
194
  // ---- outputs ----
@@ -77,6 +77,7 @@ public class ForgeDtoMapperTest {
77
77
  map.putString("protocol", "h2");
78
78
  map.putInt("redirectCount", 1);
79
79
  map.putInt("requestBytes", 100);
80
+ map.putString("requestType", "drm_license");
80
81
 
81
82
  NetworkRequestRecord record = ForgeDtoMapper.toNetworkRequestRecord(map);
82
83
 
@@ -89,6 +90,9 @@ public class ForgeDtoMapperTest {
89
90
  assertEquals("h2", record.getProtocol());
90
91
  assertEquals(Integer.valueOf(1), record.getRedirectCount());
91
92
  assertEquals(Long.valueOf(100L), record.getRequestBytes());
93
+ // The map key is a string contract the compiler cannot check; a typo in
94
+ // ForgeDtoMapper would silently drop the field without this assertion.
95
+ assertEquals("drm_license", record.getRequestType());
92
96
  assertNull(record.getDnsDurationMs());
93
97
  assertNull(record.getErrorMessage());
94
98
  }
@@ -10,18 +10,15 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64_x86_64-simulator</string>
13
+ <string>ios-arm64</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libForgeKernelFFI.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
- <string>x86_64</string>
20
19
  </array>
21
20
  <key>SupportedPlatform</key>
22
21
  <string>ios</string>
23
- <key>SupportedPlatformVariant</key>
24
- <string>simulator</string>
25
22
  </dict>
26
23
  <dict>
27
24
  <key>BinaryPath</key>
@@ -29,7 +26,7 @@
29
26
  <key>HeadersPath</key>
30
27
  <string>Headers</string>
31
28
  <key>LibraryIdentifier</key>
32
- <string>tvos-arm64-simulator</string>
29
+ <string>tvos-arm64</string>
33
30
  <key>LibraryPath</key>
34
31
  <string>libForgeKernelFFI.a</string>
35
32
  <key>SupportedArchitectures</key>
@@ -38,8 +35,6 @@
38
35
  </array>
39
36
  <key>SupportedPlatform</key>
40
37
  <string>tvos</string>
41
- <key>SupportedPlatformVariant</key>
42
- <string>simulator</string>
43
38
  </dict>
44
39
  <dict>
45
40
  <key>BinaryPath</key>
@@ -47,7 +42,7 @@
47
42
  <key>HeadersPath</key>
48
43
  <string>Headers</string>
49
44
  <key>LibraryIdentifier</key>
50
- <string>tvos-arm64</string>
45
+ <string>tvos-arm64-simulator</string>
51
46
  <key>LibraryPath</key>
52
47
  <string>libForgeKernelFFI.a</string>
53
48
  <key>SupportedArchitectures</key>
@@ -56,6 +51,8 @@
56
51
  </array>
57
52
  <key>SupportedPlatform</key>
58
53
  <string>tvos</string>
54
+ <key>SupportedPlatformVariant</key>
55
+ <string>simulator</string>
59
56
  </dict>
60
57
  <dict>
61
58
  <key>BinaryPath</key>
@@ -63,15 +60,18 @@
63
60
  <key>HeadersPath</key>
64
61
  <string>Headers</string>
65
62
  <key>LibraryIdentifier</key>
66
- <string>ios-arm64</string>
63
+ <string>ios-arm64_x86_64-simulator</string>
67
64
  <key>LibraryPath</key>
68
65
  <string>libForgeKernelFFI.a</string>
69
66
  <key>SupportedArchitectures</key>
70
67
  <array>
71
68
  <string>arm64</string>
69
+ <string>x86_64</string>
72
70
  </array>
73
71
  <key>SupportedPlatform</key>
74
72
  <string>ios</string>
73
+ <key>SupportedPlatformVariant</key>
74
+ <string>simulator</string>
75
75
  </dict>
76
76
  </array>
77
77
  <key>CFBundlePackageType</key>
@@ -1743,6 +1743,7 @@ public struct AppleNetworkObservation: Equatable, Hashable {
1743
1743
  public var redirectDurationMs: UInt64?
1744
1744
  public var redirectCount: UInt64?
1745
1745
  public var `protocol`: String?
1746
+ public var requestType: String?
1746
1747
  public var requestBytes: UInt64?
1747
1748
  public var responseBytes: UInt64?
1748
1749
  public var requestQuery: [String: String]?
@@ -1751,7 +1752,7 @@ public struct AppleNetworkObservation: Equatable, Hashable {
1751
1752
 
1752
1753
  // Default memberwise initializers are never public by default, so we
1753
1754
  // declare one manually.
1754
- public init(eventId: String, source: String, targetUrl: String, method: String, timemarkMs: UInt64, durationMs: UInt64, responseStatusCode: UInt16, outcome: String, responseStatusText: String?, errorMessage: String?, traceparent: String?, dnsDurationMs: UInt64?, connectDurationMs: UInt64?, sslDurationMs: UInt64?, requestDurationMs: UInt64?, timeToFirstByteMs: UInt64?, responseDownloadDurationMs: UInt64?, redirectDurationMs: UInt64?, redirectCount: UInt64?, `protocol`: String?, requestBytes: UInt64?, responseBytes: UInt64?, requestQuery: [String: String]?, requestHeaders: [String: String]?, responseHeaders: [String: String]?) {
1755
+ public init(eventId: String, source: String, targetUrl: String, method: String, timemarkMs: UInt64, durationMs: UInt64, responseStatusCode: UInt16, outcome: String, responseStatusText: String?, errorMessage: String?, traceparent: String?, dnsDurationMs: UInt64?, connectDurationMs: UInt64?, sslDurationMs: UInt64?, requestDurationMs: UInt64?, timeToFirstByteMs: UInt64?, responseDownloadDurationMs: UInt64?, redirectDurationMs: UInt64?, redirectCount: UInt64?, `protocol`: String?, requestType: String?, requestBytes: UInt64?, responseBytes: UInt64?, requestQuery: [String: String]?, requestHeaders: [String: String]?, responseHeaders: [String: String]?) {
1755
1756
  self.eventId = eventId
1756
1757
  self.source = source
1757
1758
  self.targetUrl = targetUrl
@@ -1772,6 +1773,7 @@ public struct AppleNetworkObservation: Equatable, Hashable {
1772
1773
  self.redirectDurationMs = redirectDurationMs
1773
1774
  self.redirectCount = redirectCount
1774
1775
  self.`protocol` = `protocol`
1776
+ self.requestType = requestType
1775
1777
  self.requestBytes = requestBytes
1776
1778
  self.responseBytes = responseBytes
1777
1779
  self.requestQuery = requestQuery
@@ -1815,6 +1817,7 @@ public struct FfiConverterTypeAppleNetworkObservation: FfiConverterRustBuffer {
1815
1817
  redirectDurationMs: FfiConverterOptionUInt64.read(from: &buf),
1816
1818
  redirectCount: FfiConverterOptionUInt64.read(from: &buf),
1817
1819
  protocol: FfiConverterOptionString.read(from: &buf),
1820
+ requestType: FfiConverterOptionString.read(from: &buf),
1818
1821
  requestBytes: FfiConverterOptionUInt64.read(from: &buf),
1819
1822
  responseBytes: FfiConverterOptionUInt64.read(from: &buf),
1820
1823
  requestQuery: FfiConverterOptionDictionaryStringString.read(from: &buf),
@@ -1844,6 +1847,7 @@ public struct FfiConverterTypeAppleNetworkObservation: FfiConverterRustBuffer {
1844
1847
  FfiConverterOptionUInt64.write(value.redirectDurationMs, into: &buf)
1845
1848
  FfiConverterOptionUInt64.write(value.redirectCount, into: &buf)
1846
1849
  FfiConverterOptionString.write(value.`protocol`, into: &buf)
1850
+ FfiConverterOptionString.write(value.requestType, into: &buf)
1847
1851
  FfiConverterOptionUInt64.write(value.requestBytes, into: &buf)
1848
1852
  FfiConverterOptionUInt64.write(value.responseBytes, into: &buf)
1849
1853
  FfiConverterOptionDictionaryStringString.write(value.requestQuery, into: &buf)
@@ -40,7 +40,7 @@ public final class NPAWForge: NSObject {
40
40
  /// `scripts/apple/publish-local-shipped.sh` rewrites this literal to the
41
41
  /// release version when staging the shipped package, and fails loudly if
42
42
  /// it cannot find it. Keep it a plain stored literal for that reason.
43
- public static let defaultPluginVersion = "10.0.0"
43
+ public static let defaultPluginVersion = "10.0.1"
44
44
  public static let defaultAppName = "apple"
45
45
  public static let defaultBuildVariant = "release"
46
46
  public static let defaultLmaEndpoint = "https://lma.npaw.com"
@@ -167,6 +167,7 @@ final class UniFFIForgeRuntime: ForgeRuntime {
167
167
  redirectDurationMs: record.redirectDurationMs.map(u64),
168
168
  redirectCount: record.redirectCount.map(u64),
169
169
  protocol: record.networkProtocol,
170
+ requestType: record.requestType,
170
171
  requestBytes: record.requestBytes.map(u64),
171
172
  responseBytes: record.responseBytes.map(u64),
172
173
  requestQuery: record.requestQuery.isEmpty ? nil : record.requestQuery,
@@ -51,6 +51,11 @@ public struct NetworkRequestRecord: Equatable {
51
51
  public var redirectDurationMs: Int64?
52
52
  public var redirectCount: Int64?
53
53
  public var networkProtocol: String?
54
+ /// Resource class of the request as reported by the observing host, e.g.
55
+ /// a player adapter classifying its SDK's own downloads. Canonical
56
+ /// lowercase tokens (`manifest`, `media_video`, `drm_license`, ...); the
57
+ /// kernel caps it at 32 chars on the wire.
58
+ public var requestType: String?
54
59
  /// Request body size in bytes (measured uploaded byte count, request
55
60
  /// `Content-Length` fallback). Body content is never captured; only this
56
61
  /// size is reported.
@@ -1119,6 +1119,7 @@ public final class ForgeModuleImpl: NSObject {
1119
1119
  record.redirectDurationMs = int64(map["redirectDurationMs"])
1120
1120
  record.redirectCount = int64(map["redirectCount"])
1121
1121
  record.networkProtocol = map["protocol"] as? String
1122
+ record.requestType = map["requestType"] as? String
1122
1123
  record.requestBytes = int64(map["requestBytes"])
1123
1124
  record.responseBytes = int64(map["responseBytes"])
1124
1125
  return record
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npaw/forge-react-native",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "NPAW Forge analytics for React Native: New Architecture TurboModule facade over the native Forge Android/Apple SDKs.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Victor Soto <victor.soto@nicepeopleatwork.com>",
package/src/types.ts CHANGED
@@ -136,6 +136,13 @@ export type ForgeNetworkRequestRecord = {
136
136
  redirectDurationMs?: number;
137
137
  redirectCount?: number;
138
138
  protocol?: string;
139
+ /**
140
+ * Resource class of the request as reported by the observing host, e.g. a
141
+ * player adapter classifying its SDK's own downloads. Canonical lowercase
142
+ * tokens (`manifest`, `media_video`, `drm_license`, ...); the kernel caps
143
+ * it at 32 chars on the wire.
144
+ */
145
+ requestType?: string;
139
146
  requestBytes?: number;
140
147
  responseBytes?: number;
141
148
  };