@npaw/forge-react-native 9.6.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.
- package/LICENSE +10 -0
- package/NPAWForgeReactNative.podspec +44 -0
- package/README.md +51 -0
- package/android/build.gradle +77 -0
- package/android/src/main/AndroidManifest.xml +14 -0
- package/android/src/main/java/com/npaw/forge/reactnative/ForgeDtoMapper.java +295 -0
- package/android/src/main/java/com/npaw/forge/reactnative/ForgeInstanceRegistry.java +61 -0
- package/android/src/main/java/com/npaw/forge/reactnative/NPAWForgeModule.java +735 -0
- package/android/src/main/java/com/npaw/forge/reactnative/NPAWForgePackage.java +53 -0
- package/android/src/test/java/com/npaw/forge/reactnative/ForgeDtoMapperTest.java +133 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/Info.plist +82 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/Headers/ForgeKernelFFI.h +17 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/Headers/forge_kernelFFI.h +873 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/Headers/module.modulemap +7 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/libForgeKernelFFI.a +0 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/Headers/ForgeKernelFFI.h +17 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/Headers/forge_kernelFFI.h +873 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap +7 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/libForgeKernelFFI.a +0 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/Headers/ForgeKernelFFI.h +17 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/Headers/forge_kernelFFI.h +873 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/Headers/module.modulemap +7 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/libForgeKernelFFI.a +0 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/Headers/ForgeKernelFFI.h +17 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/Headers/forge_kernelFFI.h +873 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/Headers/module.modulemap +7 -0
- package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/libForgeKernelFFI.a +0 -0
- package/ios/ForgeApple/Sources/ForgeKernelUniFFI/forge_kernel.swift +3931 -0
- package/ios/ForgeApple/Sources/ForgeKernelUniFFI/forge_kernelFFI.h +873 -0
- package/ios/ForgeApple/Sources/ForgeKernelUniFFI/forge_kernelFFI.modulemap +7 -0
- package/ios/ForgeApple/Sources/NPAWForgeAVPlayerAdapter/AVPlayerAccessLogFacts.swift +152 -0
- package/ios/ForgeApple/Sources/NPAWForgeAVPlayerAdapter/AVPlayerAdapter.swift +877 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/AttributionCapture.swift +158 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/CapturePlanGate.swift +189 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/CrashCapture.swift +120 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/ForgeAutomaticCapture.swift +639 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/SectionsCapture.swift +1176 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/SectionsEngine.swift +674 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/SectionsMarkers.swift +105 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/SectionsSwiftUI.swift +284 -0
- package/ios/ForgeApple/Sources/NPAWForgeCapture/SwiftUICapture.swift +44 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/AdAdapter.swift +199 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/AdSemantics.swift +136 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeApple.swift +596 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeCapturePlan.swift +297 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeClock.swift +29 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeLogging.swift +109 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeOutcome.swift +89 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeRuntime.swift +291 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeStorage.swift +70 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ManualAdReporter.swift +180 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/NPAWForge.swift +453 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/NativeUniFFIRuntime.swift +594 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/NetworkRequestRecord.swift +191 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/ObjectiveCWrappers.swift +191 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/PlayerAdapter.swift +299 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/PlayerSemantics.swift +266 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/PrivacySanitizer.swift +59 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/VideoAdapter.swift +478 -0
- package/ios/ForgeApple/Sources/NPAWForgeCore/VideoOptions.swift +431 -0
- package/ios/ForgeApple/Sources/NPAWForgeNetworkCapture/ForgeNetworkCapture.swift +116 -0
- package/ios/ForgeApple/Sources/NPAWForgeNetworkCaptureObjC/NPAWForgeNetworkSwizzler.m +293 -0
- package/ios/ForgeApple/Sources/NPAWForgeNetworkCaptureObjC/include/NPAWForgeNetworkSwizzler.h +33 -0
- package/ios/ForgeModuleImpl.swift +1131 -0
- package/ios/NPAWForgeTurboModule.mm +399 -0
- package/package.json +33 -0
- package/src/ForgeAdReporter.ts +101 -0
- package/src/ForgeVideo.ts +169 -0
- package/src/NPAWForge.ts +177 -0
- package/src/capture.ts +192 -0
- package/src/events.ts +40 -0
- package/src/index.ts +37 -0
- package/src/specs/NativeNPAWForge.ts +168 -0
- package/src/types.ts +114 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) NPAW - All Rights Reserved
|
|
3
|
+
*
|
|
4
|
+
* This source code is protected under international copyright law. All rights
|
|
5
|
+
* reserved and protected by the copyright holders.
|
|
6
|
+
* This file is confidential and only available to authorized individuals with the
|
|
7
|
+
* permission of the copyright holders. If you encounter this file and do not have
|
|
8
|
+
* permission, please contact the copyright holders and delete this file.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @author: Victor Soto <victor.soto@nicepeopleatwork.com>
|
|
12
|
+
* @description: TurboModule codegen spec for the NPAW Forge core React Native module - full facade surface, 1:1 with the native Kotlin/Swift NPAWForge facades. Timestamp-free by repo policy; Forge Core assigns event time.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { TurboModule } from 'react-native';
|
|
16
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
17
|
+
import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
18
|
+
|
|
19
|
+
export interface Spec extends TurboModule {
|
|
20
|
+
// ---- lifecycle ----
|
|
21
|
+
create(accountCode: string, config: UnsafeObject): Promise<string>;
|
|
22
|
+
destroy(instanceId: string): Promise<UnsafeObject>;
|
|
23
|
+
setLogLevel(instanceId: string, level: string): Promise<UnsafeObject>;
|
|
24
|
+
|
|
25
|
+
// ---- app session ----
|
|
26
|
+
startSession(instanceId: string, metadata: UnsafeObject): Promise<UnsafeObject>;
|
|
27
|
+
endSession(instanceId: string, metadata: UnsafeObject): Promise<UnsafeObject>;
|
|
28
|
+
trackSessionNavigation(instanceId: string, metadata: UnsafeObject): Promise<UnsafeObject>;
|
|
29
|
+
trackSessionEvent(instanceId: string, name: string, metadata: UnsafeObject): Promise<UnsafeObject>;
|
|
30
|
+
trackSessionEventStop(instanceId: string, name: string, metadata: UnsafeObject): Promise<UnsafeObject>;
|
|
31
|
+
trackSessionError(
|
|
32
|
+
instanceId: string,
|
|
33
|
+
errorCode: string,
|
|
34
|
+
errorMessage: string,
|
|
35
|
+
metadata: UnsafeObject
|
|
36
|
+
): Promise<UnsafeObject>;
|
|
37
|
+
|
|
38
|
+
// ---- identity ----
|
|
39
|
+
loginSuccess(instanceId: string, userId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
40
|
+
loginFailed(instanceId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
41
|
+
logout(instanceId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
42
|
+
profileCreated(instanceId: string, profileId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
43
|
+
profileSelected(instanceId: string, profileId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
44
|
+
profileDeleted(instanceId: string, profileId: string): Promise<UnsafeObject>;
|
|
45
|
+
|
|
46
|
+
// ---- raw / business ----
|
|
47
|
+
trackRawEvent(instanceId: string, name: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
48
|
+
/** resultCount < 0 means "not provided". */
|
|
49
|
+
trackSearch(instanceId: string, query: string, resultCount: number): Promise<UnsafeObject>;
|
|
50
|
+
trackSearchResultClick(instanceId: string, query: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
51
|
+
trackBusinessEvent(instanceId: string, name: string, attributes: UnsafeObject): Promise<UnsafeObject>;
|
|
52
|
+
trackAttribution(instanceId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
53
|
+
|
|
54
|
+
// ---- network (manual record) ----
|
|
55
|
+
trackNetworkRequest(instanceId: string, record: UnsafeObject): Promise<UnsafeObject>;
|
|
56
|
+
/**
|
|
57
|
+
* Installs automatic network capture: Android instruments React Native's
|
|
58
|
+
* OkHttp client factory (call before the first fetch), iOS arms the
|
|
59
|
+
* URLSession swizzler. Capture-plan gating stays kernel-owned.
|
|
60
|
+
*/
|
|
61
|
+
installNetworkCapture(instanceId: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
62
|
+
|
|
63
|
+
// ---- diagnostics ----
|
|
64
|
+
snapshotEvents(instanceId: string): Promise<UnsafeObject>;
|
|
65
|
+
|
|
66
|
+
// ---- video (identifier-keyed; 'default' is the native default identifier) ----
|
|
67
|
+
createVideo(instanceId: string, identifier: string, options: UnsafeObject): Promise<UnsafeObject>;
|
|
68
|
+
videoDestroy(instanceId: string, identifier: string): Promise<UnsafeObject>;
|
|
69
|
+
videoFireInit(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
70
|
+
videoFireStart(
|
|
71
|
+
instanceId: string,
|
|
72
|
+
identifier: string,
|
|
73
|
+
params: UnsafeObject,
|
|
74
|
+
forceInit: boolean
|
|
75
|
+
): Promise<UnsafeObject>;
|
|
76
|
+
videoFireJoin(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
77
|
+
videoFirePause(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
78
|
+
videoFireResume(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
79
|
+
videoFireSeekBegin(
|
|
80
|
+
instanceId: string,
|
|
81
|
+
identifier: string,
|
|
82
|
+
params: UnsafeObject,
|
|
83
|
+
convertFromBuffer: boolean
|
|
84
|
+
): Promise<UnsafeObject>;
|
|
85
|
+
videoFireSeekEnd(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
86
|
+
videoFireBufferBegin(
|
|
87
|
+
instanceId: string,
|
|
88
|
+
identifier: string,
|
|
89
|
+
params: UnsafeObject,
|
|
90
|
+
convertFromSeek: boolean
|
|
91
|
+
): Promise<UnsafeObject>;
|
|
92
|
+
videoFireBufferEnd(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
93
|
+
videoFireStop(instanceId: string, identifier: string, params: UnsafeObject): Promise<UnsafeObject>;
|
|
94
|
+
/** Empty strings mean "not provided" for the error fields. */
|
|
95
|
+
videoFireError(
|
|
96
|
+
instanceId: string,
|
|
97
|
+
identifier: string,
|
|
98
|
+
errorCode: string,
|
|
99
|
+
errorMessage: string,
|
|
100
|
+
errorMetadata: string
|
|
101
|
+
): Promise<UnsafeObject>;
|
|
102
|
+
videoFireFatalError(
|
|
103
|
+
instanceId: string,
|
|
104
|
+
identifier: string,
|
|
105
|
+
errorCode: string,
|
|
106
|
+
errorMessage: string,
|
|
107
|
+
errorMetadata: string
|
|
108
|
+
): Promise<UnsafeObject>;
|
|
109
|
+
videoFireDestroy(instanceId: string, identifier: string): Promise<UnsafeObject>;
|
|
110
|
+
videoFireEvent(
|
|
111
|
+
instanceId: string,
|
|
112
|
+
identifier: string,
|
|
113
|
+
eventName: string,
|
|
114
|
+
dimensions: UnsafeObject,
|
|
115
|
+
values: UnsafeObject,
|
|
116
|
+
topLevelDimensions: UnsafeObject,
|
|
117
|
+
hasEndDatetime: boolean
|
|
118
|
+
): Promise<UnsafeObject>;
|
|
119
|
+
videoFireEventEnd(
|
|
120
|
+
instanceId: string,
|
|
121
|
+
identifier: string,
|
|
122
|
+
eventName: string,
|
|
123
|
+
dimensions: UnsafeObject,
|
|
124
|
+
values: UnsafeObject,
|
|
125
|
+
topLevelDimensions: UnsafeObject
|
|
126
|
+
): Promise<UnsafeObject>;
|
|
127
|
+
/** Manual metadata refresh; the params-driven variant is not exposed by the native facade. */
|
|
128
|
+
videoFireMetadataUpdate(instanceId: string, identifier: string): Promise<UnsafeObject>;
|
|
129
|
+
|
|
130
|
+
// ---- ads (numeric reporter handles) ----
|
|
131
|
+
/** Empty adapterVersion means "not provided". Resolves the reporter handle. */
|
|
132
|
+
createAdReporter(instanceId: string, identifier: string, adapterVersion: string): Promise<number>;
|
|
133
|
+
releaseAdReporter(reporterId: number): Promise<UnsafeObject>;
|
|
134
|
+
adFireManifest(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
135
|
+
adFireBreakStart(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
136
|
+
adFireAdInit(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
137
|
+
adFireStart(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
138
|
+
adFireJoin(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
139
|
+
adFirePause(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
140
|
+
adFireResume(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
141
|
+
adFireBufferBegin(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
142
|
+
adFireBufferEnd(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
143
|
+
/** quartile < 0 means "not provided". */
|
|
144
|
+
adFireQuartile(reporterId: number, quartile: number): Promise<UnsafeObject>;
|
|
145
|
+
adFireClick(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
146
|
+
adFireSkip(reporterId: number): Promise<UnsafeObject>;
|
|
147
|
+
adFireStop(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
148
|
+
adFireError(
|
|
149
|
+
reporterId: number,
|
|
150
|
+
errorCode: string,
|
|
151
|
+
errorMessage: string,
|
|
152
|
+
errorMetadata: string
|
|
153
|
+
): Promise<UnsafeObject>;
|
|
154
|
+
adFireFatalError(
|
|
155
|
+
reporterId: number,
|
|
156
|
+
errorCode: string,
|
|
157
|
+
errorMessage: string,
|
|
158
|
+
errorMetadata: string
|
|
159
|
+
): Promise<UnsafeObject>;
|
|
160
|
+
adFireBreakStop(reporterId: number, params: UnsafeObject): Promise<UnsafeObject>;
|
|
161
|
+
adFireDestroy(reporterId: number): Promise<UnsafeObject>;
|
|
162
|
+
|
|
163
|
+
// ---- event feed (classic emitter contract) ----
|
|
164
|
+
addListener(eventName: string): void;
|
|
165
|
+
removeListeners(count: number): void;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('NPAWForgeRN');
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) NPAW - All Rights Reserved
|
|
3
|
+
*
|
|
4
|
+
* This source code is protected under international copyright law. All rights
|
|
5
|
+
* reserved and protected by the copyright holders.
|
|
6
|
+
* This file is confidential and only available to authorized individuals with the
|
|
7
|
+
* permission of the copyright holders. If you encounter this file and do not have
|
|
8
|
+
* permission, please contact the copyright holders and delete this file.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @author: Victor Soto <victor.soto@nicepeopleatwork.com>
|
|
12
|
+
* @description: Public TypeScript types for @npaw/forge-react-native (outcomes, config, events, video options, network records).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Wire-parity outcome codes shared by every Forge platform facade. */
|
|
16
|
+
export type ForgeOutcomeCode =
|
|
17
|
+
| 'accepted'
|
|
18
|
+
| 'deferred'
|
|
19
|
+
| 'dropped'
|
|
20
|
+
| 'ignored_duplicate'
|
|
21
|
+
| 'ignored_before_session_start'
|
|
22
|
+
| 'ignored_invalid_state'
|
|
23
|
+
| 'blocked_dependency'
|
|
24
|
+
| 'unsupported_capability'
|
|
25
|
+
| 'failed_with_diagnostic';
|
|
26
|
+
|
|
27
|
+
export type ForgeOutcome = {
|
|
28
|
+
code: ForgeOutcomeCode;
|
|
29
|
+
isAccepted: boolean;
|
|
30
|
+
/** Present on failed_with_diagnostic. */
|
|
31
|
+
reason?: string;
|
|
32
|
+
/** Present on failed_with_diagnostic. */
|
|
33
|
+
details?: Record<string, string>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** One kernel-recorded event from the bounded native snapshot mirror. */
|
|
37
|
+
export type ForgeRecordedEvent = {
|
|
38
|
+
instanceId: string;
|
|
39
|
+
eventName: string;
|
|
40
|
+
timestampMs: number;
|
|
41
|
+
payload: Record<string, string>;
|
|
42
|
+
urgent: boolean;
|
|
43
|
+
viewKey?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Instance configuration. One canonical key per concept (legacy facade
|
|
48
|
+
* aliases are intentionally not exposed); unknown keys are warn-and-ignore
|
|
49
|
+
* on the native side for forward compatibility.
|
|
50
|
+
*
|
|
51
|
+
* iOS note: deviceUuid and autoDeviceIdentityEnabled are Android-only today
|
|
52
|
+
* (the Swift Builder lacks the setters); iOS logs and ignores them.
|
|
53
|
+
*/
|
|
54
|
+
export type ForgeConfig = {
|
|
55
|
+
appName?: string;
|
|
56
|
+
appReleaseVersion?: string;
|
|
57
|
+
buildVariant?: string;
|
|
58
|
+
lmaEndpoint?: string;
|
|
59
|
+
analyticsUserAgent?: string;
|
|
60
|
+
logLevel?: string;
|
|
61
|
+
startSessionOnInitialize?: boolean;
|
|
62
|
+
processEventsBeforeSessionStart?: boolean;
|
|
63
|
+
preSessionEventQueueLimitEvents?: number;
|
|
64
|
+
preSessionEventQueueMaxAgeMs?: number;
|
|
65
|
+
allowLocalHttpForTesting?: boolean;
|
|
66
|
+
deviceUuid?: string;
|
|
67
|
+
autoDeviceIdentityEnabled?: boolean;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Video options DTO. Every key is forwarded through the native
|
|
72
|
+
* VideoOptions.Builder metadata pipeline, which applies the same
|
|
73
|
+
* key-normalization/alias rules as the Web binding (content.title,
|
|
74
|
+
* contentDuration, playhead, custom dimension dotted keys, ...), so option
|
|
75
|
+
* naming is web-parity by construction. Values are stringified.
|
|
76
|
+
*/
|
|
77
|
+
export type ForgeVideoOptions = Record<string, string | number | boolean>;
|
|
78
|
+
|
|
79
|
+
/** String facts for manual fire* calls; values are stringified natively. */
|
|
80
|
+
export type ForgeParams = Record<string, string | number | boolean>;
|
|
81
|
+
|
|
82
|
+
export type ForgeNetworkOutcome =
|
|
83
|
+
| 'success'
|
|
84
|
+
| 'http_error'
|
|
85
|
+
| 'network_error'
|
|
86
|
+
| 'cancelled'
|
|
87
|
+
| 'timeout'
|
|
88
|
+
| 'blocked'
|
|
89
|
+
| 'unknown';
|
|
90
|
+
|
|
91
|
+
/** Manual network observation, mapped onto the native NetworkRequestRecord. */
|
|
92
|
+
export type ForgeNetworkRequestRecord = {
|
|
93
|
+
targetUrl: string;
|
|
94
|
+
method: string;
|
|
95
|
+
responseStatusCode: number;
|
|
96
|
+
durationMs: number;
|
|
97
|
+
outcome: ForgeNetworkOutcome;
|
|
98
|
+
responseStatusText?: string;
|
|
99
|
+
errorMessage?: string;
|
|
100
|
+
traceparent?: string;
|
|
101
|
+
dnsDurationMs?: number;
|
|
102
|
+
connectDurationMs?: number;
|
|
103
|
+
sslDurationMs?: number;
|
|
104
|
+
requestDurationMs?: number;
|
|
105
|
+
timeToFirstByteMs?: number;
|
|
106
|
+
responseDownloadDurationMs?: number;
|
|
107
|
+
redirectDurationMs?: number;
|
|
108
|
+
redirectCount?: number;
|
|
109
|
+
protocol?: string;
|
|
110
|
+
requestBytes?: number;
|
|
111
|
+
responseBytes?: number;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export type ForgeEventSubscription = { remove: () => void };
|