diff --git a/Source/Sentry.framework/Versions/A/Headers/PrivateSentrySDKOnly.h b/Source/Sentry.framework/Versions/A/Headers/PrivateSentrySDKOnly.h new file mode 100644 index 0000000..442c2fa --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/PrivateSentrySDKOnly.h @@ -0,0 +1,40 @@ +#import + +#import "SentryDefines.h" + +@class SentryEnvelope, SentryDebugMeta; + +NS_ASSUME_NONNULL_BEGIN + +/** + * ATTENTION: This class is reserved for hybrid SDKs. Methods may be changed, renamed or removed + * without notice. If you want to use one of these methods here please open up an issue and let us + * now. + * + * The name of this class is supposed to be a bit weird and ugly. The name starts with private on + * purpose so users don't see it in code completion when typing Sentry. We also add only at the end + * to make it more obvious you shouldn't use it. + */ +@interface PrivateSentrySDKOnly : NSObject + +/** + * For storing an envelope synchronously to disk. + */ ++ (void)storeEnvelope:(SentryEnvelope *)envelope; + ++ (void)captureEnvelope:(SentryEnvelope *)envelope; + +/** + * Create an envelope from NSData. Needed for example by Flutter. + */ ++ (nullable SentryEnvelope *)envelopeWithData:(NSData *)data; + +/** + * Returns the current list of debug images. Be aware that the SentryDebugMeta is actually + * describing a debug image. This class should be renamed to SentryDebugImage in a future version. + */ +- (NSArray *)getDebugImages; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/Sentry.h b/Source/Sentry.framework/Versions/A/Headers/Sentry.h index 06f57c5..f8bc5a0 100644 --- a/Source/Sentry.framework/Versions/A/Headers/Sentry.h +++ b/Source/Sentry.framework/Versions/A/Headers/Sentry.h @@ -6,9 +6,12 @@ FOUNDATION_EXPORT double SentryVersionNumber; //! Project version string for Sentry. FOUNDATION_EXPORT const unsigned char SentryVersionString[]; +#import "PrivateSentrySDKOnly.h" +#import "SentryAttachment.h" #import "SentryBreadcrumb.h" #import "SentryClient.h" #import "SentryCrashExceptionApplication.h" +#import "SentryDebugImageProvider.h" #import "SentryDebugMeta.h" #import "SentryDefines.h" #import "SentryDsn.h" @@ -22,14 +25,23 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; #import "SentryId.h" #import "SentryIntegrationProtocol.h" #import "SentryMechanism.h" +#import "SentryMechanismMeta.h" #import "SentryMessage.h" +#import "SentryNSError.h" #import "SentryOptions.h" #import "SentrySDK.h" +#import "SentrySampleDecision.h" +#import "SentrySamplingContext.h" #import "SentryScope.h" #import "SentrySdkInfo.h" #import "SentrySerializable.h" #import "SentrySession.h" +#import "SentrySpanContext.h" +#import "SentrySpanId.h" +#import "SentrySpanProtocol.h" +#import "SentrySpanStatus.h" #import "SentryStacktrace.h" #import "SentryThread.h" +#import "SentryTransactionContext.h" #import "SentryUser.h" #import "SentryUserFeedback.h" diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryAttachment.h b/Source/Sentry.framework/Versions/A/Headers/SentryAttachment.h new file mode 100644 index 0000000..6a83414 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentryAttachment.h @@ -0,0 +1,90 @@ +#import "SentryDefines.h" +#import "SentrySerializable.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * You can use an attachment to store additional files alongside an event. + */ +NS_SWIFT_NAME(Attachment) +@interface SentryAttachment : NSObject +SENTRY_NO_INIT + +/** + * Initializes an attachment with data. Sets the content type to "application/octet-stream". + * + * @param data The data for the attachment. + * @param filename The name of the attachment to display in Sentry. + */ +- (instancetype)initWithData:(NSData *)data filename:(NSString *)filename; + +/** + * Initializes an attachment with data. + * + * @param data The data for the attachment. + * @param filename The name of the attachment to display in Sentry. + * @param contentType The content type of the attachment. Default is "application/octet-stream". + */ +- (instancetype)initWithData:(NSData *)data + filename:(NSString *)filename + contentType:(NSString *)contentType; + +/** + * Initializes an attachment with a path. Uses the last path compontent of the path as a filename + * and sets the content type to "application/octet-stream". + * + * @discussion The file located at the pathname is read lazily when the SDK captures an event or + * transaction not when the attachment is initialized. + * + * @param path The path of the file whose contents you want to upload to Sentry. + */ +- (instancetype)initWithPath:(NSString *)path; + +/** + * Initializes an attachment with a path. Sets the content type to "application/octet-stream". + * + * @discussion The file located at the pathname is read lazily when the SDK captures an event or + * transaction not when the attachment is initialized. + * + * @param path The path of the file whose contents you want to upload to Sentry. + * @param filename The name of the attachment to display in Sentry. + */ +- (instancetype)initWithPath:(NSString *)path filename:(NSString *)filename; + +/** + * Initializes an attachment with a path. + * + * @discussion The file located at the pathname is read lazily when the SDK captures an event or + * transaction not when the attachment is initialized. + * + * @param path The path of the file whose contents you want to upload to Sentry. + * @param filename The name of the attachment to display in Sentry. + * @param contentType The content type of the attachment. Default is "application/octet-stream". + */ +- (instancetype)initWithPath:(NSString *)path + filename:(NSString *)filename + contentType:(NSString *)contentType; + +/** + * The data of the attachment. + */ +@property (readonly, nonatomic, strong) NSData *_Nullable data; + +/** + * The path of the attachment. + */ +@property (readonly, nonatomic, copy) NSString *_Nullable path; + +/** + * The filename of the attachment to display in Sentry. + */ +@property (readonly, nonatomic, copy) NSString *filename; + +/** + * The content type of the attachment. Default is "application/octet-stream". + */ +@property (readonly, nonatomic, copy) NSString *contentType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryClient.h b/Source/Sentry.framework/Versions/A/Headers/SentryClient.h index d6e09f4..c60997f 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryClient.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryClient.h @@ -3,7 +3,7 @@ #import "SentryDefines.h" @class SentryOptions, SentrySession, SentryEvent, SentryEnvelope, SentryScope, SentryFileManager, - SentryId, SentryUserFeedback; + SentryId, SentryUserFeedback, SentryTransaction; NS_ASSUME_NONNULL_BEGIN @@ -113,11 +113,6 @@ SENTRY_NO_INIT - (void)captureEnvelope:(SentryEnvelope *)envelope NS_SWIFT_NAME(capture(envelope:)); -/** - * Needed by hybrid SDKs as react-native to synchronously store an envelope to disk. - */ -- (void)storeEnvelope:(SentryEnvelope *)envelope; - @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryDebugImageProvider.h b/Source/Sentry.framework/Versions/A/Headers/SentryDebugImageProvider.h new file mode 100644 index 0000000..82289f0 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentryDebugImageProvider.h @@ -0,0 +1,23 @@ +#import "SentryDefines.h" +#import + +@class SentryDebugMeta; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Reserved for hybrid SDKs that the debug image list for symbolication. + */ +@interface SentryDebugImageProvider : NSObject + +- (instancetype)init; + +/** + * Returns the current list of debug images. Be aware that the SentryDebugMeta is actually + * describing a debug image. This class should be renamed to SentryDebugImage in a future version. + */ +- (NSArray *)getDebugImages; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryDebugMeta.h b/Source/Sentry.framework/Versions/A/Headers/SentryDebugMeta.h index 304a33d..40a2186 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryDebugMeta.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryDebugMeta.h @@ -4,6 +4,13 @@ NS_ASSUME_NONNULL_BEGIN +/** + * This class is actually a DebugImage: + * https://develop.sentry.dev/sdk/event-payloads/debugmeta/#debug-images and should be renamed to + * SentryDebugImage in a future version. + * + * Contains information about a loaded library in the process and the memory address. + */ NS_SWIFT_NAME(DebugMeta) @interface SentryDebugMeta : NSObject diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryDefines.h b/Source/Sentry.framework/Versions/A/Headers/SentryDefines.h index ad33eeb..6f39d85 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryDefines.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryDefines.h @@ -22,7 +22,8 @@ -(instancetype)init NS_UNAVAILABLE; \ +(instancetype) new NS_UNAVAILABLE; -@class SentryEvent, SentryBreadcrumb; +@class SentryEvent, SentryBreadcrumb, SentrySamplingContext; +@protocol SentrySpan; /** * Block used for returning after a request finished @@ -48,14 +49,38 @@ typedef SentryBreadcrumb *_Nullable (^SentryBeforeBreadcrumbCallback)( */ typedef SentryEvent *_Nullable (^SentryBeforeSendEventCallback)(SentryEvent *_Nonnull event); +/** + * A callback to be notified when the last program execution terminated with a crash. + */ +typedef void (^SentryOnCrashedLastRunCallback)(SentryEvent *_Nonnull event); + /** * Block can be used to determine if an event should be queued and stored * locally. It will be tried to send again after next successful send. Note that - * this will only be called once the event is created and send manully. Once it + * this will only be called once the event is created and send manually. Once it * has been queued once it will be discarded if it fails again. */ typedef BOOL (^SentryShouldQueueEvent)( NSHTTPURLResponse *_Nullable response, NSError *_Nullable error); + +/** + * Function pointer for a sampler callback. + * + * @param samplingContext context of the sampling. + * + * @return A sample rate that is >= 0.0 and <= 1.0 or NIL if no sampling decision has been taken.. + * When returning a value out of range the SDK uses the default of 0. + */ +typedef NSNumber *_Nullable (^SentryTracesSamplerCallback)( + SentrySamplingContext *_Nonnull samplingContext); + +/** + * Function pointer for span manipulation. + * + * @param span The span to be used. + */ +typedef void (^SentrySpanCallback)(id _Nullable span); + /** * Loglevel */ @@ -77,7 +102,7 @@ typedef NS_ENUM(NSUInteger, SentryLevel) { kSentryLevelInfo = 2, kSentryLevelWarning = 3, kSentryLevelError = 4, - kSentryLevelFatal = 5, + kSentryLevelFatal = 5 }; /** diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryEnvelope.h b/Source/Sentry.framework/Versions/A/Headers/SentryEnvelope.h index 8ca72e5..54d6ff5 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryEnvelope.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryEnvelope.h @@ -2,7 +2,8 @@ #import "SentryDefines.h" -@class SentryEvent, SentrySession, SentrySdkInfo, SentryId, SentryUserFeedback; +@class SentryEvent, SentrySession, SentrySdkInfo, SentryId, SentryUserFeedback, SentryAttachment, + SentryTransaction; NS_ASSUME_NONNULL_BEGIN @@ -48,11 +49,18 @@ SENTRY_NO_INIT - (instancetype)initWithType:(NSString *)type length:(NSUInteger)length NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithType:(NSString *)type + length:(NSUInteger)length + filenname:(NSString *)filename + contentType:(NSString *)contentType; + /** * The type of the envelope item. */ @property (nonatomic, readonly, copy) NSString *type; @property (nonatomic, readonly) NSUInteger length; +@property (nonatomic, readonly, copy) NSString *_Nullable filename; +@property (nonatomic, readonly, copy) NSString *_Nullable contentType; @end @@ -62,6 +70,8 @@ SENTRY_NO_INIT - (instancetype)initWithEvent:(SentryEvent *)event; - (instancetype)initWithSession:(SentrySession *)session; - (instancetype)initWithUserFeedback:(SentryUserFeedback *)userFeedback; +- (_Nullable instancetype)initWithAttachment:(SentryAttachment *)attachment + maxAttachmentSize:(NSUInteger)maxAttachmentSize; - (instancetype)initWithHeader:(SentryEnvelopeItemHeader *)header data:(NSData *)data NS_DESIGNATED_INITIALIZER; diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryEvent.h b/Source/Sentry.framework/Versions/A/Headers/SentryEvent.h index 946ca64..7f1d96e 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryEvent.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryEvent.h @@ -17,14 +17,21 @@ NS_SWIFT_NAME(Event) @property (nonatomic, strong) SentryId *eventId; /** - * Message of the event + * Message of the event. */ -@property (nonatomic, strong) SentryMessage *message; +@property (nonatomic, strong) SentryMessage *_Nullable message; + +/** + * The error of the event. This property adds convenience to access the error directly in + * beforeSend. This property is not serialized. Instead when preparing the event the SentryClient + * puts the error into exceptions. + */ +@property (nonatomic, copy) NSError *_Nullable error; /** * NSDate of when the event occured */ -@property (nonatomic, strong) NSDate *timestamp; +@property (nonatomic, strong) NSDate *_Nullable timestamp; /** * NSDate of when the event started, mostly useful if event type transaction @@ -164,6 +171,15 @@ NS_SWIFT_NAME(Event) */ - (instancetype)initWithLevel:(enum SentryLevel)level NS_DESIGNATED_INITIALIZER; +/** + * Initializes a SentryEvent with an NSError and sets the level to SentryLevelError. + * + * @param error The error of the event. + * + * @return The initialized SentryEvent. + */ +- (instancetype)initWithError:(NSError *)error; + @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryException.h b/Source/Sentry.framework/Versions/A/Headers/SentryException.h index 6df9463..37eac9d 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryException.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryException.h @@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN -@class SentryThread, SentryMechanism; +@class SentryStacktrace, SentryMechanism; NS_SWIFT_NAME(Exception) @interface SentryException : NSObject @@ -32,14 +32,14 @@ SENTRY_NO_INIT @property (nonatomic, copy) NSString *_Nullable module; /** - * Determines if the exception was reported by a user BOOL + * An optional value which refers to a thread in `SentryEvent.threads`. */ -@property (nonatomic, copy) NSNumber *_Nullable userReported; +@property (nonatomic, copy) NSNumber *_Nullable threadId; /** - * SentryThread of the SentryException + * Stacktrace containing frames of this exception. */ -@property (nonatomic, strong) SentryThread *_Nullable thread; +@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; /** * Initialize an SentryException with value and type diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryFrame.h b/Source/Sentry.framework/Versions/A/Headers/SentryFrame.h index 6dcb46f..56b5128 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryFrame.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryFrame.h @@ -63,6 +63,11 @@ NS_SWIFT_NAME(Frame) */ @property (nonatomic, copy) NSNumber *_Nullable inApp; +/** + * Determines if the Frame is the base of an async continuation. + */ +@property (nonatomic, copy) NSNumber *_Nullable stackStart; + - (instancetype)init; + (instancetype)new NS_UNAVAILABLE; diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryHub.h b/Source/Sentry.framework/Versions/A/Headers/SentryHub.h index 2410015..bb35fd3 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryHub.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryHub.h @@ -1,8 +1,9 @@ #import "SentryDefines.h" #import "SentryIntegrationProtocol.h" +#import "SentrySpanProtocol.h" @class SentryEvent, SentryClient, SentryScope, SentrySession, SentryUser, SentryBreadcrumb, - SentryId, SentryUserFeedback; + SentryId, SentryUserFeedback, SentryEnvelope, SentryTransactionContext; NS_ASSUME_NONNULL_BEGIN @interface SentryHub : NSObject @@ -11,13 +12,31 @@ SENTRY_NO_INIT - (instancetype)initWithClient:(SentryClient *_Nullable)client andScope:(SentryScope *_Nullable)scope; -// Since there's no scope stack, single hub instance, experimenting with holding -// session here. +/** + * Since there's no scope stack, single hub instance, we keep the session here. + */ @property (nonatomic, readonly, strong) SentrySession *_Nullable session; +/** + * Starts a new SentrySession. If there's a running SentrySession, it ends it before starting the + * new one. You can use this method in combination with endSession to manually track SentrySessions. + * The SDK uses SentrySession to inform Sentry about release and project associated project health. + */ - (void)startSession; + +/** + * Ends the current SentrySession. You can use this method in combination with startSession to + * manually track SentrySessions. The SDK uses SentrySession to inform Sentry about release and + * project associated project health. + */ +- (void)endSession; + +/** + * Ends the current session with the given timestamp. + * + * @param timestamp The timestamp to end the session with. + */ - (void)endSessionWithTimestamp:(NSDate *)timestamp; -- (void)closeCachedSessionWithTimestamp:(NSDate *_Nullable)timestamp; @property (nonatomic, strong) NSMutableArray *> *installedIntegrations; @@ -42,6 +61,80 @@ SENTRY_NO_INIT - (SentryId *)captureEvent:(SentryEvent *)event withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(event:scope:)); +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param name The transaction name. + * @param operation Short code identifying the type of operation the span is measuring. + * + * @return The created transaction. + */ +- (id)startTransactionWithName:(NSString *)name + operation:(NSString *)operation + NS_SWIFT_NAME(startTransaction(name:operation:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param name The transaction name. + * @param operation Short code identifying the type of operation the span is measuring. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * + * @return The created transaction. + */ +- (id)startTransactionWithName:(NSString *)name + operation:(NSString *)operation + bindToScope:(BOOL)bindToScope + NS_SWIFT_NAME(startTransaction(name:operation:bindToScope:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * + * @return The created transaction. + */ +- (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + NS_SWIFT_NAME(startTransaction(transactionContext:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * + * @return The created transaction. + */ +- (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + bindToScope:(BOOL)bindToScope + NS_SWIFT_NAME(startTransaction(transactionContext:bindToScope:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * @param customSamplingContext Additional information about the sampling context. + * + * @return The created transaction. + */ +- (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + bindToScope:(BOOL)bindToScope + customSamplingContext:(NSDictionary *)customSamplingContext + NS_SWIFT_NAME(startTransaction(transactionContext:bindToScope:customSamplingContext:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param customSamplingContext Additional information about the sampling context. + * + * @return The created transaction. + */ +- (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + customSamplingContext:(NSDictionary *)customSamplingContext + NS_SWIFT_NAME(startTransaction(transactionContext:customSamplingContext:)); + /** * Captures an error event and sends it to Sentry. * @@ -111,12 +204,17 @@ SENTRY_NO_INIT NS_SWIFT_NAME(capture(userFeedback:)); /** - * Invokes the callback with a mutable reference to the scope for modifications. + * Use this method to modify the Scope of the Hub. The SDK uses the Scope to attach + * contextual data to events. + * + * @param callback The callback for configuring the Scope of the Hub. */ - (void)configureScope:(void (^)(SentryScope *scope))callback; /** - * Adds a breadcrumb to the current scope. + * Adds a breadcrumb to the Scope of the Hub. + * + * @param crumb The Breadcrumb to add to the Scope of the Hub. */ - (void)addBreadcrumb:(SentryBreadcrumb *)crumb; @@ -126,9 +224,9 @@ SENTRY_NO_INIT - (SentryClient *_Nullable)getClient; /** - * Returns a scope either the current or new. + * Returns either the current scope and if nil a new one. */ -- (SentryScope *)getScope; +@property (nonatomic, readonly, strong) SentryScope *scope; /** * Binds a different client to the hub. @@ -142,16 +240,28 @@ SENTRY_NO_INIT /** * Checks if a specific Integration (`integrationClass`) has been installed. - * @return BOOL If instance of `integrationClass` exists within - * `SentryHub.installedIntegrations`. + * + * @return BOOL If instance of `integrationClass` exists within `SentryHub.installedIntegrations`. */ - (BOOL)isIntegrationInstalled:(Class)integrationClass; /** - * Set global user -> thus will be sent with every event + * Set user to the Scope of the Hub. + * + * @param user The user to set to the Scope. */ - (void)setUser:(SentryUser *_Nullable)user; +/** + * The SDK reserves this method for hybrid SDKs, which use it to capture events. + * + * @discussion We increase the session error count if an envelope is passed in containing an + * event with event.level error or higher. Ideally, we would check the mechanism and/or exception + * list, like the Java and Python SDK do this, but this would require full deserialization of the + * event. + */ +- (void)captureEnvelope:(SentryEnvelope *)envelope NS_SWIFT_NAME(capture(envelope:)); + @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryIntegrationProtocol.h b/Source/Sentry.framework/Versions/A/Headers/SentryIntegrationProtocol.h index 4080d59..1f4bc66 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryIntegrationProtocol.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryIntegrationProtocol.h @@ -8,10 +8,16 @@ NS_ASSUME_NONNULL_BEGIN @protocol SentryIntegrationProtocol /** - * installs the integration and returns YES if successful. + * Installs the integration and returns YES if successful. */ - (void)installWithOptions:(SentryOptions *)options; +/** + * Uninstalls the integration. + */ +@optional +- (void)uninstall; + @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryMechanism.h b/Source/Sentry.framework/Versions/A/Headers/SentryMechanism.h index b87537f..3a1bd33 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryMechanism.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryMechanism.h @@ -5,6 +5,8 @@ NS_ASSUME_NONNULL_BEGIN +@class SentryNSError, SentryMechanismMeta; + NS_SWIFT_NAME(Mechanism) @interface SentryMechanism : NSObject SENTRY_NO_INIT @@ -16,8 +18,8 @@ SENTRY_NO_INIT @property (nonatomic, copy) NSString *type; /** - * Human readable description of the error mechanism and a possible - * hint on how to solve this error + * Human readable description of the error mechanism and a possible hint on how to solve this error. + * We can't use description as it overlaps with NSObject.description. */ @property (nonatomic, copy) NSString *_Nullable desc; @@ -41,9 +43,9 @@ SENTRY_NO_INIT /** * Information from the operating system or runtime on the exception - * mechanism + * mechanism. */ -@property (nonatomic, strong) NSDictionary *_Nullable meta; +@property (nullable, nonatomic, strong) SentryMechanismMeta *meta; /** * Initialize an SentryMechanism with a type diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryMechanismMeta.h b/Source/Sentry.framework/Versions/A/Headers/SentryMechanismMeta.h new file mode 100644 index 0000000..891f979 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentryMechanismMeta.h @@ -0,0 +1,38 @@ +#import "SentryDefines.h" +#import "SentrySerializable.h" +#import + +@class SentryNSError; + +NS_ASSUME_NONNULL_BEGIN + +/** + * The mechanism metadata usually carries error codes reported by the runtime or operating system, + * along with a platform-dependent interpretation of these codes. + * + * See https://develop.sentry.dev/sdk/event-payloads/exception/#meta-information. + */ +NS_SWIFT_NAME(MechanismMeta) +@interface SentryMechanismMeta : NSObject + +- (instancetype)init; + +/** + * Information on the POSIX signal. On Apple systems, signals also carry a code in addition to the + * signal number describing the signal in more detail. On Linux, this code does not exist. + */ +@property (nullable, nonatomic, strong) NSDictionary *signal; + +/** + * A Mach Exception on Apple systems comprising a code triple and optional descriptions. + */ +@property (nullable, nonatomic, strong) NSDictionary *machException; + +/** + * Sentry uses the NSErrors domain and code for grouping. Only domain and code are serialized. + */ +@property (nullable, nonatomic, strong) SentryNSError *error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryNSError.h b/Source/Sentry.framework/Versions/A/Headers/SentryNSError.h new file mode 100644 index 0000000..af74383 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentryNSError.h @@ -0,0 +1,33 @@ +#import "SentryDefines.h" +#import "SentrySerializable.h" +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Sentry representation of an NSError to send to Sentry. + */ +@interface SentryNSError : NSObject +SENTRY_NO_INIT + +/** + * The domain of an NSError. + */ +@property (nonatomic, copy) NSString *domain; + +/** + * The error code of an NSError + */ +@property (nonatomic, assign) NSInteger code; + +/** + * Initializes SentryNSError and sets the domain and code. + * + * @param domain The domain of an NSError. + * @param code The error code of an NSError. + */ +- (instancetype)initWithDomain:(NSString *)domain code:(NSInteger)code; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryOptions.h b/Source/Sentry.framework/Versions/A/Headers/SentryOptions.h index d608c74..2330002 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryOptions.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryOptions.h @@ -2,7 +2,7 @@ NS_ASSUME_NONNULL_BEGIN -@class SentryDsn; +@class SentryDsn, SentrySdkInfo; NS_SWIFT_NAME(Options) @interface SentryOptions : NSObject @@ -19,41 +19,38 @@ NS_SWIFT_NAME(Options) * The DSN tells the SDK where to send the events to. If this value is not provided, the SDK will * not send any events. */ -@property (nonatomic, strong) NSString *_Nullable dsn; +@property (nullable, nonatomic, strong) NSString *dsn; /** * The parsed internal DSN. */ -@property (nonatomic, strong) SentryDsn *_Nullable parsedDsn; +@property (nullable, nonatomic, strong) SentryDsn *parsedDsn; /** - * debug [mode] sets a more verbose log level. Default is NO. If set to YES - * sentry prints more log messages to the console. + * Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging + * information if something goes wrong. Default is disabled. */ @property (nonatomic, assign) BOOL debug; /** - DEPRECATED: use debug bool instead (debug = YES maps to logLevel - kSentryLogLevelError, debug = NO maps to loglevel kSentryLogLevelError). thus - kSentryLogLevelNone and kSentryLogLevelDebug will be dropped entirely. defines - the log level of sentry log (console output). + * Minimum LogLevel to be used if debug is enabled. Default is debug. */ -@property (nonatomic, assign) SentryLogLevel logLevel; +@property (nonatomic, assign) SentryLevel diagnosticLevel; /** * This property will be filled before the event is sent. */ -@property (nonatomic, copy) NSString *_Nullable releaseName; +@property (nullable, nonatomic, copy) NSString *releaseName; /** * This property will be filled before the event is sent. */ -@property (nonatomic, copy) NSString *_Nullable dist; +@property (nullable, nonatomic, copy) NSString *dist; /** * The environment used for this event */ -@property (nonatomic, copy) NSString *_Nullable environment; +@property (nullable, nonatomic, copy) NSString *environment; /** * Specifies wether this SDK should send events to Sentry. If set to NO events will be @@ -67,22 +64,38 @@ NS_SWIFT_NAME(Options) */ @property (nonatomic, assign) NSUInteger maxBreadcrumbs; +/** + * The maximum number of envelopes to keep in cache. Default is 30. + */ +@property (nonatomic, assign) NSUInteger maxCacheItems; + /** * This block can be used to modify the event before it will be serialized and * sent */ -@property (nonatomic, copy) SentryBeforeSendEventCallback _Nullable beforeSend; +@property (nullable, nonatomic, copy) SentryBeforeSendEventCallback beforeSend; /** * This block can be used to modify the event before it will be serialized and * sent */ -@property (nonatomic, copy) SentryBeforeBreadcrumbCallback _Nullable beforeBreadcrumb; +@property (nullable, nonatomic, copy) SentryBeforeBreadcrumbCallback beforeBreadcrumb; + +/** + * This gets called shortly after the initialization of the SDK when the last program execution + * terminated with a crash. It is not guaranteed that this is called on the main thread. + * + * @discussion This callback is only executed once during the entire run of the program to avoid + * multiple callbacks if there are multiple crash events to send. This can happen when the program + * terminates with a crash before the SDK can send the crash event. You can look into beforeSend if + * you prefer a callback for every event. + */ +@property (nullable, nonatomic, copy) SentryOnCrashedLastRunCallback onCrashedLastRun; /** * Array of integrations to install. */ -@property (nonatomic, copy) NSArray *_Nullable integrations; +@property (nullable, nonatomic, copy) NSArray *integrations; /** * Array of default integrations. Will be used if integrations are nil @@ -90,16 +103,23 @@ NS_SWIFT_NAME(Options) + (NSArray *)defaultIntegrations; /** - * Defines the sample rate of SentryClient, should be a float between 0.0 - * and 1.0. valid settings are 0.0 - 1.0 and nil + * Indicates the percentage of events being sent to Sentry. Setting this to 0 or NIL discards all + * events, 1.0 sends all events, 0.01 collects 1% of all events. The default is 1. The value needs + * to be >= 0.0 and <= 1.0. When setting a value out of range the SDK sets it to the default + * of 1.0. */ -@property (nonatomic, copy) NSNumber *_Nullable sampleRate; +@property (nullable, nonatomic, copy) NSNumber *sampleRate; /** * Whether to enable automatic session tracking or not. Default is YES. */ @property (nonatomic, assign) BOOL enableAutoSessionTracking; +/** + * Whether to enable out of memory tracking or not. Default is YES. + */ +@property (nonatomic, assign) BOOL enableOutOfMemoryTracking; + /** * The interval to end a session if the App goes to the background. */ @@ -110,10 +130,82 @@ NS_SWIFT_NAME(Options) * always attached to exceptions but when this is set stack traces are also sent with messages. * Stack traces are only attached for the current thread. * - * This feature is disabled by default. + * This feature is enabled by default. */ @property (nonatomic, assign) BOOL attachStacktrace; +/** + * Describes the Sentry SDK and its configuration used to capture and transmit an event. + */ +@property (nonatomic, readonly, strong) SentrySdkInfo *sdkInfo; + +/** + * The maximum size for each attachment in bytes. Default is 20 MiB / 20 * 1024 * 1024 bytes. + * + * Please also check the maximum attachment size of relay to make sure your attachments don't get + * discarded there: https://docs.sentry.io/product/relay/options/ + */ +@property (nonatomic, assign) NSUInteger maxAttachmentSize; + +/** + * When enabled, the SDK sends personal identifiable along with events. The default is + * NO. + * + * @discussion When the user of an event doesn't contain an IP address, the SDK sets it to + * {{auto}} to instruct the server to use the connection IP address as the user + * address. + */ +@property (nonatomic, assign) BOOL sendDefaultPii; + +/** + * Indicates the percentage of the tracing data that is collected. Setting this to 0 or NIL discards + * all trace data, 1.0 collects all trace data, 0.01 collects 1% of all trace data. The default is + * 0. The value needs to be >= 0.0 and <= 1.0. When setting a value out of range the SDK sets it to + * the default of 0. + */ +@property (nullable, nonatomic, strong) NSNumber *tracesSampleRate; + +/** + * A callback to a user defined traces sampler function. Returning 0 or NIL discards all trace + * data, 1.0 collects all trace data, 0.01 collects 1% of all trace data. The sample rate needs to + * be >= 0.0 and <= 1.0 or NIL. When returning a value out of range the SDK uses the default of 0. + */ +@property (nullable, nonatomic) SentryTracesSamplerCallback tracesSampler; + +/** + * A list of string prefixes of framework names that belong to the app. This option takes precedence + * over inAppExcludes. Per default this contains CFBundleExecutable to mark it as inApp. + */ +@property (nonatomic, readonly, copy) NSArray *inAppIncludes; + +/** + * Adds an item to the list of inAppIncludes. + * + * @param inAppInclude The prefix of the framework name. + */ +- (void)addInAppInclude:(NSString *)inAppInclude; + +/** + * A list of string prefixes of framework names that do not belong to the app, but rather to + * third-party frameworks. Frameworks considered not part of the app will be hidden from stack + * traces by default. + * + * This option can be overridden using inAppIncludes. + */ +@property (nonatomic, readonly, copy) NSArray *inAppExcludes; + +/** + * Adds an item to the list of inAppExcludes. + * + * @param inAppExclude The prefix of the frameworks name. + */ +- (void)addInAppExclude:(NSString *)inAppExclude; + +/** + * Set as delegate on the NSURLSession used for all network data-transfer tasks performed by Sentry. + */ +@property (nullable, nonatomic, weak) id urlSessionDelegate; + @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySDK.h b/Source/Sentry.framework/Versions/A/Headers/SentrySDK.h index 0fa8874..b81f49c 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentrySDK.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySDK.h @@ -2,39 +2,31 @@ #import "SentryDefines.h" +@protocol SentrySpan; + @class SentryHub, SentryOptions, SentryEvent, SentryBreadcrumb, SentryScope, SentryUser, SentryId, - SentryUserFeedback; + SentryUserFeedback, SentryTransactionContext; NS_ASSUME_NONNULL_BEGIN -// NS_SWIFT_NAME(SDK) /** - "static api" for easy access to most common sentry sdk features - - try `SentryHub` for advanced features + * The main entry point for the SentrySDK. + * + * We recommend using `[Sentry startWithConfigureOptions]` to initialize Sentry. */ @interface SentrySDK : NSObject SENTRY_NO_INIT /** - * Returns current hub - */ -+ (SentryHub *)currentHub; - -/** - * This forces a crash, useful to test the SentryCrash integration - */ -+ (void)crash; - -/** - * Sets current hub + * The current active transaction or span bound to the scope. */ -+ (void)setCurrentHub:(SentryHub *)hub; +@property (nullable, class, nonatomic, readonly) id span; /** * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. */ -+ (void)startWithOptions:(NSDictionary *)optionsDict NS_SWIFT_NAME(start(options:)); ++ (void)startWithOptions:(NSDictionary *)optionsDict + NS_SWIFT_NAME(start(options:)); /** * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. @@ -43,7 +35,7 @@ SENTRY_NO_INIT /** * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. Make sure to - * set a valid DSN otherwise. + * set a valid DSN. */ + (void)startWithConfigureOptions:(void (^)(SentryOptions *options))configureOptions NS_SWIFT_NAME(start(configureOptions:)); @@ -79,7 +71,82 @@ SENTRY_NO_INIT * @return The SentryId of the event or SentryId.empty if the event is not sent. */ + (SentryId *)captureEvent:(SentryEvent *)event - withScopeBlock:(void (^)(SentryScope *scope))block NS_SWIFT_NAME(capture(event:block:)); + withScopeBlock:(void (^)(SentryScope *scope))block + NS_SWIFT_NAME(capture(event:block:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param name The transaction name. + * @param operation Short code identifying the type of operation the span is measuring. + * + * @return The created transaction. + */ ++ (id)startTransactionWithName:(NSString *)name + operation:(NSString *)operation + NS_SWIFT_NAME(startTransaction(name:operation:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param name The transaction name. + * @param operation Short code identifying the type of operation the span is measuring. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * + * @return The created transaction. + */ ++ (id)startTransactionWithName:(NSString *)name + operation:(NSString *)operation + bindToScope:(BOOL)bindToScope + NS_SWIFT_NAME(startTransaction(name:operation:bindToScope:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * + * @return The created transaction. + */ ++ (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + NS_SWIFT_NAME(startTransaction(transactionContext:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * + * @return The created transaction. + */ ++ (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + bindToScope:(BOOL)bindToScope + NS_SWIFT_NAME(startTransaction(transactionContext:bindToScope:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param bindToScope Indicates whether the new transaction should be bind to the scope. + * @param customSamplingContext Additional information about the sampling context. + * + * @return The created transaction. + */ ++ (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + bindToScope:(BOOL)bindToScope + customSamplingContext:(NSDictionary *)customSamplingContext + NS_SWIFT_NAME(startTransaction(transactionContext:bindToScope:customSamplingContext:)); + +/** + * Creates a transaction, binds it to the hub and returns the instance. + * + * @param transactionContext The transaction context. + * @param customSamplingContext Additional information about the sampling context. + * + * @return The created transaction. + */ ++ (id)startTransactionWithContext:(SentryTransactionContext *)transactionContext + customSamplingContext:(NSDictionary *)customSamplingContext + NS_SWIFT_NAME(startTransaction(transactionContext:customSamplingContext:)); /** * Captures an error event and sends it to Sentry. @@ -112,7 +179,8 @@ SENTRY_NO_INIT * @return The SentryId of the event or SentryId.empty if the event is not sent. */ + (SentryId *)captureError:(NSError *)error - withScopeBlock:(void (^)(SentryScope *scope))block NS_SWIFT_NAME(capture(error:block:)); + withScopeBlock:(void (^)(SentryScope *scope))block + NS_SWIFT_NAME(capture(error:block:)); /** * Captures an exception event and sends it to Sentry. @@ -191,21 +259,20 @@ SENTRY_NO_INIT NS_SWIFT_NAME(capture(userFeedback:)); /** - * Adds a SentryBreadcrumb to the current Scope on the `currentHub`. - * If the total number of breadcrumbs exceeds the `max_breadcrumbs` setting, the - * oldest breadcrumb is removed. + * Adds a Breadcrumb to the current Scope of the current Hub. If the total number of breadcrumbs + * exceeds the `SentryOptions.maxBreadcrumbs`, the SDK removes the oldest breadcrumb. + * + * @param crumb The Breadcrumb to add to the current Scope of the current Hub. */ + (void)addBreadcrumb:(SentryBreadcrumb *)crumb NS_SWIFT_NAME(addBreadcrumb(crumb:)); -//- `configure_scope(callback)`: Calls a callback with a scope object that can -// be reconfigured. This is used to attach contextual data for future events in -// the same scope. -+ (void)configureScope:(void (^)(SentryScope *scope))callback; - /** - * Set logLevel for the current client default kSentryLogLevelError + * Use this method to modify the current Scope of the current Hub. The SDK uses the Scope to attach + * contextual data to events. + * + * @param callback The callback for configuring the current Scope of the current Hub. */ -@property (nonatomic, class) SentryLogLevel logLevel; ++ (void)configureScope:(void (^)(SentryScope *scope))callback; /** * Checks if the last program execution terminated with a crash. @@ -213,10 +280,36 @@ SENTRY_NO_INIT @property (nonatomic, class, readonly) BOOL crashedLastRun; /** - * Set global user -> thus will be sent with every event + * Set user to the current Scope of the current Hub. + * + * @param user The user to set to the current Scope. */ + (void)setUser:(SentryUser *_Nullable)user; +/** + * Starts a new SentrySession. If there's a running SentrySession, it ends it before starting the + * new one. You can use this method in combination with endSession to manually track SentrySessions. + * The SDK uses SentrySession to inform Sentry about release and project associated project health. + */ ++ (void)startSession; + +/** + * Ends the current SentrySession. You can use this method in combination with startSession to + * manually track SentrySessions. The SDK uses SentrySession to inform Sentry about release and + * project associated project health. + */ ++ (void)endSession; + +/** + * This forces a crash, useful to test the SentryCrash integration + */ ++ (void)crash; + +/** + * Closes the SDK and uninstalls all the integrations. + */ ++ (void)close; + @end NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySampleDecision.h b/Source/Sentry.framework/Versions/A/Headers/SentrySampleDecision.h new file mode 100644 index 0000000..92c7075 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySampleDecision.h @@ -0,0 +1,22 @@ +#import +/** + * Trace sample decision flag. + */ +typedef NS_ENUM(NSUInteger, SentrySampleDecision) { + /** + * Used when the decision to sample a trace should be postponed. + */ + kSentrySampleDecisionUndecided, + + /** + * The trace should be sampled. + */ + kSentrySampleDecisionYes, + + /** + * The trace should not be sampled. + */ + kSentrySampleDecisionNo +}; + +static NSString *_Nonnull const SentrySampleDecisionNames[] = { @"undecided", @"true", @"false" }; diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySamplingContext.h b/Source/Sentry.framework/Versions/A/Headers/SentrySamplingContext.h new file mode 100644 index 0000000..dd16e71 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySamplingContext.h @@ -0,0 +1,38 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@class SentryTransactionContext; + +NS_SWIFT_NAME(SamplingContext) +@interface SentrySamplingContext : NSObject + +/** + * Transaction context. + */ +@property (nonatomic, readonly) SentryTransactionContext *transactionContext; + +/** + * Custom data used for sampling. + */ +@property (nullable, nonatomic, readonly) NSDictionary *customSamplingContext; + +/** + * Init a SentryTransactionSamplingContext. + * + * @param transactionContext The context of the transaction being sampled. + */ +- (instancetype)initWithTransactionContext:(SentryTransactionContext *)transactionContext; + +/** + * Init a SentryTransactionSamplingContext. + * + * @param transactionContext The context of the transaction being sampled. + * @param customSamplingContext Custom data used for sampling. + */ +- (instancetype)initWithTransactionContext:(SentryTransactionContext *)transactionContext + customSamplingContext:(NSDictionary *)customSamplingContext; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryScope.h b/Source/Sentry.framework/Versions/A/Headers/SentryScope.h index f69d949..04806bf 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryScope.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryScope.h @@ -1,13 +1,21 @@ #import "SentryDefines.h" #import "SentrySerializable.h" +#import "SentrySpanProtocol.h" -@class SentryUser, SentrySession, SentryOptions, SentryBreadcrumb; +@class SentryUser, SentrySession, SentryOptions, SentryBreadcrumb, SentryAttachment; NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(Scope) @interface SentryScope : NSObject +/** + * Returns current Span or Transaction. + * + * @return current Span or Transaction or null if transaction has not been set. + */ +@property (nullable, nonatomic, strong) id span; + - (instancetype)initWithMaxBreadcrumbs:(NSInteger)maxBreadcrumbs NS_DESIGNATED_INITIALIZER; - (instancetype)init; - (instancetype)initWithScope:(SentryScope *)scope; @@ -95,7 +103,7 @@ NS_SWIFT_NAME(Scope) /** * Sets context values which will overwrite SentryEvent.context when event is - * "enrichted" with scope before sending event. + * "enriched" with scope before sending event. */ - (void)setContextValue:(NSDictionary *)value forKey:(NSString *)key NS_SWIFT_NAME(setContext(value:key:)); @@ -105,16 +113,25 @@ NS_SWIFT_NAME(Scope) */ - (void)removeContextForKey:(NSString *)key NS_SWIFT_NAME(removeContext(key:)); +/** + * Adds an attachment to the Scope's list of attachments. The SDK adds the attachment to every event + * sent to Sentry. + * + * @param attachment The attachment to add to the Scope's list of attachments. + */ +- (void)addAttachment:(SentryAttachment *)attachment; + /** * Clears the current Scope */ - (void)clear; -- (BOOL)isEqual:(id _Nullable)other; - -- (BOOL)isEqualToScope:(SentryScope *)scope; - -- (NSUInteger)hash; +/** + * Mutates the current transaction atomically. + * + * @param callback the SentrySpanCallback. + */ +- (void)useSpan:(SentrySpanCallback)callback; @end diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySession.h b/Source/Sentry.framework/Versions/A/Headers/SentrySession.h index a52db0d..4ecea99 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentrySession.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySession.h @@ -1,4 +1,5 @@ #import "SentryDefines.h" +#import "SentrySerializable.h" @class SentryUser; @@ -11,11 +12,22 @@ typedef NS_ENUM(NSUInteger, SentrySessionStatus) { kSentrySessionStatusAbnormal = 3, }; -@interface SentrySession : NSObject +/** + * The SDK uses SentrySession to inform Sentry about release and project associated project health. + */ +@interface SentrySession : NSObject SENTRY_NO_INIT - (instancetype)initWithReleaseName:(NSString *)releaseName; -- (instancetype)initWithJSONObject:(NSDictionary *)jsonObject; + +/** + * Initializes SentrySession from a JSON object. + * + * @param jsonObject The jsonObject containing the session. + * + * @return The SentrySession or nil if the JSONObject contains an error. + */ +- (nullable instancetype)initWithJSONObject:(NSDictionary *)jsonObject; - (void)endSessionExitedWithTimestamp:(NSDate *)timestamp; - (void)endSessionCrashedWithTimestamp:(NSDate *)timestamp; diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySpanContext.h b/Source/Sentry.framework/Versions/A/Headers/SentrySpanContext.h new file mode 100644 index 0000000..db0d310 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySpanContext.h @@ -0,0 +1,107 @@ +#import "SentryDefines.h" +#import "SentrySampleDecision.h" +#import "SentrySerializable.h" +#import "SentrySpanStatus.h" + +NS_ASSUME_NONNULL_BEGIN + +@class SentryId, SentrySpanId; + +NS_SWIFT_NAME(SpanContext) +@interface SentrySpanContext : NSObject +SENTRY_NO_INIT + +/** + * Determines which trace the Span belongs to. + */ +@property (nonatomic, readonly) SentryId *traceId; + +/** + * Span id. + */ +@property (nonatomic, readonly) SentrySpanId *spanId; + +/** + * Id of a parent span. + */ +@property (nullable, nonatomic, readonly) SentrySpanId *parentSpanId; + +/** + * If trace is sampled. + */ +@property (nonatomic) SentrySampleDecision sampled; + +/** + * Short code identifying the type of operation the span is measuring. + */ +@property (nonatomic, copy) NSString *operation; + +/** + * Longer description of the span's operation, which uniquely identifies the span but is + * consistent across instances of the span. + */ +@property (nullable, nonatomic, copy) NSString *spanDescription; + +/** + * Describes the status of the Transaction. + */ +@property (nonatomic) SentrySpanStatus status; + +/** + * A map or list of tags for this event. Each tag must be less than 200 characters. + */ +@property (nonatomic, readonly) NSDictionary *tags; + +/** + * Init a SentryContext with an operation code, + * traceId and spanId with be randomly created, + * sampled by default is false. + * + * @return SentryContext + */ +- (instancetype)initWithOperation:(NSString *)operation; + +/** + * Init a SentryContext with an operation code and mark it as sampled or not. + * TraceId and SpanId with be randomly created. + * + * @param operation The operation this span is measuring. + * @param sampled Determines whether the trace should be sampled. + * + * @return SentryContext + */ + +- (instancetype)initWithOperation:(NSString *)operation sampled:(SentrySampleDecision)sampled; + +/** + * Init a SentryContext with given traceId, spanId and parentId. + * + * @param traceId Determines which trace the Span belongs to. + * @param spanId The Span Id + * @param operation The operation this span is measuring. + * @param parentId Id of a parent span. + * @param sampled Determines whether the trace should be sampled. + * + * @return SentryContext + */ +- (instancetype)initWithTraceId:(SentryId *)traceId + spanId:(SentrySpanId *)spanId + parentId:(nullable SentrySpanId *)parentId + operation:(NSString *)operation + sampled:(SentrySampleDecision)sampled; + +/** + * Sets a tag with given value. + */ +- (void)setTagValue:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(setTag(value:key:)); + +/** + * Removes a tag. + */ +- (void)removeTagForKey:(NSString *)key NS_SWIFT_NAME(removeTag(key:)); + +@property (class, nonatomic, readonly, copy) NSString *type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySpanId.h b/Source/Sentry.framework/Versions/A/Headers/SentrySpanId.h new file mode 100644 index 0000000..9ecc514 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySpanId.h @@ -0,0 +1,40 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * A 16 character Id. + */ + +NS_SWIFT_NAME(SpanId) +@interface SentrySpanId : NSObject + +/** + * Creates a SentrySpanId with a random 16 character Id. + */ +- (instancetype)init; + +/** + * Creates a SentrySpanId with the first 16 characters of the given UUID. + */ +- (instancetype)initWithUUID:(NSUUID *)uuid; + +/** + * Creates a SentrySpanId from a 16 character string. + * Returns a empty SentrySpanId with the input is invalid. + */ +- (instancetype)initWithValue:(NSString *)value; + +/** + * Returns the Span Id Value + */ +@property (readonly, copy) NSString *sentrySpanIdString; + +/** + * A SentrySpanId with an empty Id "0000000000000000". + */ +@property (class, nonatomic, readonly, strong) SentrySpanId *empty; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySpanProtocol.h b/Source/Sentry.framework/Versions/A/Headers/SentrySpanProtocol.h new file mode 100644 index 0000000..33233d4 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySpanProtocol.h @@ -0,0 +1,79 @@ +#import "SentryDefines.h" +#import "SentrySerializable.h" +#import "SentrySpanContext.h" + +NS_ASSUME_NONNULL_BEGIN + +@class SentrySpanId, SentryId; + +NS_SWIFT_NAME(Span) +@protocol SentrySpan + +/** + * The context information of the span. + */ +@property (nonatomic, readonly) SentrySpanContext *context; + +/** + * The timestamp of which the span ended. + */ +@property (nullable, nonatomic, strong) NSDate *timestamp; + +/** + * The start time of the span. + */ +@property (nullable, nonatomic, strong) NSDate *startTimestamp; + +/** + * An arbitrary mapping of additional metadata of the span. + */ +@property (nullable, readonly) NSDictionary *data; + +/** + * Whether the span is finished. + */ +@property (readonly) BOOL isFinished; + +/** + * Starts a child span. + * + * @param operation Short code identifying the type of operation the span is measuring. + * + * @return SentrySpan + */ +- (id)startChildWithOperation:(NSString *)operation + NS_SWIFT_NAME(startChild(operation:)); + +/** + * Starts a child span. + * + * @param operation Defines the child span operation. + * @param description Define the child span description. + * + * @return SentrySpan + */ +- (id)startChildWithOperation:(NSString *)operation + description:(nullable NSString *)description + NS_SWIFT_NAME(startChild(operation:description:)); + +/** + * Sets an extra. + */ +- (void)setDataValue:(nullable id)value + forKey:(NSString *)key NS_SWIFT_NAME(setExtra(value:key:)); + +/** + * Finishes the span by setting the end time. + */ +- (void)finish; + +/** + * Finishes the span by setting the end time and span status. + * + * @param status The status of this span + * */ +- (void)finishWithStatus:(SentrySpanStatus)status NS_SWIFT_NAME(finish(status:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentrySpanStatus.h b/Source/Sentry.framework/Versions/A/Headers/SentrySpanStatus.h new file mode 100644 index 0000000..6dd8a7b --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentrySpanStatus.h @@ -0,0 +1,103 @@ +#import + +/** + * Describes the status of the Span/Transaction. + */ +typedef NS_ENUM(NSUInteger, SentrySpanStatus) { + /** + * An undefined status. + */ + kSentrySpanStatusUndefined, + + /** + * Not an error, returned on success. + */ + kSentrySpanStatusOk, + + /** + * The deadline expired before the operation could succeed. + */ + kSentrySpanStatusDeadlineExceeded, + + /** + * The requester doesn't have valid authentication credentials for the operation. + */ + kSentrySpanStatusUnauthenticated, + + /** + * The caller doesn't have permission to execute the specified operation. + */ + kSentrySpanStatusPermissionDenied, + + /** + * Content was not found or request was denied for an entire class of users. + */ + kSentrySpanStatusNotFound, + + /** + * The resource has been exhausted e.g. per-user quota exhausted, file system out of space. + */ + kSentrySpanStatusResourceExhausted, + + /** + * The client specified an invalid argument. + */ + kSentrySpanStatusInvalidArgument, + + /** + * 501 Not Implemented. + */ + kSentrySpanStatusUnimplemented, + + /** + * The operation is not implemented or is not supported/enabled for this operation. + */ + kSentrySpanStatusUnavailable, + + /** + * Some invariants expected by the underlying system have been broken. This code is reserved for + * serious errors. + */ + kSentrySpanStatusInternalError, + + /** + * An unknown error raised by APIs that don't return enough error information. + */ + kSentrySpanStatusUnknownError, + + /** + * The operation was cancelled, typically by the caller. + */ + kSentrySpanStatusCancelled, + + /** + * The entity attempted to be created already exists. + */ + kSentrySpanStatusAlreadyExists, + + /** + * The client shouldn't retry until the system state has been explicitly handled. + */ + kSentrySpanStatusFailedPrecondition, + + /** + * The operation was aborted. + */ + kSentrySpanStatusAborted, + + /** + * The operation was attempted past the valid range e.g. seeking past the end of a file. + */ + kSentrySpanStatusOutOfRange, + + /** + * Unrecoverable data loss or corruption. + */ + kSentrySpanStatusDataLoss, +}; + +static NSString *_Nonnull const SentrySpanStatusNames[] + = { @"undefined", @"ok", @"deadline_exceeded", @"unauthenticated", @"permission_denied", + @"not_found", @"resource_exhausted", @"invalid_argument", @"unimplemented", + @"unavailable", @"internal_error", @"unknown_error", @"cancelled", @"already_exists", + @"failed_precondition", @"aborted", @"out_of_range", @"data_loss" }; diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryTransactionContext.h b/Source/Sentry.framework/Versions/A/Headers/SentryTransactionContext.h new file mode 100644 index 0000000..1dabf41 --- /dev/null +++ b/Source/Sentry.framework/Versions/A/Headers/SentryTransactionContext.h @@ -0,0 +1,67 @@ +#import "SentrySampleDecision.h" +#import "SentrySpanContext.h" + +NS_ASSUME_NONNULL_BEGIN + +@class SentrySpanId; + +NS_SWIFT_NAME(TransactionContext) +@interface SentryTransactionContext : SentrySpanContext +SENTRY_NO_INIT + +/** + * Transaction name + */ +@property (nonatomic, readonly) NSString *name; + +/** + * Parent sampled + */ +@property (nonatomic) SentrySampleDecision parentSampled; + +/** + * Init a SentryTransactionContext with given name and set other fields by default + * + * @param name Transaction name + * @param operation The operation this span is measuring. + * + * @return SentryTransactionContext + */ +- (instancetype)initWithName:(NSString *)name operation:(NSString *)operation; + +/** + * Init a SentryTransactionContext with given name and set other fields by default + * + * @param name Transaction name + * @param operation The operation this span is measuring. + * @param sampled Determines whether the trace should be sampled. + * + * @return SentryTransactionContext + */ +- (instancetype)initWithName:(NSString *)name + operation:(NSString *)operation + sampled:(SentrySampleDecision)sampled; + +/** + * Init a SentryTransactionContext with given name, traceId, SpanId, parentSpanId and whether the + * parent is sampled. + * + * @param name Transaction name + * @param operation The operation this span is measuring. + * @param traceId Trace Id + * @param spanId Span Id + * @param parentSpanId Parent span id + * @param parentSampled Whether the parent is sampled + * + * @return SentryTransactionContext + */ +- (instancetype)initWithName:(NSString *)name + operation:(NSString *)operation + traceId:(SentryId *)traceId + spanId:(SentrySpanId *)spanId + parentSpanId:(nullable SentrySpanId *)parentSpanId + parentSampled:(SentrySampleDecision)parentSampled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/Headers/SentryUser.h b/Source/Sentry.framework/Versions/A/Headers/SentryUser.h index 15244e2..ed5503b 100644 --- a/Source/Sentry.framework/Versions/A/Headers/SentryUser.h +++ b/Source/Sentry.framework/Versions/A/Headers/SentryUser.h @@ -9,27 +9,27 @@ NS_SWIFT_NAME(User) /** * Optional: Id of the user */ -@property (nonatomic, copy) NSString *userId; +@property (atomic, copy) NSString *userId; /** * Optional: Email of the user */ -@property (nonatomic, copy) NSString *_Nullable email; +@property (atomic, copy) NSString *_Nullable email; /** * Optional: Username */ -@property (nonatomic, copy) NSString *_Nullable username; +@property (atomic, copy) NSString *_Nullable username; /** * Optional: IP Address */ -@property (nonatomic, copy) NSString *_Nullable ipAddress; +@property (atomic, copy) NSString *_Nullable ipAddress; /** * Optional: Additional data */ -@property (nonatomic, strong) NSDictionary *_Nullable data; +@property (atomic, strong) NSDictionary *_Nullable data; /** * Initializes a SentryUser with the id diff --git a/Source/Sentry.framework/Versions/A/PrivateHeaders/NSString+SentryUnsignedLongLongValue.h b/Source/Sentry.framework/Versions/A/PrivateHeaders/NSString+SentryUnsignedLongLongValue.h deleted file mode 100644 index b9d2d6c..0000000 --- a/Source/Sentry.framework/Versions/A/PrivateHeaders/NSString+SentryUnsignedLongLongValue.h +++ /dev/null @@ -1,9 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSString (SentryUnsignedLongLongValue) -- (unsigned long long)unsignedLongLongValue; -@end - -NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashInstallationReporter.h b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashInstallationReporter.h index fa0cc07..b99b01e 100644 --- a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashInstallationReporter.h +++ b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashInstallationReporter.h @@ -1,10 +1,19 @@ -#import - #import "SentryCrash.h" #import "SentryCrashInstallation.h" +#import "SentryDefines.h" +#import + +@class SentryFrameInAppLogic; + +NS_ASSUME_NONNULL_BEGIN @interface SentryCrashInstallationReporter : SentryCrashInstallation +SENTRY_NO_INIT + +- (instancetype)initWithFrameInAppLogic:(SentryFrameInAppLogic *)frameInAppLogic; - (void)sendAllReports; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportConverter.h b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportConverter.h index 58e4698..2f6de1e 100644 --- a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportConverter.h +++ b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportConverter.h @@ -1,6 +1,6 @@ #import -@class SentryEvent; +@class SentryEvent, SentryFrameInAppLogic; NS_ASSUME_NONNULL_BEGIN @@ -8,7 +8,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) NSDictionary *userContext; -- (instancetype)initWithReport:(NSDictionary *)report; +- (instancetype)initWithReport:(NSDictionary *)report + frameInAppLogic:(SentryFrameInAppLogic *)frameInAppLogic; /** * Converts the report to an SentryEvent. diff --git a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportSink.h b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportSink.h index 51cf239..05521b9 100644 --- a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportSink.h +++ b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryCrashReportSink.h @@ -1,7 +1,16 @@ +#import "SentryCrash.h" +#import "SentryDefines.h" #import -#import "SentryCrash.h" +@class SentryFrameInAppLogic; + +NS_ASSUME_NONNULL_BEGIN @interface SentryCrashReportSink : NSObject +SENTRY_NO_INIT + +- (instancetype)initWithFrameInAppLogic:(SentryFrameInAppLogic *)frameInAppLogic; @end + +NS_ASSUME_NONNULL_END diff --git a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryLog.h b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryLog.h index b4113f2..0111103 100644 --- a/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryLog.h +++ b/Source/Sentry.framework/Versions/A/PrivateHeaders/SentryLog.h @@ -1,12 +1,16 @@ +#import "SentryDefines.h" #import -#import "SentryDefines.h" +@class SentryLogOutput; NS_ASSUME_NONNULL_BEGIN @interface SentryLog : NSObject +SENTRY_NO_INIT + ++ (void)configure:(BOOL)debug diagnosticLevel:(SentryLevel)level; -+ (void)logWithMessage:(NSString *)message andLevel:(SentryLogLevel)level; ++ (void)logWithMessage:(NSString *)message andLevel:(SentryLevel)level; @end diff --git a/Source/Sentry.framework/Versions/A/Resources/Info.plist b/Source/Sentry.framework/Versions/A/Resources/Info.plist index 650f9a1..dad25ef 100644 --- a/Source/Sentry.framework/Versions/A/Resources/Info.plist +++ b/Source/Sentry.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 19H15 + 19H1217 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,29 +17,29 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.0.9 + 7.1.3 CFBundleSupportedPlatforms MacOSX CFBundleVersion - 6.0.9 + 7.1.3 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 12A7300 + 12D4e DTPlatformName macosx DTPlatformVersion - 10.15.6 + 11.1 DTSDKBuild - 19G68 + 20C63 DTSDKName - macosx10.15 + macosx11.1 DTXcode - 1201 + 1240 DTXcodeBuild - 12A7300 + 12D4e LSMinimumSystemVersion 10.10 diff --git a/Source/Sentry.framework/Versions/A/Sentry b/Source/Sentry.framework/Versions/A/Sentry index b29996a..10e50fa 100755 Binary files a/Source/Sentry.framework/Versions/A/Sentry and b/Source/Sentry.framework/Versions/A/Sentry differ diff --git a/Source/Tincta.xcodeproj/project.pbxproj b/Source/Tincta.xcodeproj/project.pbxproj index 2906268..f35a68e 100755 --- a/Source/Tincta.xcodeproj/project.pbxproj +++ b/Source/Tincta.xcodeproj/project.pbxproj @@ -823,8 +823,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CODE_SIGN_IDENTITY = "Apple Development"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 4102; + CURRENT_PROJECT_VERSION = 4110; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3UAW763979; ENABLE_HARDENED_RUNTIME = YES; @@ -848,13 +847,12 @@ "\"$(SDKROOT)/usr/lib/system\"", ); LLVM_LTO = YES_THIN; - MACOSX_DEPLOYMENT_TARGET = 10.8; - MARKETING_VERSION = 4.1; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.1.1; PRODUCT_BUNDLE_IDENTIFIER = "com.mrFridge.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Tincta; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Tincta/Tincta AppStore-Bridging-Header.h"; - VALID_ARCHS = x86_64; WRAPPER_EXTENSION = app; }; name = Debug; @@ -867,8 +865,7 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CODE_SIGN_IDENTITY = "Apple Development"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 4102; + CURRENT_PROJECT_VERSION = 4110; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 3UAW763979; ENABLE_HARDENED_RUNTIME = YES; @@ -891,14 +888,12 @@ "\"$(SDKROOT)/usr/lib/system\"", ); LLVM_LTO = YES_THIN; - MACOSX_DEPLOYMENT_TARGET = 10.8; - MARKETING_VERSION = 4.1; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.1.1; PRODUCT_BUNDLE_IDENTIFIER = "com.mrFridge.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Tincta; - PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Tincta/Tincta AppStore-Bridging-Header.h"; - VALID_ARCHS = x86_64; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/Source/Tincta/MainMenu.xib b/Source/Tincta/MainMenu.xib index 3e571a7..93cf8a8 100644 --- a/Source/Tincta/MainMenu.xib +++ b/Source/Tincta/MainMenu.xib @@ -1,8 +1,8 @@ - + - - + + @@ -467,7 +467,7 @@ - + @@ -569,7 +569,7 @@ - + @@ -592,11 +592,11 @@ - +