Skip to content

Commit 9937cfc

Browse files
authored
Merge aea3d34 into 9299104
2 parents 9299104 + aea3d34 commit 9937cfc

File tree

53 files changed

+114
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+114
-112
lines changed

SentryTestUtils/ClearTestState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
@testable import Sentry
2+
@_spi(Private) @testable import Sentry
33

44
public func clearTestState() {
55
TestCleanup.clearTestState()

SentryTestUtils/SentryLogExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
@testable import Sentry
2+
@_spi(Private) @testable import Sentry
33

44
extension SentryLog {
55
public static func setTestDefaultLogLevel() {

SentryTestUtils/TestHub.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _SentryPrivate
22
import Foundation
3-
@testable import Sentry
3+
@_spi(Private) @testable import Sentry
44

55
public class TestHub: SentryHub {
66

@@ -51,8 +51,8 @@ public class TestHub: SentryHub {
5151
}
5252

5353
public var onReplayCapture: (() -> Void)?
54-
public var capturedReplayRecordingVideo = Invocations<(replay: SentryReplayEvent, recording: SentryReplayRecording, video: URL)>()
55-
public override func capture(_ replayEvent: SentryReplayEvent, replayRecording: SentryReplayRecording, video videoURL: URL) {
54+
@_spi(Private) public var capturedReplayRecordingVideo = Invocations<(replay: SentryReplayEvent, recording: SentryReplayRecording, video: URL)>()
55+
@_spi(Private) public override func capture(_ replayEvent: SentryReplayEvent, replayRecording: SentryReplayRecording, video videoURL: URL) {
5656
capturedReplayRecordingVideo.record((replayEvent, replayRecording, videoURL))
5757
onReplayCapture?()
5858
}

Sources/Swift/Core/Helper/Log/SentryLevel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ extension SentryLevel: CustomStringConvertible {
3636
}
3737

3838
@objcMembers
39-
class SentryLevelHelper: NSObject {
40-
static func nameForLevel(_ level: SentryLevel) -> String {
39+
@_spi(Private) public class SentryLevelHelper: NSObject {
40+
public static func nameForLevel(_ level: SentryLevel) -> String {
4141
return level.description
4242
}
4343

44-
static func levelForName(_ name: String) -> SentryLevel {
44+
public static func levelForName(_ name: String) -> SentryLevel {
4545
.fromName(name)
4646
}
4747
}

Sources/Swift/Core/Helper/SentryCurrentDateProvider.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ protocol SentryCurrentDateProvider {
1313
}
1414

1515
@objcMembers
16-
class SentryDefaultCurrentDateProvider: NSObject, SentryCurrentDateProvider {
17-
func date() -> Date {
16+
@_spi(Private) public class SentryDefaultCurrentDateProvider: NSObject, SentryCurrentDateProvider {
17+
public func date() -> Date {
1818
return Date()
1919
}
2020

21-
func timezoneOffset() -> Int {
21+
public func timezoneOffset() -> Int {
2222
return TimeZone.current.secondsFromGMT()
2323
}
2424

2525
/**
2626
* Returns the absolute timestamp, which has no defined reference point or unit
2727
* as it is platform dependent.
2828
*/
29-
func systemTime() -> UInt64 {
29+
public func systemTime() -> UInt64 {
3030
Self.getAbsoluteTime()
3131
}
3232

3333
func systemUptime() -> TimeInterval {
3434
ProcessInfo.processInfo.systemUptime
3535
}
3636

37-
static func getAbsoluteTime() -> UInt64 {
37+
public static func getAbsoluteTime() -> UInt64 {
3838
clock_gettime_nsec_np(CLOCK_UPTIME_RAW)
3939
}
4040
}

Sources/Swift/Core/Helper/SentryFileContents.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import Foundation
22

33
@objcMembers
4-
class SentryFileContents: NSObject {
4+
@_spi(Private) public class SentryFileContents: NSObject {
55

6-
let path: String
7-
let contents: Data
6+
public let path: String
7+
public let contents: Data
88

9-
init(path: String, contents: Data) {
9+
public init(path: String, contents: Data) {
1010
self.path = path
1111
self.contents = contents
1212
}

Sources/Swift/Core/MetricKit/SentryMXCallStackTree.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import Foundation
55
* JSON specification of MXCallStackTree can be found here https://developer.apple.com/documentation/metrickit/mxcallstacktree/3552293-jsonrepresentation
66
*/
77
@objcMembers
8-
class SentryMXCallStackTree: NSObject, Codable {
8+
@_spi(Private) public class SentryMXCallStackTree: NSObject, Codable {
99

10-
let callStacks: [SentryMXCallStack]
11-
let callStackPerThread: Bool
10+
public let callStacks: [SentryMXCallStack]
11+
public let callStackPerThread: Bool
1212

1313
init(callStacks: [SentryMXCallStack], callStackPerThread: Bool) {
1414
self.callStacks = callStacks
@@ -21,11 +21,11 @@ class SentryMXCallStackTree: NSObject, Codable {
2121
}
2222

2323
@objcMembers
24-
class SentryMXCallStack: NSObject, Codable {
25-
var threadAttributed: Bool?
26-
var callStackRootFrames: [SentryMXFrame]
24+
@_spi(Private) public class SentryMXCallStack: NSObject, Codable {
25+
public var threadAttributed: Bool?
26+
public var callStackRootFrames: [SentryMXFrame]
2727

28-
var flattenedRootFrames: [SentryMXFrame] {
28+
public var flattenedRootFrames: [SentryMXFrame] {
2929
return callStackRootFrames.flatMap { [$0] + $0.frames }
3030
}
3131

@@ -36,14 +36,14 @@ class SentryMXCallStack: NSObject, Codable {
3636
}
3737

3838
@objcMembers
39-
class SentryMXFrame: NSObject, Codable {
40-
var binaryUUID: UUID
41-
var offsetIntoBinaryTextSegment: Int
42-
var binaryName: String?
43-
var address: UInt64
44-
var subFrames: [SentryMXFrame]?
39+
@_spi(Private) public class SentryMXFrame: NSObject, Codable {
40+
public var binaryUUID: UUID
41+
public var offsetIntoBinaryTextSegment: Int
42+
public var binaryName: String?
43+
public var address: UInt64
44+
public var subFrames: [SentryMXFrame]?
4545

46-
var sampleCount: Int?
46+
public var sampleCount: Int?
4747

4848
init(binaryUUID: UUID, offsetIntoBinaryTextSegment: Int, sampleCount: Int? = nil, binaryName: String? = nil, address: UInt64, subFrames: [SentryMXFrame]?) {
4949
self.binaryUUID = binaryUUID

Sources/Swift/Core/MetricKit/SentryMXManager.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import MetricKit
1212
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
1313
@available(tvOS, unavailable)
1414
@available(watchOS, unavailable)
15-
@objc protocol SentryMXManagerDelegate {
15+
@objc @_spi(Private) public protocol SentryMXManagerDelegate {
1616

1717
func didReceiveCrashDiagnostic(_ diagnostic: MXCrashDiagnostic, callStackTree: SentryMXCallStackTree, timeStampBegin: Date, timeStampEnd: Date)
1818

@@ -26,7 +26,7 @@ import MetricKit
2626
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, *)
2727
@available(tvOS, unavailable)
2828
@available(watchOS, unavailable)
29-
@objcMembers class SentryMXManager: NSObject, MXMetricManagerSubscriber {
29+
@objcMembers @_spi(Private) public class SentryMXManager: NSObject, MXMetricManagerSubscriber {
3030

3131
let disableCrashDiagnostics: Bool
3232

@@ -36,17 +36,17 @@ import MetricKit
3636

3737
weak var delegate: SentryMXManagerDelegate?
3838

39-
func receiveReports() {
39+
public func receiveReports() {
4040
let shared = MXMetricManager.shared
4141
shared.add(self)
4242
}
4343

44-
func pauseReports() {
44+
public func pauseReports() {
4545
let shared = MXMetricManager.shared
4646
shared.remove(self)
4747
}
4848

49-
func didReceive(_ payloads: [MXDiagnosticPayload]) {
49+
public func didReceive(_ payloads: [MXDiagnosticPayload]) {
5050
func actOn(callStackTree: MXCallStackTree, action: (SentryMXCallStackTree) -> Void) {
5151
guard let callStackTree = try? SentryMXCallStackTree.from(data: callStackTree.jsonRepresentation()) else {
5252
return

Sources/Swift/Core/SwiftDescriptor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import UIKit
55
#endif
66

77
@objc
8-
class SwiftDescriptor: NSObject {
8+
@_spi(Private) public class SwiftDescriptor: NSObject {
99

1010
@objc
11-
static func getObjectClassName(_ object: AnyObject) -> String {
11+
public static func getObjectClassName(_ object: AnyObject) -> String {
1212
return String(describing: type(of: object))
1313
}
1414

1515
/// UIViewControllers aren't available on watchOS
1616
#if canImport(UIKit) && !os(watchOS) && !SENTRY_NO_UIKIT
1717
@objc
18-
static func getViewControllerClassName(_ object: UIViewController) -> String {
18+
public static func getViewControllerClassName(_ object: UIViewController) -> String {
1919
if let object = object as? SentryUIViewControllerDescriptor {
2020
return object.sentryName
2121
}
@@ -24,7 +24,7 @@ class SwiftDescriptor: NSObject {
2424
#endif
2525

2626
@objc
27-
static func getSwiftErrorDescription(_ error: Error) -> String? {
27+
public static func getSwiftErrorDescription(_ error: Error) -> String? {
2828
return String(describing: error)
2929
}
3030
}

Sources/Swift/Core/Tools/HTTPHeaderSanitizer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Foundation
22

33
@objcMembers
4-
class HTTPHeaderSanitizer: NSObject {
5-
static func sanitizeHeaders(_ headers: [String: String]) -> [String: String] {
4+
@_spi(Private) public class HTTPHeaderSanitizer: NSObject {
5+
public static func sanitizeHeaders(_ headers: [String: String]) -> [String: String] {
66
let _securityHeaders = Set([
77
"X-FORWARDED-FOR", "AUTHORIZATION", "COOKIE", "SET-COOKIE", "X-API-KEY", "X-REAL-IP",
88
"REMOTE-ADDR", "FORWARDED", "PROXY-AUTHORIZATION", "X-CSRF-TOKEN", "X-CSRFTOKEN",

0 commit comments

Comments
 (0)