diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96ec6b864..37ab17643 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,13 +3,74 @@ name: package-plugin-workflow on: [push] jobs: + android-sdk: + uses: ./.github/workflows/sdk.yml + with: + target: Android + runsOn: ubuntu-latest + + ios-sdk: + uses: ./.github/workflows/sdk.yml + with: + target: IOS + runsOn: macos-latest + + macos-sdk: + uses: ./.github/workflows/sdk.yml + with: + target: Mac + runsOn: macos-latest + + linux-sdk: + uses: ./.github/workflows/sdk.yml + with: + target: Linux + runsOn: ubuntu-latest + + windows-sdk: + uses: ./.github/workflows/sdk.yml + with: + target: Win64 + runsOn: windows-latest + build: - name: Build + needs: [android-sdk, ios-sdk, macos-sdk, linux-sdk, windows-sdk] + name: Package runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + - uses: actions/download-artifact@v2 + with: + name: Android-sdk + path: plugin-dev/Source/ThirdParty/Android + + - uses: actions/download-artifact@v2 + with: + name: Android-libraries + path: modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib + + - uses: actions/download-artifact@v2 + with: + name: IOS-sdk + path: plugin-dev/Source/ThirdParty/IOS + + - uses: actions/download-artifact@v2 + with: + name: Mac-sdk + path: plugin-dev/Source/ThirdParty/Mac + + - uses: actions/download-artifact@v2 + with: + name: Linux-sdk + path: plugin-dev/Source/ThirdParty/Linux + + - uses: actions/download-artifact@v2 + with: + name: Win64-sdk + path: plugin-dev/Source/ThirdParty/Win64 + - name: Prepare Sentry packages for release shell: pwsh run: ./scripts/packaging/pack.ps1 @@ -27,7 +88,7 @@ jobs: package-validation: needs: [build] - name: Validate package against snapshot + name: Check snapshot runs-on: ubuntu-latest steps: - name: Checkout @@ -50,7 +111,7 @@ jobs: test-ue-packaging: name: Test UE ${{ matrix.unreal }} packaging runs-on: ubuntu-latest - needs: [build] + needs: [build, package-validation] strategy: fail-fast: false diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml new file mode 100644 index 000000000..74c8758a3 --- /dev/null +++ b/.github/workflows/sdk.yml @@ -0,0 +1,70 @@ +on: + workflow_call: + inputs: + runsOn: + required: true + type: string + target: + required: true + type: string + +jobs: + build: + runs-on: ${{ inputs.runsOn }} + timeout-minutes: 30 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + + - name: Select submodule + id: env + run: | + if [[ "${{ inputs.target }}" == "Android" ]]; then + submodule="modules/sentry-java" + elif [[ "${{ inputs.target }}" == "IOS" ]]; then + submodule="modules/sentry-cocoa" + else + submodule="modules/sentry-native" + fi + echo "::set-output name=submodule::$submodule" + echo "::set-output name=path::plugin-dev/Source/ThirdParty/${{ inputs.target }}" + echo "::set-output name=buildScript::scripts/build-$(echo '${{ inputs.target }}' | tr '[:upper:]' '[:lower:]').sh" + + - name: Get submodule status + run: git submodule status --cached ${{ steps.env.outputs.submodule }} | tee submodule-status + + - uses: actions/cache@v2 + id: cache + with: + path: | + ${{ steps.env.outputs.path }} + modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib + key: sdk=${{ inputs.target }}-${{ hashFiles('submodule-status', 'scripts/build-*.sh', '.github/workflows/sdk.yml') }} + + - name: Install Linux Dependencies + if: ${{ inputs.target == 'Linux' && steps.cache.outputs.cache-hit != 'true' }} + run: | + sudo apt-get update + sudo apt-get install zlib1g-dev libcurl4-openssl-dev libssl-dev + + - name: Build + if: steps.cache.outputs.cache-hit != 'true' + run: | + git submodule update --init --recursive ${{ steps.env.outputs.submodule }} + mkdir -p '${{ steps.env.outputs.path }}' + ${{ steps.env.outputs.buildScript }} '${{ steps.env.outputs.submodule }}' '${{ steps.env.outputs.path }}' + + - uses: actions/upload-artifact@v2 + with: + name: ${{ inputs.target }}-sdk + path: ${{ steps.env.outputs.path }} + retention-days: ${{ github.ref_name == 'main' && 14 || 1 }} + + - uses: actions/upload-artifact@v2 + if: ${{ inputs.target == 'Android' }} + with: + name: ${{ inputs.target }}-libraries + path: modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib/* + retention-days: 1 diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 09352f682..f64a8f2e0 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -10,31 +10,11 @@ on: - main jobs: - - native-linux: - uses: getsentry/github-workflows/.github/workflows/updater.yml@v1 - with: - path: scripts/update-native-linux.sh - name: Native SDK (Linux) - runs-on: ubuntu-latest - secrets: - api_token: ${{ secrets.CI_DEPLOY_KEY }} - - native-windows: - uses: getsentry/github-workflows/.github/workflows/updater.yml@v1 - with: - path: scripts/update-native-windows.ps1 - name: Native SDK (Windows) - runs-on: windows-latest - secrets: - api_token: ${{ secrets.CI_DEPLOY_KEY }} - - native-mac: + native: uses: getsentry/github-workflows/.github/workflows/updater.yml@v1 with: - path: scripts/update-native-mac.sh - name: Native SDK (Mac) - runs-on: macos-latest + path: modules/sentry-native + name: Native SDK secrets: api_token: ${{ secrets.CI_DEPLOY_KEY }} @@ -43,15 +23,13 @@ jobs: with: path: scripts/update-java.sh name: Java SDK (Android) - runs-on: ubuntu-latest secrets: api_token: ${{ secrets.CI_DEPLOY_KEY }} cocoa: uses: getsentry/github-workflows/.github/workflows/updater.yml@v1 with: - path: scripts/update-cocoa.sh + path: modules/sentry-cocoa name: Cocoa SDK (iOS) - runs-on: macos-latest secrets: api_token: ${{ secrets.CI_DEPLOY_KEY }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7090c518e..63c82c9ed 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ Intermediate/* # Ignore package release package-release/ sentry-unreal-*.zip + +# Prebuilt libraries & artifacts are collected in CI +plugin-dev/Source/ThirdParty diff --git a/plugin-dev/Source/ThirdParty/Android/sentry-android-core-release.aar b/plugin-dev/Source/ThirdParty/Android/sentry-android-core-release.aar deleted file mode 100644 index da6798238..000000000 Binary files a/plugin-dev/Source/ThirdParty/Android/sentry-android-core-release.aar and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Android/sentry-android-ndk-release.aar b/plugin-dev/Source/ThirdParty/Android/sentry-android-ndk-release.aar deleted file mode 100644 index 599edd993..000000000 Binary files a/plugin-dev/Source/ThirdParty/Android/sentry-android-ndk-release.aar and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Android/sentry.jar b/plugin-dev/Source/ThirdParty/Android/sentry.jar deleted file mode 100644 index 39dcc712d..000000000 Binary files a/plugin-dev/Source/ThirdParty/Android/sentry.jar and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.embeddedframework.zip b/plugin-dev/Source/ThirdParty/IOS/Sentry.embeddedframework.zip deleted file mode 100644 index c3ecbbf49..000000000 Binary files a/plugin-dev/Source/ThirdParty/IOS/Sentry.embeddedframework.zip and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/PrivateSentrySDKOnly.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/PrivateSentrySDKOnly.h deleted file mode 100644 index 234192ca2..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/PrivateSentrySDKOnly.h +++ /dev/null @@ -1,82 +0,0 @@ -#import - -#import "SentryDefines.h" - -@class SentryEnvelope, SentryDebugMeta, SentryAppStartMeasurement, SentryScreenFrames, - SentryOptions; - -NS_ASSUME_NONNULL_BEGIN - -/** - * A callback to be notified when the AppStartMeasurement is available. - */ -typedef void (^SentryOnAppStartMeasurementAvailable)( - SentryAppStartMeasurement *_Nullable appStartMeasurement); - -/** - * 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 - * know. - * - * 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; - -/** - * Override SDK information. - */ -+ (void)setSdkName:(NSString *)sdkName andVersionString:(NSString *)versionString; - -@property (class, nullable, nonatomic, copy) - SentryOnAppStartMeasurementAvailable onAppStartMeasurementAvailable; - -@property (class, nullable, nonatomic, readonly) SentryAppStartMeasurement *appStartMeasurement; - -@property (class, nonatomic, readonly, copy) NSString *installationID; - -@property (class, nonatomic, readonly, copy) SentryOptions *options; - -/** - * If enabled, the SDK won't send the app start measurement with the first transaction. Instead, if - * enableAutoPerformanceTracking is enabled, the SDK measures the app start and then calls - * onAppStartMeasurementAvailable. Furthermore, the SDK doesn't set all values for the app start - * measurement because the HybridSDKs initialize the Cocoa SDK too late to receive all - * notifications. Instead, the SDK sets the appStartDuration to 0 and the - * didFinishLaunchingTimestamp to timeIntervalSinceReferenceDate. Default is NO. - */ -@property (class, nonatomic, assign) BOOL appStartMeasurementHybridSDKMode; - -#if SENTRY_HAS_UIKIT -/** - * Allows hybrid SDKs to enable frame tracking measurements despite other options. - */ -@property (class, nonatomic, assign) BOOL framesTrackingMeasurementHybridSDKMode; - -@property (class, nonatomic, assign, readonly) BOOL isFramesTrackingRunning; - -@property (class, nonatomic, assign, readonly) SentryScreenFrames *currentScreenFrames; -#endif - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/Sentry.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/Sentry.h deleted file mode 100644 index 8fb987874..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/Sentry.h +++ /dev/null @@ -1,50 +0,0 @@ -#import - -//! Project version number for Sentry. -FOUNDATION_EXPORT double SentryVersionNumber; - -//! Project version string for Sentry. -FOUNDATION_EXPORT const unsigned char SentryVersionString[]; - -#import "PrivateSentrySDKOnly.h" -#import "SentryAppStartMeasurement.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" -#import "SentryEnvelope.h" -#import "SentryEnvelopeItemType.h" -#import "SentryError.h" -#import "SentryEvent.h" -#import "SentryException.h" -#import "SentryFrame.h" -#import "SentryHub.h" -#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 "SentryScreenFrames.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 "SentryTraceHeader.h" -#import "SentryTransactionContext.h" -#import "SentryUser.h" -#import "SentryUserFeedback.h" diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAppStartMeasurement.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAppStartMeasurement.h deleted file mode 100644 index 02b0a5a74..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAppStartMeasurement.h +++ /dev/null @@ -1,69 +0,0 @@ -#import "SentryDefines.h" - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSUInteger, SentryAppStartType) { - SentryAppStartTypeWarm, - SentryAppStartTypeCold, - SentryAppStartTypeUnknown, -}; - -@interface SentryAppStartMeasurement : NSObject -SENTRY_NO_INIT - -/** - * Initializes SentryAppStartMeasurement with the given parameters. - */ -- (instancetype)initWithType:(SentryAppStartType)type - appStartTimestamp:(NSDate *)appStartTimestamp - duration:(NSTimeInterval)duration - runtimeInitTimestamp:(NSDate *)runtimeInitTimestamp - didFinishLaunchingTimestamp:(NSDate *)didFinishLaunchingTimestamp - DEPRECATED_MSG_ATTRIBUTE("Use " - "initWithType:appStartTimestamp:duration:mainTimestamp:" - "runtimeInitTimestamp:didFinishLaunchingTimestamp instead."); - -/** - * Initializes SentryAppStartMeasurement with the given parameters. - */ -- (instancetype)initWithType:(SentryAppStartType)type - appStartTimestamp:(NSDate *)appStartTimestamp - duration:(NSTimeInterval)duration - runtimeInitTimestamp:(NSDate *)runtimeInitTimestamp - moduleInitializationTimestamp:(NSDate *)moduleInitializationTimestamp - didFinishLaunchingTimestamp:(NSDate *)didFinishLaunchingTimestamp; - -/** - * The type of the app start. - */ -@property (readonly, nonatomic, assign) SentryAppStartType type; - -/** - * How long the app start took. From appStartTimestamp to when the SDK creates the - * AppStartMeasurement, which is done when the OS posts UIWindowDidBecomeVisibleNotification. - */ -@property (readonly, nonatomic, assign) NSTimeInterval duration; - -/** - * The timestamp when the app started, which is is the proces start timestamp. - */ -@property (readonly, nonatomic, strong) NSDate *appStartTimestamp; - -/** - * When the runtime was initialized / when SentryAppStartTracker is added to the Objective-C runtime - */ -@property (readonly, nonatomic, strong) NSDate *runtimeInitTimestamp; - -/** - * When application main function is called. - */ -@property (readonly, nonatomic, strong) NSDate *moduleInitializationTimestamp; - -/** - * When OS posts UIApplicationDidFinishLaunchingNotification. - */ -@property (readonly, nonatomic, strong) NSDate *didFinishLaunchingTimestamp; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAttachment.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAttachment.h deleted file mode 100644 index 6a834143d..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryAttachment.h +++ /dev/null @@ -1,90 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryBreadcrumb.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryBreadcrumb.h deleted file mode 100644 index 0fa5034f6..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryBreadcrumb.h +++ /dev/null @@ -1,63 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(Breadcrumb) -@interface SentryBreadcrumb : NSObject - -/** - * Level of breadcrumb - */ -@property (nonatomic) SentryLevel level; - -/** - * Category of bookmark, can be any string - */ -@property (nonatomic, copy) NSString *category; - -/** - * NSDate when the breadcrumb happened - */ -@property (nonatomic, strong) NSDate *_Nullable timestamp; - -/** - * Type of breadcrumb, can be e.g.: http, empty, user, navigation - * This will be used as icon of the breadcrumb - */ -@property (nonatomic, copy) NSString *_Nullable type; - -/** - * Message for the breadcrumb - */ -@property (nonatomic, copy) NSString *_Nullable message; - -/** - * Arbitrary additional data that will be sent with the breadcrumb - */ -@property (nonatomic, strong) NSDictionary *_Nullable data; - -/** - * Initializer for SentryBreadcrumb - * - * @param level SentryLevel - * @param category String - * @return SentryBreadcrumb - */ -- (instancetype)initWithLevel:(SentryLevel)level category:(NSString *)category; -- (instancetype)init; -+ (instancetype)new NS_UNAVAILABLE; - -- (NSDictionary *)serialize; - -- (BOOL)isEqual:(id _Nullable)other; - -- (BOOL)isEqualToBreadcrumb:(SentryBreadcrumb *)breadcrumb; - -- (NSUInteger)hash; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryClient.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryClient.h deleted file mode 100644 index c60997fc0..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryClient.h +++ /dev/null @@ -1,118 +0,0 @@ -#import - -#import "SentryDefines.h" - -@class SentryOptions, SentrySession, SentryEvent, SentryEnvelope, SentryScope, SentryFileManager, - SentryId, SentryUserFeedback, SentryTransaction; - -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(Client) -@interface SentryClient : NSObject -SENTRY_NO_INIT - -@property (nonatomic, strong) SentryOptions *options; - -/** - * Initializes a SentryClient. Pass in an dictionary of options. - * - * @param options Options dictionary - * @return SentryClient - */ -- (_Nullable instancetype)initWithOptions:(SentryOptions *)options; - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureEvent:(SentryEvent *)event NS_SWIFT_NAME(capture(event:)); - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureEvent:(SentryEvent *)event - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(event:scope:)); - -/** - * Captures an error event and sends it to Sentry. - * - * @param error The error to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureError:(NSError *)error NS_SWIFT_NAME(capture(error:)); - -/** - * Captures an error event and sends it to Sentry. - * - * @param error The error to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureError:(NSError *)error - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(error:scope:)); - -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureException:(NSException *)exception NS_SWIFT_NAME(capture(exception:)); - -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureException:(NSException *)exception - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(exception:scope:)); - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureMessage:(NSString *)message NS_SWIFT_NAME(capture(message:)); - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureMessage:(NSString *)message - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(message:scope:)); - -/** - * Captures a manually created user feedback and sends it to Sentry. - * - * @param userFeedback The user feedback to send to Sentry. - */ -- (void)captureUserFeedback:(SentryUserFeedback *)userFeedback - NS_SWIFT_NAME(capture(userFeedback:)); - -- (void)captureSession:(SentrySession *)session NS_SWIFT_NAME(capture(session:)); - -- (void)captureEnvelope:(SentryEnvelope *)envelope NS_SWIFT_NAME(capture(envelope:)); - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryCrashExceptionApplication.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryCrashExceptionApplication.h deleted file mode 100644 index c70ecaf87..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryCrashExceptionApplication.h +++ /dev/null @@ -1,14 +0,0 @@ -// Don't move Foundation.h. We need it here in order to have -// TargetConditionals.h automatically imported. This is needed -// so that `#if TARGET_OS_OSX` is working fine. If we move -// this the SDK breaks for MacOS. -#import - -#if TARGET_OS_OSX -# import -@interface SentryCrashExceptionApplication : NSApplication -#else -@interface SentryCrashExceptionApplication : NSObject -#endif - -@end diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugImageProvider.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugImageProvider.h deleted file mode 100644 index 249c711ec..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugImageProvider.h +++ /dev/null @@ -1,30 +0,0 @@ -#import "SentryDefines.h" -#import - -@class SentryDebugMeta, SentryThread; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Reserved for hybrid SDKs that the debug image list for symbolication. - */ -@interface SentryDebugImageProvider : NSObject - -- (instancetype)init; - -/** - * Returns a list of debug images that are being referenced in the given threads. - * - * @param threads A list of SentryThread that may or may not contains a stacktrace. - */ -- (NSArray *)getDebugImagesForThreads:(NSArray *)threads; - -/** - * 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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugMeta.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugMeta.h deleted file mode 100644 index 40a2186f4..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDebugMeta.h +++ /dev/null @@ -1,52 +0,0 @@ -#import - -#import "SentrySerializable.h" - -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 - -/** - * UUID of image - */ -@property (nonatomic, copy) NSString *_Nullable uuid; - -/** - * Type of debug meta, mostly just apple - */ -@property (nonatomic, copy) NSString *_Nullable type; - -/** - * Name of the image - */ -@property (nonatomic, copy) NSString *_Nullable name; - -/** - * Image size - */ -@property (nonatomic, copy) NSNumber *_Nullable imageSize; - -/** - * Image address - */ -@property (nonatomic, copy) NSString *_Nullable imageAddress; - -/** - * Image vm address - */ -@property (nonatomic, copy) NSString *_Nullable imageVmAddress; - -- (instancetype)init; -+ (instancetype)new NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDefines.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDefines.h deleted file mode 100644 index 6f39d85c4..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDefines.h +++ /dev/null @@ -1,120 +0,0 @@ -#import - -#ifdef __cplusplus -# define SENTRY_EXTERN extern "C" __attribute__((visibility("default"))) -#else -# define SENTRY_EXTERN extern __attribute__((visibility("default"))) -#endif - -#if TARGET_OS_IOS || TARGET_OS_TV -# define SENTRY_HAS_UIDEVICE 1 -#else -# define SENTRY_HAS_UIDEVICE 0 -#endif - -#if SENTRY_HAS_UIDEVICE -# define SENTRY_HAS_UIKIT 1 -#else -# define SENTRY_HAS_UIKIT 0 -#endif - -#define SENTRY_NO_INIT \ - -(instancetype)init NS_UNAVAILABLE; \ - +(instancetype) new NS_UNAVAILABLE; - -@class SentryEvent, SentryBreadcrumb, SentrySamplingContext; -@protocol SentrySpan; - -/** - * Block used for returning after a request finished - */ -typedef void (^SentryRequestFinished)(NSError *_Nullable error); - -/** - * Block used for request operation finished, shouldDiscardEvent is YES if event - * should be deleted regardless if an error ocured or not - */ -typedef void (^SentryRequestOperationFinished)( - NSHTTPURLResponse *_Nullable response, NSError *_Nullable error); -/** - * Block can be used to mutate a breadcrumb before it's added to the scope. - * To avoid adding the breadcrumb altogether, return nil instead. - */ -typedef SentryBreadcrumb *_Nullable (^SentryBeforeBreadcrumbCallback)( - SentryBreadcrumb *_Nonnull breadcrumb); - -/** - * Block can be used to mutate event before its send. - * To avoid sending the event altogether, return nil instead. - */ -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 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 - */ -typedef NS_ENUM(NSInteger, SentryLogLevel) { - kSentryLogLevelNone = 1, - kSentryLogLevelError, - kSentryLogLevelDebug, - kSentryLogLevelVerbose -}; - -/** - * Sentry level - */ -typedef NS_ENUM(NSUInteger, SentryLevel) { - // Defaults to None which doesn't get serialized - kSentryLevelNone = 0, - // Goes from Debug to Fatal so possible to: (level > Info) { .. } - kSentryLevelDebug = 1, - kSentryLevelInfo = 2, - kSentryLevelWarning = 3, - kSentryLevelError = 4, - kSentryLevelFatal = 5 -}; - -/** - * Static internal helper to convert enum to string - */ -static NSString *_Nonnull const SentryLevelNames[] = { - @"none", - @"debug", - @"info", - @"warning", - @"error", - @"fatal", -}; - -static NSUInteger const defaultMaxBreadcrumbs = 100; diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDsn.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDsn.h deleted file mode 100644 index 1b48571b3..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryDsn.h +++ /dev/null @@ -1,19 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryDsn : NSObject - -@property (nonatomic, strong, readonly) NSURL *url; - -- (_Nullable instancetype)initWithString:(NSString *)dsnString - didFailWithError:(NSError *_Nullable *_Nullable)error; - -- (NSString *)getHash; - -- (NSURL *)getStoreEndpoint; -- (NSURL *)getEnvelopeEndpoint; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelope.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelope.h deleted file mode 100644 index e99f59447..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelope.h +++ /dev/null @@ -1,151 +0,0 @@ -#import - -#import "SentryDefines.h" - -@class SentryEvent, SentrySession, SentrySdkInfo, SentryId, SentryUserFeedback, SentryAttachment, - SentryTransaction, SentryTraceContext, SentryClientReport; - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryEnvelopeHeader : NSObject -SENTRY_NO_INIT - -/** - * Initializes an SentryEnvelopeHeader object with the specified eventId. - * - * Sets the sdkInfo from SentryMeta. - * - * @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment - * related to event. - */ -- (instancetype)initWithId:(SentryId *_Nullable)eventId; - -/** - * Initializes an SentryEnvelopeHeader object with the specified eventId and traceContext. - * - * @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment - * related to event. - * @param traceContext Current trace state. - */ -- (instancetype)initWithId:(nullable SentryId *)eventId - traceContext:(nullable SentryTraceContext *)traceContext; - -/** - * Initializes an SentryEnvelopeHeader object with the specified eventId, skdInfo and traceContext. - * - * It is recommended to use initWithId:traceContext: because it sets the sdkInfo for you. - * - * @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment - * related to event. - * @param sdkInfo sdkInfo Describes the Sentry SDK. Can be nil for backwards compatibility. New - * instances should always provide a version. - * @param traceContext Current trace state. - */ -- (instancetype)initWithId:(nullable SentryId *)eventId - sdkInfo:(nullable SentrySdkInfo *)sdkInfo - traceContext:(nullable SentryTraceContext *)traceContext NS_DESIGNATED_INITIALIZER; - -/** - * The event identifier, if available. - * An event id exist if the envelope contains an event of items within it are - * related. i.e Attachments - */ -@property (nullable, nonatomic, readonly, copy) SentryId *eventId; - -@property (nullable, nonatomic, readonly, copy) SentrySdkInfo *sdkInfo; - -@property (nullable, nonatomic, readonly, copy) SentryTraceContext *traceContext; - -@end - -@interface SentryEnvelopeItemHeader : NSObject -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 - -@interface SentryEnvelopeItem : NSObject -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; - -/** - * The envelope item header. - */ -@property (nonatomic, readonly, strong) SentryEnvelopeItemHeader *header; - -/** - * The envelope payload. - */ -@property (nonatomic, readonly, strong) NSData *data; - -@end - -@interface SentryEnvelope : NSObject -SENTRY_NO_INIT - -// If no event, or no data related to event, id will be null -- (instancetype)initWithId:(SentryId *_Nullable)id singleItem:(SentryEnvelopeItem *)item; - -- (instancetype)initWithHeader:(SentryEnvelopeHeader *)header singleItem:(SentryEnvelopeItem *)item; - -// If no event, or no data related to event, id will be null -- (instancetype)initWithId:(SentryId *_Nullable)id items:(NSArray *)items; - -/** - * Initializes a SentryEnvelope with a single session. - * @param session to init the envelope with. - * @return an initialized SentryEnvelope - */ -- (instancetype)initWithSession:(SentrySession *)session; - -/** - * Initializes a SentryEnvelope with a list of sessions. - * Can be used when an operations that starts a session closes an ongoing - * session - * @param sessions to init the envelope with. - * @return an initialized SentryEnvelope - */ -- (instancetype)initWithSessions:(NSArray *)sessions; - -- (instancetype)initWithHeader:(SentryEnvelopeHeader *)header - items:(NSArray *)items NS_DESIGNATED_INITIALIZER; - -// Convenience init for a single event -- (instancetype)initWithEvent:(SentryEvent *)event; - -- (instancetype)initWithUserFeedback:(SentryUserFeedback *)userFeedback; - -/** - * The envelope header. - */ -@property (nonatomic, readonly, strong) SentryEnvelopeHeader *header; - -/** - * The envelope items. - */ -@property (nonatomic, readonly, strong) NSArray *items; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelopeItemType.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelopeItemType.h deleted file mode 100644 index d999cfdd4..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEnvelopeItemType.h +++ /dev/null @@ -1,7 +0,0 @@ -static NSString *const SentryEnvelopeItemTypeEvent = @"event"; -static NSString *const SentryEnvelopeItemTypeSession = @"session"; -static NSString *const SentryEnvelopeItemTypeUserFeedback = @"user_report"; -static NSString *const SentryEnvelopeItemTypeTransaction = @"transaction"; -static NSString *const SentryEnvelopeItemTypeAttachment = @"attachment"; -static NSString *const SentryEnvelopeItemTypeClientReport = @"client_report"; -static NSString *const SentryEnvelopeItemTypeProfile = @"profile"; diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryError.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryError.h deleted file mode 100644 index 22b6605dd..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryError.h +++ /dev/null @@ -1,22 +0,0 @@ -#import "SentryDefines.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSInteger, SentryError) { - kSentryErrorUnknownError = -1, - kSentryErrorInvalidDsnError = 100, - kSentryErrorSentryCrashNotInstalledError = 101, - kSentryErrorInvalidCrashReportError = 102, - kSentryErrorCompressionError = 103, - kSentryErrorJsonConversionError = 104, - kSentryErrorCouldNotFindDirectory = 105, - kSentryErrorRequestError = 106, - kSentryErrorEventNotSent = 107, -}; - -SENTRY_EXTERN NSError *_Nullable NSErrorFromSentryError(SentryError error, NSString *description); - -SENTRY_EXTERN NSString *const SentryErrorDomain; - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEvent.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEvent.h deleted file mode 100644 index af49aee34..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryEvent.h +++ /dev/null @@ -1,186 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryThread, SentryException, SentryStacktrace, SentryUser, SentryDebugMeta, SentryContext, - SentryBreadcrumb, SentryId, SentryMessage; - -NS_SWIFT_NAME(Event) -@interface SentryEvent : NSObject - -/** - * This will be set by the initializer. - */ -@property (nonatomic, strong) SentryId *eventId; - -/** - * Message of the event. - */ -@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 *_Nullable timestamp; - -/** - * NSDate of when the event started, mostly useful if event type transaction - */ -@property (nonatomic, strong) NSDate *_Nullable startTimestamp; - -/** - * SentryLevel of the event - */ -@property (nonatomic) enum SentryLevel level; - -/** - * Platform this will be used for symbolicating on the server should be "cocoa" - */ -@property (nonatomic, copy) NSString *platform; - -/** - * Define the logger name - */ -@property (nonatomic, copy) NSString *_Nullable logger; - -/** - * Define the server name - */ -@property (nonatomic, copy) NSString *_Nullable serverName; - -/** - * This property will be filled before the event is sent. - * @warning This is maintained automatically, and shouldn't normally need to be modified. - */ -@property (nonatomic, copy) NSString *_Nullable releaseName; - -/** - * This property will be filled before the event is sent. - * @warning This is maintained automatically, and shouldn't normally need to be modified. - */ -@property (nonatomic, copy) NSString *_Nullable dist; - -/** - * The environment used for this event - */ -@property (nonatomic, copy) NSString *_Nullable environment; - -/** - * The current transaction (state) on the crash - */ -@property (nonatomic, copy) NSString *_Nullable transaction; - -/** - * The type of the event, null, default or transaction - */ -@property (nonatomic, copy) NSString *_Nullable type; - -/** - * Arbitrary key:value (string:string ) data that will be shown with the event - */ -@property (nonatomic, strong) NSDictionary *_Nullable tags; - -/** - * Arbitrary additional information that will be sent with the event - */ -@property (nonatomic, strong) NSDictionary *_Nullable extra; - -/** - * Information about the SDK. For example: - * @code - * { - * version: "6.0.1", - * name: "sentry.cocoa", - * integrations: [ - * "react-native" - * ] - * } - * @endcode - * @warning This is automatically maintained and should not normally need to be modified. - */ -@property (nonatomic, strong) NSDictionary *_Nullable sdk; - -/** - * modules of the event - */ -@property (nonatomic, strong) NSDictionary *_Nullable modules; - -/** - * Set the fingerprint of an event to determine the grouping - */ -@property (nonatomic, strong) NSArray *_Nullable fingerprint; - -/** - * Set the SentryUser for the event - */ -@property (nonatomic, strong) SentryUser *_Nullable user; - -/** - * This object contains meta information. - * @warning This is maintained automatically, and shouldn't normally need to be modified. - */ -@property (nonatomic, strong) - NSDictionary *> *_Nullable context; - -/** - * Contains SentryThread if an crash occurred of it's an user reported exception - */ -@property (nonatomic, strong) NSArray *_Nullable threads; - -/** - * General information about the SentryException, usually there is only one - * exception in the array - */ -@property (nonatomic, strong) NSArray *_Nullable exceptions; - -/** - * Separate SentryStacktrace that can be sent with the event, besides threads - */ -@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; - -/** - * Containing images loaded during runtime - */ -@property (nonatomic, strong) NSArray *_Nullable debugMeta; - -/** - * This contains all breadcrumbs available at the time when the event - * occurred/will be sent - */ -@property (nonatomic, strong) NSArray *_Nullable breadcrumbs; - -/** - * Init an SentryEvent will set all needed fields by default - * @return SentryEvent - */ -- (instancetype)init; - -/** - * Init an SentryEvent will set all needed fields by default - * @param level SentryLevel - * @return SentryEvent - */ -- (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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryException.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryException.h deleted file mode 100644 index 37eac9d84..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryException.h +++ /dev/null @@ -1,54 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryStacktrace, SentryMechanism; - -NS_SWIFT_NAME(Exception) -@interface SentryException : NSObject -SENTRY_NO_INIT - -/** - * The name of the exception - */ -@property (nonatomic, copy) NSString *value; - -/** - * Type of the exception - */ -@property (nonatomic, copy) NSString *type; - -/** - * Additional information about the exception - */ -@property (nonatomic, strong) SentryMechanism *_Nullable mechanism; - -/** - * Can be set to define the module - */ -@property (nonatomic, copy) NSString *_Nullable module; - -/** - * An optional value which refers to a thread in `SentryEvent.threads`. - */ -@property (nonatomic, copy) NSNumber *_Nullable threadId; - -/** - * Stacktrace containing frames of this exception. - */ -@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; - -/** - * Initialize an SentryException with value and type - * @param value String - * @param type String - * @return SentryException - */ -- (instancetype)initWithValue:(NSString *)value type:(NSString *)type; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryFrame.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryFrame.h deleted file mode 100644 index 56b512885..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryFrame.h +++ /dev/null @@ -1,76 +0,0 @@ -#import - -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(Frame) -@interface SentryFrame : NSObject - -/** - * SymbolAddress of the frame - */ -@property (nonatomic, copy) NSString *_Nullable symbolAddress; - -/** - * Filename is used only for reporting JS frames - */ -@property (nonatomic, copy) NSString *_Nullable fileName; - -/** - * Function name of the frame - */ -@property (nonatomic, copy) NSString *_Nullable function; - -/** - * Module of the frame, mostly unused - */ -@property (nonatomic, copy) NSString *_Nullable module; - -/** - * Corresponding package - */ -@property (nonatomic, copy) NSString *_Nullable package; - -/** - * ImageAddress if the image related to the frame - */ -@property (nonatomic, copy) NSString *_Nullable imageAddress; - -/** - * Set the platform for the individual frame, will use platform of the event. - * Mostly used for react native crashes. - */ -@property (nonatomic, copy) NSString *_Nullable platform; - -/** - * InstructionAddress of the frame - */ -@property (nonatomic, copy) NSString *_Nullable instructionAddress; - -/** - * User for react native, will be ignored for cocoa frames - */ -@property (nonatomic, copy) NSNumber *_Nullable lineNumber; - -/** - * User for react native, will be ignored for cocoa frames - */ -@property (nonatomic, copy) NSNumber *_Nullable columnNumber; - -/** - * Determines if the Frame is inApp or not - */ -@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; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryHub.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryHub.h deleted file mode 100644 index 5ea93d446..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryHub.h +++ /dev/null @@ -1,267 +0,0 @@ -#import "SentryDefines.h" -#import "SentryIntegrationProtocol.h" -#import "SentrySpanProtocol.h" - -@class SentryEvent, SentryClient, SentryScope, SentrySession, SentryUser, SentryBreadcrumb, - SentryId, SentryUserFeedback, SentryEnvelope, SentryTransactionContext; - -NS_ASSUME_NONNULL_BEGIN -@interface SentryHub : NSObject -SENTRY_NO_INIT - -- (instancetype)initWithClient:(SentryClient *_Nullable)client - andScope:(SentryScope *_Nullable)scope; - -/** - * 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; - -@property (nonatomic, strong) - NSMutableArray *> *installedIntegrations; - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureEvent:(SentryEvent *)event NS_SWIFT_NAME(capture(event:)); - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (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 SDK should bind the new transaction 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 SDK should bind the new transaction 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 SDK should bind the new transaction 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. - * - * @param error The error to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureError:(NSError *)error NS_SWIFT_NAME(capture(error:)); - -/** - * Captures an error event and sends it to Sentry. - * - * @param error The error to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureError:(NSError *)error - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(error:scope:)); - -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureException:(NSException *)exception NS_SWIFT_NAME(capture(exception:)); - -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureException:(NSException *)exception - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(exception:scope:)); - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureMessage:(NSString *)message NS_SWIFT_NAME(capture(message:)); - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -- (SentryId *)captureMessage:(NSString *)message - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(message:scope:)); - -/** - * Captures a manually created user feedback and sends it to Sentry. - * - * @param userFeedback The user feedback to send to Sentry. - */ -- (void)captureUserFeedback:(SentryUserFeedback *)userFeedback - NS_SWIFT_NAME(capture(userFeedback:)); - -/** - * 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 Scope of the Hub. - * - * @param crumb The Breadcrumb to add to the Scope of the Hub. - */ -- (void)addBreadcrumb:(SentryBreadcrumb *)crumb; - -/** - * Returns a client if there is a bound client on the Hub. - */ -- (SentryClient *_Nullable)getClient; - -/** - * Returns either the current scope and if nil a new one. - */ -@property (nonatomic, readonly, strong) SentryScope *scope; - -/** - * Binds a different client to the hub. - */ -- (void)bindClient:(SentryClient *_Nullable)client; - -/** - * Checks if integration is activated for bound client and returns it. - */ -- (id _Nullable)getIntegration:(NSString *)integrationName; - -/** - * Checks if a specific Integration (`integrationClass`) has been installed. - * - * @return BOOL If instance of `integrationClass` exists within `SentryHub.installedIntegrations`. - */ -- (BOOL)isIntegrationInstalled:(Class)integrationClass; - -/** - * 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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryId.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryId.h deleted file mode 100644 index dba269d2e..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryId.h +++ /dev/null @@ -1,46 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * A wrapper around UUID. - * UUIDs are declared as either 32 character hexadecimal strings without dashes - * "12c2d058d58442709aa2eca08bf20986", or 36 character strings with dashes - * "12c2d058-d584-4270-9aa2-eca08bf20986". It is recommended to omit dashes and use UUID v4 in all - * cases. - */ -@interface SentryId : NSObject - -/** - * Creates a SentryId with a random SentryId. - */ -- (instancetype)init; - -/** - * Creates a SentryId with the given UUID. - */ -- (instancetype)initWithUUID:(NSUUID *)uuid; - -/** - * Creates a SentryId from a 32 character hexadecimal string without dashes such as - * "12c2d058d58442709aa2eca08bf20986" or a 36 character hexadecimal string such as such as - * "12c2d058-d584-4270-9aa2-eca08bf20986". - * - * @return SentryId.empty for invalid strings. - */ -- (instancetype)initWithUUIDString:(NSString *)string; - -/** - * Returns a 32 lowercase character hexadecimal string description of the SentryId, such as - * "12c2d058d58442709aa2eca08bf20986". - */ -@property (readonly, copy) NSString *sentryIdString; - -/** - * A SentryId with an empty UUID "00000000000000000000000000000000". - */ -@property (class, nonatomic, readonly, strong) SentryId *empty; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryIntegrationProtocol.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryIntegrationProtocol.h deleted file mode 100644 index 1f4bc6634..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryIntegrationProtocol.h +++ /dev/null @@ -1,23 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentryOptions.h" - -NS_ASSUME_NONNULL_BEGIN - -@protocol SentryIntegrationProtocol - -/** - * 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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanism.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanism.h deleted file mode 100644 index 3a1bd3390..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanism.h +++ /dev/null @@ -1,59 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryNSError, SentryMechanismMeta; - -NS_SWIFT_NAME(Mechanism) -@interface SentryMechanism : NSObject -SENTRY_NO_INIT - -/** - * A unique identifier of this mechanism determining rendering and processing - * of the mechanism data - */ -@property (nonatomic, copy) NSString *type; - -/** - * 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; - -/** - * Arbitrary extra data that might help the user understand the error thrown by - * this mechanism - */ -@property (nonatomic, strong) NSDictionary *_Nullable data; - -/** - * Flag indicating whether the exception has been handled by the user - * (e.g. via ``try..catch``) - */ -@property (nonatomic, copy) NSNumber *_Nullable handled; - -/** - * Fully qualified URL to an online help resource, possible - * interpolated with error parameters - */ -@property (nonatomic, copy) NSString *_Nullable helpLink; - -/** - * Information from the operating system or runtime on the exception - * mechanism. - */ -@property (nullable, nonatomic, strong) SentryMechanismMeta *meta; - -/** - * Initialize an SentryMechanism with a type - * @param type String - * @return SentryMechanism - */ -- (instancetype)initWithType:(NSString *)type; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanismMeta.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanismMeta.h deleted file mode 100644 index 891f9794b..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMechanismMeta.h +++ /dev/null @@ -1,38 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMessage.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMessage.h deleted file mode 100644 index bd61581b3..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryMessage.h +++ /dev/null @@ -1,43 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * Carries a log message that describes an event or error. Optionally, it can carry a format string - * and structured parameters. This can help to group similar messages into the same issue. - * - * For more info checkout: https://develop.sentry.dev/sdk/event-payloads/message/ - */ -@interface SentryMessage : NSObject -SENTRY_NO_INIT - -/** - * Returns a SentyMessage with setting formatted. - * - * @param formatted The fully formatted message. If missing, Sentry will try to interpolate the - * message. It must not exceed 8192 characters. Longer messages will be truncated. - */ -- (instancetype)initWithFormatted:(NSString *)formatted; - -/** - * The fully formatted message. If missing, Sentry will try to interpolate the message. It must not - * exceed 8192 characters. Longer messages will be truncated. - */ -@property (nonatomic, readonly, copy) NSString *formatted; - -/** - * The raw message string (uninterpolated). It must not exceed 8192 characters. Longer messages will - * be truncated. - */ -@property (nonatomic, copy) NSString *_Nullable message; - -/** - * A list of formatting parameters for the raw message. - */ -@property (nonatomic, strong) NSArray *_Nullable params; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryNSError.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryNSError.h deleted file mode 100644 index af74383bd..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryNSError.h +++ /dev/null @@ -1,33 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryOptions.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryOptions.h deleted file mode 100644 index 7d818c696..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryOptions.h +++ /dev/null @@ -1,382 +0,0 @@ -#import "SentryDefines.h" -#import "SentryProfilingConditionals.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryDsn, SentrySdkInfo; - -NS_SWIFT_NAME(Options) -@interface SentryOptions : NSObject - -/** - * Init SentryOptions. - * @param options Options dictionary - * @return SentryOptions - */ -- (_Nullable instancetype)initWithDict:(NSDictionary *)options - didFailWithError:(NSError *_Nullable *_Nullable)error; - -/** - * 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 (nullable, nonatomic, strong) NSString *dsn; - -/** - * The parsed internal DSN. - */ -@property (nullable, nonatomic, strong) SentryDsn *parsedDsn; - -/** - * 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; - -/** - * Minimum LogLevel to be used if debug is enabled. Default is debug. - */ -@property (nonatomic, assign) SentryLevel diagnosticLevel; - -/** - * This property will be filled before the event is sent. - */ -@property (nullable, nonatomic, copy) NSString *releaseName; - -/** - * This property will be filled before the event is sent. - */ -@property (nullable, nonatomic, copy) NSString *dist; - -/** - * The environment used for this event - */ -@property (nullable, nonatomic, copy) NSString *environment; - -/** - * Specifies wether this SDK should send events to Sentry. If set to NO events will be - * dropped in the client and not sent to Sentry. Default is YES. - */ -@property (nonatomic, assign) BOOL enabled; - -/** - * How many breadcrumbs do you want to keep in memory? - * Default is 100. - */ -@property (nonatomic, assign) NSUInteger maxBreadcrumbs; - -/** - * When enabled, the SDK adds breadcrumbs for each network request. Default value is YES. - * As this feature uses swizzling, disabling enableSwizzling also disables this feature. - */ -@property (nonatomic, assign) BOOL enableNetworkBreadcrumbs; - -/** - * 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 (nullable, nonatomic, copy) SentryBeforeSendEventCallback beforeSend; - -/** - * This block can be used to modify the event before it will be serialized and - * sent - */ -@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 (nullable, nonatomic, copy) NSArray *integrations; - -/** - * Array of default integrations. Will be used if integrations are nil - */ -+ (NSArray *)defaultIntegrations; - -/** - * Indicates the percentage of events being sent to Sentry. Setting this to 0 discards all - * events, 1.0 or NIL 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 (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. - */ -@property (nonatomic, assign) NSUInteger sessionTrackingIntervalMillis; - -/** - * When enabled, stack traces are automatically attached to all messages logged. Stack traces are - * 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 enabled by default. - */ -@property (nonatomic, assign) BOOL attachStacktrace; - -/** - * Attention: This is an experimental feature. Turning this feature on can have an impact on - * the grouping of your issues. - * - * When enabled, the SDK stitches stack traces of asynchronous code together. - * - * This feature is disabled by default. - */ -@property (nonatomic, assign) BOOL stitchAsyncCode; - -/** - * Describes the Sentry SDK and its configuration used to capture and transmit an event. - * This is reserved for internal use, and will be removed in a future version of the SDK. - */ -@property (nonatomic, readonly, strong) SentrySdkInfo *sdkInfo DEPRECATED_MSG_ATTRIBUTE( - "This property will be removed in a future version of the SDK"); - -/** - * 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, and this flag is - * YES, the SDK sets it to {{auto}} to instruct the server to use the - * connection IP address as the user address. Due to backward compatibility concerns, Sentry set the - * IP address to {{auto}} out of the box for Cocoa. If you want to stop Sentry from - * using the connections IP address, you have to enable Prevent Storing of IP Addresses in your - * project settings in Sentry. - */ -@property (nonatomic, assign) BOOL sendDefaultPii; - -/** - * When enabled, the SDK tracks performance for UIViewController subclasses and HTTP requests - * automatically. It also measures the app start and slow and frozen frames. The default is - * YES. Note: Performance Monitoring must be enabled for this flag to take effect. See: - * https://docs.sentry.io/platforms/apple/performance/ - */ -@property (nonatomic, assign) BOOL enableAutoPerformanceTracking; - -#if SENTRY_HAS_UIKIT -/** - * When enabled, the SDK tracks performance for UIViewController subclasses. The default is - * YES. - */ -@property (nonatomic, assign) BOOL enableUIViewControllerTracking; - -/** - * Automatically attaches a screenshot when capturing an error or exception. - * - * Default value is NO - */ -@property (nonatomic, assign) BOOL attachScreenshot; - -/** - * This feature is EXPERIMENTAL. - * - * When enabled, the SDK creates transactions for UI events like buttons clicks, switch toggles, - * and other ui elements that uses UIControl `sendAction:to:forEvent:`. - */ -@property (nonatomic, assign) BOOL enableUserInteractionTracing; - -/** - * How long an idle transaction waits for new children after all its child spans finished. Only UI - * event transactions are idle transactions. The default is 3 seconds. - */ -@property (nonatomic, assign) NSTimeInterval idleTimeout; - -#endif - -/** - * When enabled, the SDK adds breadcrumbs for HTTP requests and tracks performance for HTTP - * requests if auto performance tracking and enableSwizzling are enabled. The default is - * YES. - */ -@property (nonatomic, assign) BOOL enableNetworkTracking; - -/** - * This feature is EXPERIMENTAL. - * - * When enabled, the SDK tracks performance for file IO reads and writes with NSData if auto - * performance tracking and enableSwizzling are enabled. The default is NO. - */ -@property (nonatomic, assign) BOOL enableFileIOTracking; - -/** - * 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; - -/** - * If tracing should be enabled or not. Returns YES if either a tracesSampleRate > 0 and <=1 or a - * tracesSampler is set otherwise NO. - */ -@property (nonatomic, assign, readonly) BOOL isTracingEnabled; - -/** - * 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; - -/** - * Wether the SDK should use swizzling or not. Default is YES. - * - * @discussion When turned off the following features are disabled: breadcrumbs for touch events and - * navigation with UIViewControllers, automatic instrumentation for UIViewControllers, automatic - * instrumentation for HTTP requests, automatic instrumentation for file IO with NSData, and - * automatically added sentry-trace header to HTTP requests for distributed tracing. - */ -@property (nonatomic, assign) BOOL enableSwizzling; - -/** - * This feature is experimental. - * - * When enabled, the SDK tracks the performance of Core Data operations. It requires enabling - * performance monitoring. The default is NO. - * @see - */ -@property (nonatomic, assign) BOOL enableCoreDataTracking; - -#if SENTRY_TARGET_PROFILING_SUPPORTED -/** - * This feature is experimental. Profiling is not supported on watchOS or tvOS. - * - * Indicates the percentage profiles being sampled out of the sampled transactions. - * - * 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. - * - * This property is dependent on `tracesSampleRate` -- if `tracesSampleRate` is 0 (default), - * no profiles will be collected no matter what this property is set to. This property is - * used to undersample profiles *relative to* `tracesSampleRate`. - */ -@property (nullable, nonatomic, strong) NSNumber *profilesSampleRate; - -/** - * This feature is experimental. Profiling is not supported on watchOS or tvOS. - * - * A callback to a user defined profiles sampler function. This is similar to setting - * `profilesSampleRate`, but instead of a static value, the callback function will be called to - * determine the sample rate. - */ -@property (nullable, nonatomic) SentryTracesSamplerCallback profilesSampler; - -/** - * If profiling should be enabled or not. Returns YES if either a profilesSampleRate > 0 and - * <=1 or a profilesSampler is set otherwise NO. - */ -@property (nonatomic, assign, readonly) BOOL isProfilingEnabled; - -/** - * DEPRECATED: Use `profilesSampleRate` instead. Setting `enableProfiling` to YES is the equivalent - * of setting `profilesSampleRate` to `1.0`. If `profilesSampleRate` is set, it will take precedence - * over this setting. - * - * Whether to enable the sampling profiler. Default is NO. - * @note This is a beta feature that is currently not available to all Sentry customers. This - * feature is not supported on watchOS or tvOS. - */ -@property (nonatomic, assign) BOOL enableProfiling DEPRECATED_MSG_ATTRIBUTE( - "Use profilesSampleRate or profilesSampler instead. This property will be removed in a future " - "version of the SDK"); -#endif - -/** - * Whether to send client reports, which contain statistics about discarded events. The default is - * YES. - * - * @see - */ -@property (nonatomic, assign) BOOL sendClientReports; - -/** - * When enabled, the SDK tracks when the application stops responding for a specific amount of - * time defined by the `appHangsTimeoutInterval` option. - */ -@property (nonatomic, assign) BOOL enableAppHangTracking; - -/** - * The minimum amount of time an app should be unresponsive to be classified as an App Hanging. - * The actual amount may be a little longer. - * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted. - * The default value is 2 seconds. - */ -@property (nonatomic, assign) NSTimeInterval appHangTimeoutInterval; - -/** - * When enabled, the SDK adds breadcrumbs for various system events. Default value is YES. - */ -@property (nonatomic, assign) BOOL enableAutoBreadcrumbTracking; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryProfilingConditionals.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryProfilingConditionals.h deleted file mode 100644 index 3165d618a..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryProfilingConditionals.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SentryProfilingConditionals_h -#define SentryProfilingConditionals_h - -#include - -// tvOS and watchOS do not support the kernel APIs required by our profiler -// e.g. mach_msg, thread_suspend, thread_resume -#if TARGET_OS_WATCH || TARGET_OS_TV -# define SENTRY_TARGET_PROFILING_SUPPORTED 0 -#else -# define SENTRY_TARGET_PROFILING_SUPPORTED 1 -#endif - -#endif /* SentryProfilingConditionals_h */ diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySDK.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySDK.h deleted file mode 100644 index 0b7a71360..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySDK.h +++ /dev/null @@ -1,317 +0,0 @@ -#import - -#import "SentryDefines.h" - -@protocol SentrySpan; - -@class SentryOptions, SentryEvent, SentryBreadcrumb, SentryScope, SentryUser, SentryId, - SentryUserFeedback, SentryTransactionContext; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The main entry point for the SentrySDK. - * - * We recommend using `[Sentry startWithConfigureOptions]` to initialize Sentry. - */ -@interface SentrySDK : NSObject -SENTRY_NO_INIT - -/** - * The current active transaction or span bound to the scope. - */ -@property (nullable, class, nonatomic, readonly) id span; - -/** - * Indicates whether the SentrySDK is enabled. - */ -@property (class, nonatomic, readonly) BOOL isEnabled; - -/** - * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. - */ -+ (void)startWithOptions:(NSDictionary *)optionsDict NS_SWIFT_NAME(start(options:)); - -/** - * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. - */ -+ (void)startWithOptionsObject:(SentryOptions *)options NS_SWIFT_NAME(start(options:)); - -/** - * Inits and configures Sentry (SentryHub, SentryClient) and sets up all integrations. Make sure to - * set a valid DSN. - */ -+ (void)startWithConfigureOptions:(void (^)(SentryOptions *options))configureOptions - NS_SWIFT_NAME(start(configureOptions:)); - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureEvent:(SentryEvent *)event NS_SWIFT_NAME(capture(event:)); - -/** - * Captures a manually created event and sends it to Sentry. Only the data in this scope object will - * be added to the event. The global scope will be ignored. - * - * @param event The event to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureEvent:(SentryEvent *)event - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(event:scope:)); - -/** - * Captures a manually created event and sends it to Sentry. Maintains the global scope but mutates - * scope data for only this call. - * - * @param event The event to send to Sentry. - * @param block The block mutating the scope only for this call. - * - * @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:)); - -/** - * 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 SDK should bind the new transaction 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 SDK should bind the new transaction 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 SDK should bind the new transaction 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. - * - * @param error The error to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureError:(NSError *)error NS_SWIFT_NAME(capture(error:)); - -/** - * Captures an error event and sends it to Sentry. Only the data in this scope object will be added - * to the event. The global scope will be ignored. - * - * @param error The error to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureError:(NSError *)error - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(error:scope:)); - -/** - * Captures an error event and sends it to Sentry. Maintains the global scope but mutates scope data - * for only this call. - * - * @param error The error to send to Sentry. - * @param block The block mutating the scope only for this call. - * - * @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:)); - -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureException:(NSException *)exception NS_SWIFT_NAME(capture(exception:)); - -/** - * Captures an exception event and sends it to Sentry. Only the data in this scope object will be - * added to the event. The global scope will be ignored. - * - * @param exception The exception to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureException:(NSException *)exception - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(exception:scope:)); - -/** - * Captures an exception event and sends it to Sentry. Maintains the global scope but mutates scope - * data for only this call. - * - * @param exception The exception to send to Sentry. - * @param block The block mutating the scope only for this call. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureException:(NSException *)exception - withScopeBlock:(void (^)(SentryScope *scope))block - NS_SWIFT_NAME(capture(exception:block:)); - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureMessage:(NSString *)message NS_SWIFT_NAME(capture(message:)); - -/** - * Captures a message event and sends it to Sentry. Only the data in this scope object will be added - * to the event. The global scope will be ignored. - * - * @param message The message to send to Sentry. - * @param scope The scope containing event metadata. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureMessage:(NSString *)message - withScope:(SentryScope *)scope NS_SWIFT_NAME(capture(message:scope:)); - -/** - * Captures a message event and sends it to Sentry. Maintains the global scope but mutates scope - * data for only this call. - * - * @param message The message to send to Sentry. - * @param block The block mutating the scope only for this call. - * - * @return The SentryId of the event or SentryId.empty if the event is not sent. - */ -+ (SentryId *)captureMessage:(NSString *)message - withScopeBlock:(void (^)(SentryScope *scope))block - NS_SWIFT_NAME(capture(message:block:)); - -/** - * Captures a manually created user feedback and sends it to Sentry. - * - * @param userFeedback The user feedback to send to Sentry. - */ -+ (void)captureUserFeedback:(SentryUserFeedback *)userFeedback - NS_SWIFT_NAME(capture(userFeedback:)); - -/** - * 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:)); - -/** - * 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. - */ -+ (void)configureScope:(void (^)(SentryScope *scope))callback; - -/** - * Checks if the last program execution terminated with a crash. - */ -@property (nonatomic, class, readonly) BOOL crashedLastRun; - -/** - * 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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySampleDecision.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySampleDecision.h deleted file mode 100644 index 92c70758b..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySampleDecision.h +++ /dev/null @@ -1,22 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySamplingContext.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySamplingContext.h deleted file mode 100644 index dd16e7145..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySamplingContext.h +++ /dev/null @@ -1,38 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScope.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScope.h deleted file mode 100644 index 63c71ae69..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScope.h +++ /dev/null @@ -1,150 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" -#import "SentrySpanProtocol.h" - -@class SentryUser, SentrySession, SentryOptions, SentryBreadcrumb, SentryAttachment; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The scope holds useful information that should be sent along with the event. For instance tags or - * breadcrumbs are stored on the scope. - * - * For more information see: - * https://docs.sentry.io/platforms/apple/enriching-events/scopes/#whats-a-scope-whats-a-hub - */ -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; - -/** - * Set global user -> thus will be sent with every event - */ -- (void)setUser:(SentryUser *_Nullable)user; - -/** - * Set a global tag. Tags are searchable key/value string pairs attached to - * every event. - */ -- (void)setTagValue:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(setTag(value:key:)); - -/** - * Remove the tag for the specified key. - */ -- (void)removeTagForKey:(NSString *)key NS_SWIFT_NAME(removeTag(key:)); - -/** - * Set global tags. Tags are searchable key/value string pairs attached to every - * event. - */ -- (void)setTags:(NSDictionary *_Nullable)tags; - -/** - * Set global extra -> these will be sent with every event - */ -- (void)setExtras:(NSDictionary *_Nullable)extras; - -/** - * Set global extra -> these will be sent with every event - */ -- (void)setExtraValue:(id _Nullable)value - forKey:(NSString *)key NS_SWIFT_NAME(setExtra(value:key:)); - -/** - * Remove the extra for the specified key. - */ -- (void)removeExtraForKey:(NSString *)key NS_SWIFT_NAME(removeExtra(key:)); - -/** - * Set dist in the scope - */ -- (void)setDist:(NSString *_Nullable)dist; - -/** - * Set environment in the scope - */ -- (void)setEnvironment:(NSString *_Nullable)environment; - -/** - * Sets the fingerprint in the scope - */ -- (void)setFingerprint:(NSArray *_Nullable)fingerprint; - -/** - * Sets the level in the scope - */ -- (void)setLevel:(enum SentryLevel)level; - -/** - * Add a breadcrumb to the scope - */ -- (void)addBreadcrumb:(SentryBreadcrumb *)crumb; - -/** - * Clears all breadcrumbs in the scope - */ -- (void)clearBreadcrumbs; - -/** - * Serializes the Scope to JSON - */ -- (NSDictionary *)serialize; - -/** - * Adds the Scope to the event - */ -- (SentryEvent *__nullable)applyToEvent:(SentryEvent *)event - maxBreadcrumb:(NSUInteger)maxBreadcrumbs; - -- (void)applyToSession:(SentrySession *)session; - -/** - * Sets context values which will overwrite SentryEvent.context when event is - * "enriched" with scope before sending event. - */ -- (void)setContextValue:(NSDictionary *)value - forKey:(NSString *)key NS_SWIFT_NAME(setContext(value:key:)); - -/** - * Remove the context for the specified key. - */ -- (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 all attachments in the scope. - */ -- (void)clearAttachments; - -/** - * Clears the current Scope - */ -- (void)clear; - -/** - * Mutates the current transaction atomically. - * - * @param callback the SentrySpanCallback. - */ -- (void)useSpan:(SentrySpanCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScreenFrames.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScreenFrames.h deleted file mode 100644 index ec182d69c..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryScreenFrames.h +++ /dev/null @@ -1,49 +0,0 @@ -#import "SentryDefines.h" -#import "SentryProfilingConditionals.h" - -NS_ASSUME_NONNULL_BEGIN - -#if SENTRY_HAS_UIKIT - -/** An array of dictionaries that each contain a start and end timestamp for a rendered frame. */ -# if SENTRY_TARGET_PROFILING_SUPPORTED -typedef NSArray *> SentryFrameInfoTimeSeries; -# endif // SENTRY_TARGET_PROFILING_SUPPORTED - -@interface SentryScreenFrames : NSObject -SENTRY_NO_INIT - -- (instancetype)initWithTotal:(NSUInteger)total frozen:(NSUInteger)frozen slow:(NSUInteger)slow; - -# if SENTRY_TARGET_PROFILING_SUPPORTED -- (instancetype)initWithTotal:(NSUInteger)total - frozen:(NSUInteger)frozen - slow:(NSUInteger)slow - frameTimestamps:(SentryFrameInfoTimeSeries *)frameTimestamps - frameRateTimestamps:(SentryFrameInfoTimeSeries *)frameRateTimestamps; -# endif // SENTRY_TARGET_PROFILING_SUPPORTED - -@property (nonatomic, assign, readonly) NSUInteger total; -@property (nonatomic, assign, readonly) NSUInteger frozen; -@property (nonatomic, assign, readonly) NSUInteger slow; - -# if SENTRY_TARGET_PROFILING_SUPPORTED -/** - * Array of dictionaries describing slow/frozen frames' timestamps. Each dictionary start and end - * timestamp for every such frame, keyed under @c start_timestamp and @c end_timestamp. - */ -@property (nonatomic, copy, readonly) SentryFrameInfoTimeSeries *frameTimestamps; - -/** - * Array of dictionaries describing the screen refresh rate at all points in time that it changes, - * which can happen when modern devices e.g. go into low power mode. Each dictionary contains keys - * @c timestamp and @c frame_rate. - */ -@property (nonatomic, copy, readonly) SentryFrameInfoTimeSeries *frameRateTimestamps; -# endif // SENTRY_TARGET_PROFILING_SUPPORTED - -@end - -#endif - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySdkInfo.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySdkInfo.h deleted file mode 100644 index ef80f2cab..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySdkInfo.h +++ /dev/null @@ -1,40 +0,0 @@ -#import "SentrySerializable.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * Describes the Sentry SDK and its configuration used to capture and transmit an event. - * - * Both name and version are required. - * - * For more info checkout: https://develop.sentry.dev/sdk/event-payloads/sdk/ - */ -@interface SentrySdkInfo : NSObject -SENTRY_NO_INIT - -/** - * The name of the SDK. - * - * Examples: sentry.cocoa, sentry.cocoa.vapor, ... - */ -@property (nonatomic, readonly, copy) NSString *name; - -/** - * The version of the SDK. It should have the Semantic Versioning format MAJOR.MINOR.PATCH, without - * any prefix (no v or anything else in front of the major version number). - * - * Examples: 0.1.0, 1.0.0, 2.0.0-beta0 - */ -@property (nonatomic, readonly, copy) NSString *version; - -- (instancetype)initWithName:(NSString *)name - andVersion:(NSString *)version NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithDict:(NSDictionary *)dict; - -- (instancetype)initWithDict:(NSDictionary *)dict orDefaults:(SentrySdkInfo *)info; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySerializable.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySerializable.h deleted file mode 100644 index 4e092d9a1..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySerializable.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -#import "SentryDefines.h" - -NS_ASSUME_NONNULL_BEGIN - -@protocol SentrySerializable -SENTRY_NO_INIT - -/** - * Serialize the contents of the object into an NSDictionary. Make to copy all properties of the - * original object so modifications to it don't have an impact on the serialized NSDictionary. - */ -- (NSDictionary *)serialize; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySession.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySession.h deleted file mode 100644 index 4ecea99c9..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySession.h +++ /dev/null @@ -1,59 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" - -@class SentryUser; - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSUInteger, SentrySessionStatus) { - kSentrySessionStatusOk = 0, - kSentrySessionStatusExited = 1, - kSentrySessionStatusCrashed = 2, - kSentrySessionStatusAbnormal = 3, -}; - -/** - * The SDK uses SentrySession to inform Sentry about release and project associated project health. - */ -@interface SentrySession : NSObject -SENTRY_NO_INIT - -- (instancetype)initWithReleaseName:(NSString *)releaseName; - -/** - * 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; -- (void)endSessionAbnormalWithTimestamp:(NSDate *)timestamp; - -- (void)incrementErrors; - -@property (nonatomic, readonly, strong) NSUUID *sessionId; -@property (nonatomic, readonly, strong) NSDate *started; -@property (nonatomic, readonly) enum SentrySessionStatus status; -@property (nonatomic, readonly) NSUInteger errors; -@property (nonatomic, readonly) NSUInteger sequence; -@property (nonatomic, readonly, strong) NSString *distinctId; -/** - We can't use init because it overlaps with NSObject.init - */ -@property (nonatomic, readonly, copy) NSNumber *_Nullable flagInit; -@property (nonatomic, readonly, strong) NSDate *_Nullable timestamp; -@property (nonatomic, readonly, strong) NSNumber *_Nullable duration; - -@property (nonatomic, readonly, copy) NSString *_Nullable releaseName; -@property (nonatomic, copy) NSString *_Nullable environment; -@property (nonatomic, copy) SentryUser *_Nullable user; - -- (NSDictionary *)serialize; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanContext.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanContext.h deleted file mode 100644 index db0d3107c..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanContext.h +++ /dev/null @@ -1,107 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanId.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanId.h deleted file mode 100644 index 3d0e58445..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanId.h +++ /dev/null @@ -1,40 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanProtocol.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanProtocol.h deleted file mode 100644 index 4fbc1abf5..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanProtocol.h +++ /dev/null @@ -1,111 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" -#import "SentrySpanContext.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentrySpanId, SentryId, SentryTraceHeader; - -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; - -/** - * key-value pairs holding additional data about the span. - */ -@property (readonly) NSDictionary *tags; - -/** - * 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 a value to data. - */ -- (void)setDataValue:(nullable id)value forKey:(NSString *)key NS_SWIFT_NAME(setData(value:key:)); - -/** - * Use setDataValue instead. This method calls setDataValue, was added by mistake, and will be - * deprecated in a future version. - */ -- (void)setExtraValue:(nullable id)value forKey:(NSString *)key NS_SWIFT_NAME(setExtra(value:key:)); - -/** - * Removes a data value. - */ -- (void)removeDataForKey:(NSString *)key NS_SWIFT_NAME(removeData(key:)); - -/** - * Sets a tag value. - */ -- (void)setTagValue:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(setTag(value:key:)); - -/** - * Removes a tag value. - */ -- (void)removeTagForKey:(NSString *)key NS_SWIFT_NAME(removeTag(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:)); - -/** - * Returns the trace information that could be sent as a sentry-trace header. - * - * @return SentryTraceHeader. - */ -- (SentryTraceHeader *)toTraceHeader; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanStatus.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanStatus.h deleted file mode 100644 index 6dd8a7bf1..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentrySpanStatus.h +++ /dev/null @@ -1,103 +0,0 @@ -#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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryStacktrace.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryStacktrace.h deleted file mode 100644 index e8c67d83f..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryStacktrace.h +++ /dev/null @@ -1,41 +0,0 @@ -#import - -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryFrame; - -NS_SWIFT_NAME(Stacktrace) -@interface SentryStacktrace : NSObject -SENTRY_NO_INIT - -/** - * Array of all SentryFrame in the stacktrace - */ -@property (nonatomic, strong) NSArray *frames; - -/** - * Registers of the thread for additional information used on the server - */ -@property (nonatomic, strong) NSDictionary *registers; - -/** - * Initialize a SentryStacktrace with frames and registers - * @param frames NSArray - * @param registers NSArray - * @return SentryStacktrace - */ -- (instancetype)initWithFrames:(NSArray *)frames - registers:(NSDictionary *)registers; - -/** - * This will be called internally, is used to remove duplicated frames for - * certain crashes. - */ -- (void)fixDuplicateFrames; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryThread.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryThread.h deleted file mode 100644 index 7546e419e..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryThread.h +++ /dev/null @@ -1,46 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryStacktrace; - -NS_SWIFT_NAME(Thread) -@interface SentryThread : NSObject -SENTRY_NO_INIT - -/** - * Number of the thread - */ -@property (nonatomic, copy) NSNumber *threadId; - -/** - * Name (if available) of the thread - */ -@property (nonatomic, copy) NSString *_Nullable name; - -/** - * SentryStacktrace of the SentryThread - */ -@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace; - -/** - * Did this thread crash? - */ -@property (nonatomic, copy) NSNumber *_Nullable crashed; - -/** - * Was it the current thread. - */ -@property (nonatomic, copy) NSNumber *_Nullable current; - -/** - * Initializes a SentryThread with its id - * @param threadId NSNumber - * @return SentryThread - */ -- (instancetype)initWithThreadId:(NSNumber *)threadId; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTraceHeader.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTraceHeader.h deleted file mode 100644 index 9cd4195b6..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTraceHeader.h +++ /dev/null @@ -1,49 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySampleDecision.h" -#import - -@class SentryId, SentrySpanId; - -NS_ASSUME_NONNULL_BEGIN - -static NSString *const SENTRY_TRACE_HEADER = @"sentry-trace"; - -NS_SWIFT_NAME(TraceHeader) -@interface SentryTraceHeader : NSObject -SENTRY_NO_INIT -/** - * Trace ID. - */ -@property (nonatomic, readonly) SentryId *traceId; - -/** - * Span ID. - */ -@property (nonatomic, readonly) SentrySpanId *spanId; - -/** - * The trace sample decision. - */ -@property (nonatomic, readonly) SentrySampleDecision sampled; - -/** - * Initialize a SentryTraceHeader with given trace id, span id and sample decision. - * - * @param traceId The trace id. - * @param spanId The span id. - * @param sampled The decision made to sample the trace related to this header. - * - * @return A SentryTraceHeader. - */ -- (instancetype)initWithTraceId:(SentryId *)traceId - spanId:(SentrySpanId *)spanId - sampled:(SentrySampleDecision)sampled; - -/** - * Return the value to use in a request header. - */ -- (NSString *)value; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTransactionContext.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTransactionContext.h deleted file mode 100644 index f4c3c127c..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryTransactionContext.h +++ /dev/null @@ -1,72 +0,0 @@ -#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; - -/** - * Sample rate used for this transaction - */ -@property (nonatomic, strong, nullable) NSNumber *sampleRate; - -/** - * 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/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUser.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUser.h deleted file mode 100644 index ed5503b61..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUser.h +++ /dev/null @@ -1,52 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -NS_SWIFT_NAME(User) -@interface SentryUser : NSObject - -/** - * Optional: Id of the user - */ -@property (atomic, copy) NSString *userId; - -/** - * Optional: Email of the user - */ -@property (atomic, copy) NSString *_Nullable email; - -/** - * Optional: Username - */ -@property (atomic, copy) NSString *_Nullable username; - -/** - * Optional: IP Address - */ -@property (atomic, copy) NSString *_Nullable ipAddress; - -/** - * Optional: Additional data - */ -@property (atomic, strong) NSDictionary *_Nullable data; - -/** - * Initializes a SentryUser with the id - * @param userId NSString - * @return SentryUser - */ -- (instancetype)initWithUserId:(NSString *)userId; - -- (instancetype)init; -+ (instancetype)new NS_UNAVAILABLE; - -- (BOOL)isEqual:(id _Nullable)other; - -- (BOOL)isEqualToUser:(SentryUser *)user; - -- (NSUInteger)hash; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUserFeedback.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUserFeedback.h deleted file mode 100644 index 1878c369e..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Headers/SentryUserFeedback.h +++ /dev/null @@ -1,44 +0,0 @@ -#import "SentryDefines.h" -#import "SentrySerializable.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SentryId; - -/** - * Adds additional information about what happened to an event. - */ -NS_SWIFT_NAME(UserFeedback) -@interface SentryUserFeedback : NSObject -SENTRY_NO_INIT - -/** - * Initializes SentryUserFeedback and sets the required eventId. - * - * @param eventId The eventId of the event to which the user feedback is associated. - */ -- (instancetype)initWithEventId:(SentryId *)eventId; - -/** - * The eventId of the event to which the user feedback is associated. - */ -@property (readonly, nonatomic, strong) SentryId *eventId; - -/** - * The name of the user. - */ -@property (nonatomic, copy) NSString *name; - -/** - * The email of the user. - */ -@property (nonatomic, copy) NSString *email; - -/** - * Comments of the user about what happened. - */ -@property (nonatomic, copy) NSString *comments; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Info.plist b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Info.plist deleted file mode 100644 index 97ae64fdb..000000000 Binary files a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Info.plist and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Modules/module.modulemap b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Modules/module.modulemap deleted file mode 100644 index 5434aa935..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Sentry { - umbrella header "Sentry.h" - - export * - module * { export * } -} diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h deleted file mode 100644 index cb0d3441b..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSData+SentryCompression.h +++ /dev/null @@ -1,13 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface -NSData (SentryCompression) - -- (NSData *_Nullable)sentry_gzippedWithCompressionLevel:(NSInteger)compressionLevel - error:(NSError *_Nullable *_Nullable)error; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h deleted file mode 100644 index 7993ae072..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDate+SentryExtras.h +++ /dev/null @@ -1,14 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface -NSDate (SentryExtras) - -+ (NSDate *)sentry_fromIso8601String:(NSString *)string; - -- (NSString *)sentry_toIso8601String; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h deleted file mode 100644 index 3b59e82bb..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/NSDictionary+SentrySanitize.h +++ /dev/null @@ -1,12 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface -NSDictionary (SentrySanitize) - -- (NSDictionary *)sentry_sanitize; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h deleted file mode 100644 index ab3c8a18e..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAsynchronousOperation.h +++ /dev/null @@ -1,11 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryAsynchronousOperation : NSOperation - -- (void)completeOperation; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h deleted file mode 100644 index 93fc4a4d0..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryAutoSessionTrackingIntegration.h +++ /dev/null @@ -1,15 +0,0 @@ -#import "SentryIntegrationProtocol.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * Automatically tracks session start and end. - */ -@interface SentryAutoSessionTrackingIntegration : NSObject - -- (void)stop; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h deleted file mode 100644 index d0d64b856..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashInstallationReporter.h +++ /dev/null @@ -1,19 +0,0 @@ -#import "SentryCrash.h" -#import "SentryCrashInstallation.h" -#import "SentryDefines.h" -#import - -@class SentryInAppLogic; - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryCrashInstallationReporter : SentryCrashInstallation -SENTRY_NO_INIT - -- (instancetype)initWithInAppLogic:(SentryInAppLogic *)inAppLogic; - -- (void)sendAllReports; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h deleted file mode 100644 index 5c95b263e..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportConverter.h +++ /dev/null @@ -1,22 +0,0 @@ -#import - -@class SentryEvent, SentryInAppLogic; - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryCrashReportConverter : NSObject - -@property (nonatomic, strong) NSDictionary *userContext; - -- (instancetype)initWithReport:(NSDictionary *)report inAppLogic:(SentryInAppLogic *)inAppLogic; - -/** - * Converts the report to an SentryEvent. - * - * @return The converted event or nil if an error occured during the conversion. - */ -- (SentryEvent *_Nullable)convertReportToEvent; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h deleted file mode 100644 index 2c88e1b9a..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryCrashReportSink.h +++ /dev/null @@ -1,16 +0,0 @@ -#import "SentryCrash.h" -#import "SentryDefines.h" -#import - -@class SentryInAppLogic; - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryCrashReportSink : NSObject -SENTRY_NO_INIT - -- (instancetype)initWithInAppLogic:(SentryInAppLogic *)inAppLogic; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryLog.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryLog.h deleted file mode 100644 index 011110316..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryLog.h +++ /dev/null @@ -1,17 +0,0 @@ -#import "SentryDefines.h" -#import - -@class SentryLogOutput; - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryLog : NSObject -SENTRY_NO_INIT - -+ (void)configure:(BOOL)debug diagnosticLevel:(SentryLevel)level; - -+ (void)logWithMessage:(NSString *)message andLevel:(SentryLevel)level; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryRequestOperation.h b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryRequestOperation.h deleted file mode 100644 index 33920c664..000000000 --- a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/SentryRequestOperation.h +++ /dev/null @@ -1,16 +0,0 @@ -#import - -#import "SentryAsynchronousOperation.h" -#import "SentryQueueableRequestManager.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface SentryRequestOperation : SentryAsynchronousOperation - -- (instancetype)initWithSession:(NSURLSession *)session - request:(NSURLRequest *)request - completionHandler:(_Nullable SentryRequestOperationFinished)completionHandler; - -@end - -NS_ASSUME_NONNULL_END diff --git a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Sentry b/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Sentry deleted file mode 100755 index 864ac6fba..000000000 Binary files a/plugin-dev/Source/ThirdParty/IOS/Sentry.framework/Sentry and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Linux/bin/crashpad_handler b/plugin-dev/Source/ThirdParty/Linux/bin/crashpad_handler deleted file mode 100755 index 564614623..000000000 Binary files a/plugin-dev/Source/ThirdParty/Linux/bin/crashpad_handler and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.dbg.so b/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.dbg.so deleted file mode 100755 index 62341195b..000000000 Binary files a/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.dbg.so and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.so b/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.so deleted file mode 100755 index 7a16a9b13..000000000 Binary files a/plugin-dev/Source/ThirdParty/Linux/bin/libsentry.so and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Linux/include/sentry.h b/plugin-dev/Source/ThirdParty/Linux/include/sentry.h deleted file mode 100644 index 44a0f878f..000000000 --- a/plugin-dev/Source/ThirdParty/Linux/include/sentry.h +++ /dev/null @@ -1,1874 +0,0 @@ -/** - * sentry-native - * - * sentry-native is a C client to send events to native from - * C and C++ applications. It can work together with breakpad/crashpad - * but also send events on its own. - * - * NOTE on encodings: - * - * Sentry will assume an encoding of UTF-8 for all string data that is captured - * and being sent to sentry as an Event. - * All the functions that are dealing with *paths* will assume an OS-specific - * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on - * Linux; and they provide wchar-compatible alternatives on Windows which are - * preferred. - */ - -#ifndef SENTRY_H_INCLUDED -#define SENTRY_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* SDK Version */ -#ifndef SENTRY_SDK_NAME -# ifdef __ANDROID__ -# define SENTRY_SDK_NAME "sentry.native.android" -# else -# define SENTRY_SDK_NAME "sentry.native" -# endif -#endif -#define SENTRY_SDK_VERSION "0.5.0" -#define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION - -/* common platform detection */ -#ifdef _WIN32 -# define SENTRY_PLATFORM_WINDOWS -#elif defined(__APPLE__) -# include -# if defined(TARGET_OS_OSX) && TARGET_OS_OSX -# define SENTRY_PLATFORM_MACOS -# elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE -# define SENTRY_PLATFORM_IOS -# endif -# define SENTRY_PLATFORM_DARWIN -# define SENTRY_PLATFORM_UNIX -#elif defined(__ANDROID__) -# define SENTRY_PLATFORM_ANDROID -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(__linux) || defined(__linux__) -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(_AIX) -/* IBM i PASE is also counted as AIX */ -# define SENTRY_PLATFORM_AIX -# define SENTRY_PLATFORM_UNIX -#else -# error unsupported platform -#endif - -/* marks a function as part of the sentry API */ -#ifndef SENTRY_API -# ifdef _WIN32 -# if defined(SENTRY_BUILD_SHARED) /* build dll */ -# define SENTRY_API __declspec(dllexport) -# elif !defined(SENTRY_BUILD_STATIC) /* use dll */ -# define SENTRY_API __declspec(dllimport) -# else /* static library */ -# define SENTRY_API -# endif -# else -# if __GNUC__ >= 4 -# define SENTRY_API __attribute__((visibility("default"))) -# else -# define SENTRY_API -# endif -# endif -#endif - -/* marks a function as experimental api */ -#ifndef SENTRY_EXPERIMENTAL_API -# define SENTRY_EXPERIMENTAL_API SENTRY_API -#endif - -#include -#include -#include - -/* context type dependencies */ -#ifdef _WIN32 -# include -#else -# include -#endif - -/** - * The library internally uses the system malloc and free functions to manage - * memory. It does not use realloc. The reason for this is that on unix - * platforms we fall back to a simplistic page allocator once we have - * encountered a SIGSEGV or other terminating signal as malloc is no longer - * safe to use. Since we cannot portably reallocate allocations made on the - * pre-existing allocator we're instead not using realloc. - * - * Note also that after SIGSEGV sentry_free() becomes a noop. - */ - -/** - * Allocates memory with the underlying allocator. - */ -SENTRY_API void *sentry_malloc(size_t size); - -/** - * Releases memory allocated from the underlying allocator. - */ -SENTRY_API void sentry_free(void *ptr); - -/** - * Legacy function. Alias for `sentry_free`. - */ -#define sentry_string_free sentry_free - -/* -- Protocol Value API -- */ - -/** - * Type of a sentry value. - */ -typedef enum { - SENTRY_VALUE_TYPE_NULL, - SENTRY_VALUE_TYPE_BOOL, - SENTRY_VALUE_TYPE_INT32, - SENTRY_VALUE_TYPE_DOUBLE, - SENTRY_VALUE_TYPE_STRING, - SENTRY_VALUE_TYPE_LIST, - SENTRY_VALUE_TYPE_OBJECT, -} sentry_value_type_t; - -/** - * Represents a sentry protocol value. - * - * The members of this type should never be accessed. They are only here - * so that alignment for the type can be properly determined. - * - * Values must be released with `sentry_value_decref`. This lowers the - * internal refcount by one. If the refcount hits zero it's freed. Some - * values like primitives have no refcount (like null) so operations on - * those are no-ops. - * - * In addition values can be frozen. Some values like primitives are always - * frozen but lists and dicts are not and can be frozen on demand. This - * automatically happens for some shared values in the event payload like - * the module list. - */ -union sentry_value_u { - uint64_t _bits; - double _double; -}; -typedef union sentry_value_u sentry_value_t; - -/** - * Increments the reference count on the value. - */ -SENTRY_API void sentry_value_incref(sentry_value_t value); - -/** - * Decrements the reference count on the value. - */ -SENTRY_API void sentry_value_decref(sentry_value_t value); - -/** - * Returns the refcount of a value. - */ -SENTRY_API size_t sentry_value_refcount(sentry_value_t value); - -/** - * Freezes a value. - */ -SENTRY_API void sentry_value_freeze(sentry_value_t value); - -/** - * Checks if a value is frozen. - */ -SENTRY_API int sentry_value_is_frozen(sentry_value_t value); - -/** - * Creates a null value. - */ -SENTRY_API sentry_value_t sentry_value_new_null(void); - -/** - * Creates a new 32-bit signed integer value. - */ -SENTRY_API sentry_value_t sentry_value_new_int32(int32_t value); - -/** - * Creates a new double value. - */ -SENTRY_API sentry_value_t sentry_value_new_double(double value); - -/** - * Creates a new boolean value. - */ -SENTRY_API sentry_value_t sentry_value_new_bool(int value); - -/** - * Creates a new null terminated string. - */ -SENTRY_API sentry_value_t sentry_value_new_string(const char *value); - -/** - * Creates a new list value. - */ -SENTRY_API sentry_value_t sentry_value_new_list(void); - -/** - * Creates a new object. - */ -SENTRY_API sentry_value_t sentry_value_new_object(void); - -/** - * Returns the type of the value passed. - */ -SENTRY_API sentry_value_type_t sentry_value_get_type(sentry_value_t value); - -/** - * Sets a key to a value in the map. - * - * This moves the ownership of the value into the map. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_set_by_key( - sentry_value_t value, const char *k, sentry_value_t v); - -/** - * This removes a value from the map by key. - */ -SENTRY_API int sentry_value_remove_by_key(sentry_value_t value, const char *k); - -/** - * Appends a value to a list. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_append(sentry_value_t value, sentry_value_t v); - -/** - * Inserts a value into the list at a certain position. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - * - * If the list is shorter than the given index it's automatically extended - * and filled with `null` values. - */ -SENTRY_API int sentry_value_set_by_index( - sentry_value_t value, size_t index, sentry_value_t v); - -/** - * This removes a value from the list by index. - */ -SENTRY_API int sentry_value_remove_by_index(sentry_value_t value, size_t index); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key_owned( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a list by index. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index( - sentry_value_t value, size_t index); - -/** - * Looks up a value in a list by index. If missing a null value is - * returned. The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index_owned( - sentry_value_t value, size_t index); - -/** - * Returns the length of the given map or list. - * - * If an item is not a list or map the return value is 0. - */ -SENTRY_API size_t sentry_value_get_length(sentry_value_t value); - -/** - * Converts a value into a 32bit signed integer. - */ -SENTRY_API int32_t sentry_value_as_int32(sentry_value_t value); - -/** - * Converts a value into a double value. - */ -SENTRY_API double sentry_value_as_double(sentry_value_t value); - -/** - * Returns the value as c string. - */ -SENTRY_API const char *sentry_value_as_string(sentry_value_t value); - -/** - * Returns `true` if the value is boolean true. - */ -SENTRY_API int sentry_value_is_true(sentry_value_t value); - -/** - * Returns `true` if the value is null. - */ -SENTRY_API int sentry_value_is_null(sentry_value_t value); - -/** - * Serialize a sentry value to JSON. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. - */ -SENTRY_API char *sentry_value_to_json(sentry_value_t value); - -/** - * Sentry levels for events and breadcrumbs. - */ -typedef enum sentry_level_e { - SENTRY_LEVEL_DEBUG = -1, - SENTRY_LEVEL_INFO = 0, - SENTRY_LEVEL_WARNING = 1, - SENTRY_LEVEL_ERROR = 2, - SENTRY_LEVEL_FATAL = 3, -} sentry_level_t; - -/** - * Creates a new empty Event value. - * - * See https://docs.sentry.io/platforms/native/enriching-events/ for how to - * further work with events, and https://develop.sentry.dev/sdk/event-payloads/ - * for a detailed overview of the possible properties of an Event. - */ -SENTRY_API sentry_value_t sentry_value_new_event(void); - -/** - * Creates a new Message Event value. - * - * See https://develop.sentry.dev/sdk/event-payloads/message/ - * - * `logger` can be NULL to omit the logger value. - */ -SENTRY_API sentry_value_t sentry_value_new_message_event( - sentry_level_t level, const char *logger, const char *text); - -/** - * Creates a new Breadcrumb with a specific type and message. - * - * See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ - * - * Either parameter can be NULL in which case no such attributes is created. - */ -SENTRY_API sentry_value_t sentry_value_new_breadcrumb( - const char *type, const char *message); - -/** - * Creates a new Exception value. - * - * This is intended for capturing language-level exception, such as from a - * try-catch block. `type` and `value` here refer to the exception class and - * a possible description. - * - * See https://develop.sentry.dev/sdk/event-payloads/exception/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_exception`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_exception( - const char *type, const char *value); - -/** - * Creates a new Thread value. - * - * See https://develop.sentry.dev/sdk/event-payloads/threads/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_thread`. - * - * `name` can be NULL. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( - uint64_t id, const char *name); - -/** - * Creates a new Stack Trace conforming to the Stack Trace Interface. - * - * See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ - * - * The returned object must be attached to either an exception or thread - * object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_stacktrace( - void **ips, size_t len); - -/** - * Sets the Stack Trace conforming to the Stack Trace Interface in a value. - * - * The value argument must be either an exception or thread object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` stack - * trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_value_set_stacktrace( - sentry_value_t value, void **ips, size_t len); - -/** - * Adds an Exception to an Event value. - * - * This takes ownership of the `exception`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_exception( - sentry_value_t event, sentry_value_t exception); - -/** - * Adds a Thread to an Event value. - * - * This takes ownership of the `thread`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_thread( - sentry_value_t event, sentry_value_t thread); - -/* -- Experimental APIs -- */ - -/** - * Serialize a sentry value to msgpack. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. Since msgpack is not zero terminated - * the size is written to the `size_out` parameter. - */ -SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack( - sentry_value_t value, size_t *size_out); - -/** - * Adds a stack trace to an event. - * - * The stack trace is added as part of a new thread object. - * This function is **deprecated** in favor of using - * `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` - * and `sentry_event_add_thread`. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_value_add_stacktrace( - sentry_value_t event, void **ips, size_t len); - -/** - * This represents the OS dependent user context in the case of a crash, and can - * be used to manually capture a crash. - */ -typedef struct sentry_ucontext_s { -#ifdef _WIN32 - EXCEPTION_POINTERS exception_ptrs; -#else - int signum; - siginfo_t *siginfo; - ucontext_t *user_context; -#endif -} sentry_ucontext_t; - -/** - * Unwinds the stack from the given address. - * - * If the address is given in `addr` the stack is unwound form there. - * Otherwise (NULL is passed) the current instruction pointer is used as - * start address. - * Unwinding with a given `addr` is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( - void *addr, void **stacktrace_out, size_t max_len); - -/** - * Unwinds the stack from the given context. - * - * The caller is responsible to construct an appropriate `sentry_ucontext_t`. - * Unwinding from a user context is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext( - const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len); - -/** - * A UUID - */ -typedef struct sentry_uuid_s { - char bytes[16]; -} sentry_uuid_t; - -/** - * Creates the nil uuid. - */ -SENTRY_API sentry_uuid_t sentry_uuid_nil(void); - -/** - * Creates a new uuid4. - */ -SENTRY_API sentry_uuid_t sentry_uuid_new_v4(void); - -/** - * Parses a uuid from a string. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_string(const char *str); - -/** - * Creates a uuid from bytes. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_bytes(const char bytes[16]); - -/** - * Checks if the uuid is nil. - */ -SENTRY_API int sentry_uuid_is_nil(const sentry_uuid_t *uuid); - -/** - * Returns the bytes of the uuid. - */ -SENTRY_API void sentry_uuid_as_bytes(const sentry_uuid_t *uuid, char bytes[16]); - -/** - * Formats the uuid into a string buffer. - */ -SENTRY_API void sentry_uuid_as_string(const sentry_uuid_t *uuid, char str[37]); - -/** - * A Sentry Envelope. - * - * The Envelope is an abstract type which represents a payload being sent to - * sentry. It can contain one or more items, typically an Event. - * See https://develop.sentry.dev/sdk/envelopes/ - */ -struct sentry_envelope_s; -typedef struct sentry_envelope_s sentry_envelope_t; - -/** - * Frees an envelope. - */ -SENTRY_API void sentry_envelope_free(sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Event if there is one. - * - * This returns a borrowed value to the Event in the Envelope. - */ -SENTRY_API sentry_value_t sentry_envelope_get_event( - const sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Transaction if there is one. - * - * This returns a borrowed value to the Transaction in the Envelope. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( - const sentry_envelope_t *envelope); - -/** - * Serializes the envelope. - * - * The return value needs to be freed with sentry_string_free(). - */ -SENTRY_API char *sentry_envelope_serialize( - const sentry_envelope_t *envelope, size_t *size_out); - -/** - * Serializes the envelope into a file. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_envelope_write_to_file( - const sentry_envelope_t *envelope, const char *path); - -/** - * The Sentry Client Options. - * - * See https://docs.sentry.io/platforms/native/configuration/ - */ -struct sentry_options_s; -typedef struct sentry_options_s sentry_options_t; - -/** - * This represents an interface for user-defined transports. - * - * Transports are responsible for sending envelopes to sentry and are the last - * step in the event pipeline. - * - * Envelopes will be submitted to the transport in a _fire and forget_ fashion, - * and the transport must send those envelopes _in order_. - * - * A transport has the following hooks, all of which - * take the user provided `state` as last parameter. The transport state needs - * to be set with `sentry_transport_set_state` and typically holds handles and - * other information that can be reused across requests. - * - * * `send_func`: This function will take ownership of an envelope, and is - * responsible for freeing it via `sentry_envelope_free`. - * * `startup_func`: This hook will be called by sentry inside of `sentry_init` - * and instructs the transport to initialize itself. Failures will bubble up - * to `sentry_init`. - * * `flush_func`: Instructs the transport to flush its queue. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport queue is flushed within the timeout. - * * `shutdown_func`: Instructs the transport to flush its queue and shut down. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport is flushed and shut down successfully. - * In case of a non-zero return value, sentry will log an error, but continue - * with freeing the transport. - * * `free_func`: Frees the transports `state`. This hook might be called even - * though `shutdown_func` returned a failure code previously. - * - * The transport interface might be extended in the future with hooks to flush - * its internal queue without shutting down, and to dump its internal queue to - * disk in case of a hard crash. - */ -struct sentry_transport_s; -typedef struct sentry_transport_s sentry_transport_t; - -/** - * Creates a new transport with an initial `send_func`. - */ -SENTRY_API sentry_transport_t *sentry_transport_new( - void (*send_func)(sentry_envelope_t *envelope, void *state)); - -/** - * Sets the transport `state`. - * - * If the state is owned by the transport and needs to be freed, use - * `sentry_transport_set_free_func` to set an appropriate hook. - */ -SENTRY_API void sentry_transport_set_state( - sentry_transport_t *transport, void *state); - -/** - * Sets the transport hook to free the transport `state`. - */ -SENTRY_API void sentry_transport_set_free_func( - sentry_transport_t *transport, void (*free_func)(void *state)); - -/** - * Sets the transport startup hook. - * - * This hook is called from within `sentry_init` and will get a reference to the - * options which can be used to initialize a transports internal state. - * It should return `0` on success. A failure will bubble up to `sentry_init`. - */ -SENTRY_API void sentry_transport_set_startup_func(sentry_transport_t *transport, - int (*startup_func)(const sentry_options_t *options, void *state)); - -/** - * Sets the transport flush hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` if all the pending envelopes are - * sent within the timeout, or `1` if the timeout is hit. - */ -SENTRY_API void sentry_transport_set_flush_func(sentry_transport_t *transport, - int (*flush_func)(uint64_t timeout, void *state)); - -/** - * Sets the transport shutdown hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` on success in case all the pending envelopes have been - * sent within the timeout, or `1` if the timeout was hit. - */ -SENTRY_API void sentry_transport_set_shutdown_func( - sentry_transport_t *transport, - int (*shutdown_func)(uint64_t timeout, void *state)); - -/** - * Generic way to free a transport. - */ -SENTRY_API void sentry_transport_free(sentry_transport_t *transport); - -/** - * Create a new function transport. - * - * It is a convenience function which works with a borrowed `data`, and will - * automatically free the envelope, so the user provided function does not need - * to do that. - * - * This function is *deprecated* and will be removed in a future version. - * It is here for backwards compatibility. Users should migrate to the - * `sentry_transport_new` API. - */ -SENTRY_API sentry_transport_t *sentry_new_function_transport( - void (*func)(const sentry_envelope_t *envelope, void *data), void *data); - -/** - * This represents an interface for user-defined backends. - * - * Backends are responsible to handle crashes. They are maintained at runtime - * via various life-cycle hooks from the sentry-core. - * - * At this point none of those interfaces are exposed in the API including - * creation and destruction. The main use-case of the backend in the API at this - * point is to disable it via `sentry_options_set_backend` at runtime before it - * is initialized. - */ -struct sentry_backend_s; -typedef struct sentry_backend_s sentry_backend_t; - -/* -- Options APIs -- */ - -/** - * The state of user consent. - */ -typedef enum { - SENTRY_USER_CONSENT_UNKNOWN = -1, - SENTRY_USER_CONSENT_GIVEN = 1, - SENTRY_USER_CONSENT_REVOKED = 0, -} sentry_user_consent_t; - -/** - * Creates a new options struct. - * Can be freed with `sentry_options_free`. - */ -SENTRY_API sentry_options_t *sentry_options_new(void); - -/** - * Deallocates previously allocated sentry options. - */ -SENTRY_API void sentry_options_free(sentry_options_t *opts); - -/** - * Sets a transport. - */ -SENTRY_API void sentry_options_set_transport( - sentry_options_t *opts, sentry_transport_t *transport); - -/** - * Type of the `before_send` callback. - * - * The callback takes ownership of the `event`, and should usually return that - * same event. In case the event should be discarded, the callback needs to - * call `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * If you have set an `on_crash` callback (independent of whether it discards or - * retains the event), `before_send` will no longer be invoked for crash-events, - * which allows you to better distinguish between crashes and all other events - * in client-side pre-processing. - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Up to version 0.4.18 the `before_send` callback wasn't invoked in case the - * event sampling discarded an event. In the current implementation the - * `before_send` callback is invoked even if the event sampling discards the - * event, following the cross-SDK session filter order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - */ -typedef sentry_value_t (*sentry_event_function_t)( - sentry_value_t event, void *hint, void *closure); - -/** - * Sets the `before_send` callback. - * - * See the `sentry_event_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_before_send( - sentry_options_t *opts, sentry_event_function_t func, void *data); - -/** - * Type of the `on_crash` callback. - * - * The `on_crash` callback replaces the `before_send` callback for crash events. - * The interface is analogous to `before_send` in that the callback takes - * ownership of the `event`, and should usually return that same event. In case - * the event should be discarded, the callback needs to call - * `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * Only the `inproc` backend currently fills the passed-in event with useful - * data and processes any modifications to the return value. Since both - * `breakpad` and `crashpad` use minidumps to capture the crash state, the - * passed-in event is empty when using these backends, and they ignore any - * changes to the return value. - * - * If you set this callback in the options, it prevents a concurrently enabled - * `before_send` callback from being invoked in the crash case. This allows for - * better differentiation between crashes and other events and gradual migration - * from existing `before_send` implementations: - * - * - if you have a `before_send` implementation and do not define an `on_crash` - * callback your application will receive both normal and crash events as - * before - * - if you have a `before_send` implementation but only want to handle normal - * events with it, then you can define an `on_crash` callback that returns - * the passed-in event and does nothing else - * - if you are not interested in normal events, but only want to act on - * crashes (within the limits mentioned below), then only define an - * `on_crash` callback with the option to filter (on all backends) or enrich - * (only inproc) the crash event - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Platform-specific behavior: - * - * - does not work with crashpad on macOS. - * - for breakpad on Linux the `uctx` parameter is always NULL. - */ -typedef sentry_value_t (*sentry_crash_function_t)( - const sentry_ucontext_t *uctx, sentry_value_t event, void *closure); - -/** - * Sets the `on_crash` callback. - * - * See the `sentry_crash_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_on_crash( - sentry_options_t *opts, sentry_crash_function_t func, void *data); - -/** - * Sets the DSN. - */ -SENTRY_API void sentry_options_set_dsn(sentry_options_t *opts, const char *dsn); - -/** - * Gets the DSN. - */ -SENTRY_API const char *sentry_options_get_dsn(const sentry_options_t *opts); - -/** - * Sets the sample rate, which should be a double between `0.0` and `1.0`. - * Sentry will randomly discard any event that is captured using - * `sentry_capture_event` when a sample rate < 1 is set. - * - * The sampling happens at the end of the event processing according to the - * following order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - * - * Only items 3. to 6. are currently applicable to sentry-native. This means - * each processing step is executed even if the sampling discards the event - * before sending it to the backend. This is particularly relevant to users of - * the `before_send` callback. - * - * The above is in contrast to versions up to 0.4.18 where the sampling happened - * at the beginning of the processing/filter sequence. - */ -SENTRY_API void sentry_options_set_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Gets the sample rate. - */ -SENTRY_API double sentry_options_get_sample_rate(const sentry_options_t *opts); - -/** - * Sets the release. - */ -SENTRY_API void sentry_options_set_release( - sentry_options_t *opts, const char *release); - -/** - * Gets the release. - */ -SENTRY_API const char *sentry_options_get_release(const sentry_options_t *opts); - -/** - * Sets the environment. - */ -SENTRY_API void sentry_options_set_environment( - sentry_options_t *opts, const char *environment); - -/** - * Gets the environment. - */ -SENTRY_API const char *sentry_options_get_environment( - const sentry_options_t *opts); - -/** - * Sets the dist. - */ -SENTRY_API void sentry_options_set_dist( - sentry_options_t *opts, const char *dist); - -/** - * Gets the dist. - */ -SENTRY_API const char *sentry_options_get_dist(const sentry_options_t *opts); - -/** - * Configures the http proxy. - * - * The given proxy has to include the full scheme, eg. `http://some.proxy/`. - */ -SENTRY_API void sentry_options_set_http_proxy( - sentry_options_t *opts, const char *proxy); - -/** - * Returns the configured http proxy. - */ -SENTRY_API const char *sentry_options_get_http_proxy( - const sentry_options_t *opts); - -/** - * Configures the path to a file containing ssl certificates for - * verification. - */ -SENTRY_API void sentry_options_set_ca_certs( - sentry_options_t *opts, const char *path); - -/** - * Returns the configured path for ca certificates. - */ -SENTRY_API const char *sentry_options_get_ca_certs( - const sentry_options_t *opts); - -/** - * Configures the name of the http transport thread. - */ -SENTRY_API void sentry_options_set_transport_thread_name( - sentry_options_t *opts, const char *name); - -/** - * Returns the configured http transport thread name. - */ -SENTRY_API const char *sentry_options_get_transport_thread_name( - const sentry_options_t *opts); - -/** - * Enables or disables debug printing mode. - */ -SENTRY_API void sentry_options_set_debug(sentry_options_t *opts, int debug); - -/** - * Returns the current value of the debug flag. - */ -SENTRY_API int sentry_options_get_debug(const sentry_options_t *opts); - -/** - * Sets the number of breadcrumbs being tracked and attached to events. - * - * Defaults to 100. - */ -SENTRY_API void sentry_options_set_max_breadcrumbs( - sentry_options_t *opts, size_t max_breadcrumbs); - -/** - * Gets the number of breadcrumbs being tracked and attached to events. - */ -SENTRY_API size_t sentry_options_get_max_breadcrumbs( - const sentry_options_t *opts); - -/** - * Type of the callback for logger function. - */ -typedef void (*sentry_logger_function_t)( - sentry_level_t level, const char *message, va_list args, void *userdata); - -/** - * Sets the sentry-native logger function. - * - * Used for logging debug events when the `debug` option is set to true. - */ -SENTRY_API void sentry_options_set_logger( - sentry_options_t *opts, sentry_logger_function_t func, void *userdata); - -/** - * Enables or disables automatic session tracking. - * - * Automatic session tracking is enabled by default and is equivalent to calling - * `sentry_start_session` after startup. - * There can only be one running session, and the current session will always be - * closed implicitly by `sentry_close`, when starting a new session with - * `sentry_start_session`, or manually by calling `sentry_end_session`. - */ -SENTRY_API void sentry_options_set_auto_session_tracking( - sentry_options_t *opts, int val); - -/** - * Returns true if automatic session tracking is enabled. - */ -SENTRY_API int sentry_options_get_auto_session_tracking( - const sentry_options_t *opts); - -/** - * Enables or disables user consent requirements for uploads. - * - * This disables uploads until the user has given the consent to the SDK. - * Consent itself is given with `sentry_user_consent_give` and - * `sentry_user_consent_revoke`. - */ -SENTRY_API void sentry_options_set_require_user_consent( - sentry_options_t *opts, int val); - -/** - * Returns true if user consent is required. - */ -SENTRY_API int sentry_options_get_require_user_consent( - const sentry_options_t *opts); - -/** - * Enables or disables on-device symbolication of stack traces. - * - * This feature can have a performance impact, and is enabled by default on - * Android. It is usually only needed when it is not possible to provide debug - * information files for system libraries which are needed for serverside - * symbolication. - */ -SENTRY_API void sentry_options_set_symbolize_stacktraces( - sentry_options_t *opts, int val); - -/** - * Returns true if on-device symbolication of stack traces is enabled. - */ -SENTRY_API int sentry_options_get_symbolize_stacktraces( - const sentry_options_t *opts); - -/** - * Adds a new attachment to be sent along. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_add_attachmentw` - * instead. - */ -SENTRY_API void sentry_options_add_attachment( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the crashpad handler if the crashpad backend is used. - * - * The path defaults to the `crashpad_handler`/`crashpad_handler.exe` - * executable, depending on platform, which is expected to be present in the - * same directory as the app executable. - * - * It is recommended that library users set an explicit handler path, depending - * on the directory/executable structure of their app. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_set_handler_pathw` - * instead. - */ -SENTRY_API void sentry_options_set_handler_path( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the Sentry Database Directory. - * - * Sentry will use this path to persist user consent, sessions, and other - * artifacts in case of a crash. This will also be used by the crashpad backend - * if it is configured. - * - * The directory is used for "cached" data, which needs to persist across - * application restarts to ensure proper flagging of release-health sessions, - * but might otherwise be safely purged regularly. - * - * It is roughly equivalent to the type of `AppData/Local` on Windows and - * `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other - * platforms. - * - * It is recommended that users set an explicit absolute path, depending - * on their apps runtime directory. The path will be created if it does not - * exist, and will be resolved to an absolute path inside of `sentry_init`. The - * directory should not be shared with other application data/configuration, as - * sentry-native will enumerate and possibly delete files in that directory. An - * example might be `$XDG_CACHE_HOME/your-app/sentry` - * - * If no explicit path it set, sentry-native will default to `.sentry-native` in - * the current working directory, with no specific platform-specific handling. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use - * `sentry_options_set_database_pathw` instead. - */ -SENTRY_API void sentry_options_set_database_path( - sentry_options_t *opts, const char *path); - -#ifdef SENTRY_PLATFORM_WINDOWS -/** - * Wide char version of `sentry_options_add_attachment`. - */ -SENTRY_API void sentry_options_add_attachmentw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_handler_path`. - */ -SENTRY_API void sentry_options_set_handler_pathw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_database_path`. - */ -SENTRY_API void sentry_options_set_database_pathw( - sentry_options_t *opts, const wchar_t *path); -#endif - -/** - * Enables forwarding to the system crash reporter. Disabled by default. - * - * This setting only has an effect when using Crashpad on macOS. If enabled, - * Crashpad forwards crashes to the macOS system crash reporter. Depending - * on the crash, this may impact the crash time. Even if enabled, Crashpad - * may choose not to forward certain crashes. - */ -SENTRY_API void sentry_options_set_system_crash_reporter_enabled( - sentry_options_t *opts, int enabled); - -/** - * Sets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API void sentry_options_set_shutdown_timeout( - sentry_options_t *opts, uint64_t shutdown_timeout); - -/** - * Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts); - -/** - * Sets a user-defined backend. - * - * Since creation and destruction of backends is not exposed in the API, this - * can only be used to set the backend to `NULL`, which disables the backend in - * the initialization. - */ -SENTRY_API void sentry_options_set_backend( - sentry_options_t *opts, sentry_backend_t *backend); - -/* -- Global APIs -- */ - -/** - * Initializes the Sentry SDK with the specified options. - * - * This takes ownership of the options. After the options have been set - * they cannot be modified any more. - * Depending on the configured transport and backend, this function might not be - * fully thread-safe. - * Returns 0 on success. - */ -SENTRY_API int sentry_init(sentry_options_t *options); - -/** - * Instructs the transport to flush its send queue. - * - * The `timeout` parameter is in milliseconds. - * - * Returns 0 on success, or a non-zero return value in case the timeout is hit. - */ -SENTRY_API int sentry_flush(uint64_t timeout); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_close(void); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * This is a **deprecated** alias for `sentry_close`. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_shutdown(void); - -/** - * This will lazily load and cache a list of all the loaded libraries. - * - * Returns a new reference to an immutable, frozen list. - * The reference must be released with `sentry_value_decref`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_get_modules_list(void); - -/** - * Clears the internal module cache. - * - * For performance reasons, sentry will cache the list of loaded libraries when - * capturing events. This cache can get out-of-date when loading or unloading - * libraries at runtime. It is therefore recommended to call - * `sentry_clear_modulecache` when doing so, to make sure that the next call to - * `sentry_capture_event` will have an up-to-date module list. - */ -SENTRY_EXPERIMENTAL_API void sentry_clear_modulecache(void); - -/** - * Re-initializes the Sentry backend. - * - * This is needed if a third-party library overrides the previously installed - * signal handler. Calling this function can be potentially dangerous and should - * only be done when necessary. - * - * Returns 0 on success. - */ -SENTRY_EXPERIMENTAL_API int sentry_reinstall_backend(void); - -/** - * Gives user consent. - */ -SENTRY_API void sentry_user_consent_give(void); - -/** - * Revokes user consent. - */ -SENTRY_API void sentry_user_consent_revoke(void); - -/** - * Resets the user consent (back to unknown). - */ -SENTRY_API void sentry_user_consent_reset(void); - -/** - * Checks the current state of user consent. - */ -SENTRY_API sentry_user_consent_t sentry_user_consent_get(void); - -/** - * Sends a sentry event. - * - * If returns a nil UUID if the event being passed in is a transaction, and the - * transaction will not be sent nor consumed. `sentry_transaction_finish` should - * be used to send transactions. - */ -SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event); - -/** - * Captures an exception to be handled by the backend. - * - * This is safe to be called from a crashing thread and may not return. - */ -SENTRY_EXPERIMENTAL_API void sentry_handle_exception( - const sentry_ucontext_t *uctx); - -/** - * Adds the breadcrumb to be sent in case of an event. - */ -SENTRY_API void sentry_add_breadcrumb(sentry_value_t breadcrumb); - -/** - * Sets the specified user. - */ -SENTRY_API void sentry_set_user(sentry_value_t user); - -/** - * Removes a user. - */ -SENTRY_API void sentry_remove_user(void); - -/** - * Sets a tag. - */ -SENTRY_API void sentry_set_tag(const char *key, const char *value); - -/** - * Removes the tag with the specified key. - */ -SENTRY_API void sentry_remove_tag(const char *key); - -/** - * Sets extra information. - */ -SENTRY_API void sentry_set_extra(const char *key, sentry_value_t value); - -/** - * Removes the extra with the specified key. - */ -SENTRY_API void sentry_remove_extra(const char *key); - -/** - * Sets a context object. - */ -SENTRY_API void sentry_set_context(const char *key, sentry_value_t value); - -/** - * Removes the context object with the specified key. - */ -SENTRY_API void sentry_remove_context(const char *key); - -/** - * Sets the event fingerprint. - * - * This accepts a variable number of arguments, and needs to be terminated by a - * trailing `NULL`. - */ -SENTRY_API void sentry_set_fingerprint(const char *fingerprint, ...); - -/** - * Removes the fingerprint. - */ -SENTRY_API void sentry_remove_fingerprint(void); - -/** - * Sets the transaction. - */ -SENTRY_API void sentry_set_transaction(const char *transaction); - -/** - * Sets the event level. - */ -SENTRY_API void sentry_set_level(sentry_level_t level); - -/** - * Starts a new session. - */ -SENTRY_API void sentry_start_session(void); - -/** - * Ends a session. - */ -SENTRY_API void sentry_end_session(void); - -/** - * Sets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_max_spans( - sentry_options_t *opts, size_t max_spans); - -/** - * Gets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_options_get_max_spans( - sentry_options_t *opts); - -/** - * Sets the sample rate for transactions. Should be a double between - * `0.0` and `1.0`. Transactions will be randomly discarded during - * `sentry_transaction_finish` when the sample rate is < 1.0. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Returns the sample rate for transactions. - */ -SENTRY_EXPERIMENTAL_API double sentry_options_get_traces_sample_rate( - sentry_options_t *opts); - -/* -- Performance Monitoring/Tracing APIs -- */ - -/** - * A sentry Transaction Context. - * - * See Transaction Interface under - * https://develop.sentry.dev/sdk/performance/#new-span-and-transaction-classes - */ -struct sentry_transaction_context_s; -typedef struct sentry_transaction_context_s sentry_transaction_context_t; - -/** - * A sentry Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/transaction/ - */ -struct sentry_transaction_s; -typedef struct sentry_transaction_s sentry_transaction_t; - -/** - * A sentry Span. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ - */ -struct sentry_span_s; -typedef struct sentry_span_s sentry_span_t; - -/** - * Constructs a new Transaction Context. The returned value needs to be passed - * into `sentry_transaction_start` in order to be recorded and sent to sentry. - * - * See - * https://docs.sentry.io/platforms/native/enriching-events/transaction-name/ - * for an explanation of a Transaction's `name`, and - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around an `operation`'s value. - * - * Also see https://develop.sentry.dev/sdk/event-payloads/transaction/#anatomy - * for an explanation of `operation`, in addition to other properties and - * actions that can be performed on a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction Context - * if it needs to be mutated across threads. Methods operating on the - * Transaction Context will mention what kind of expectations they carry if they - * need to mutate or access the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * -sentry_transaction_context_new(const char *name, const char *operation); - -/** - * Sets the `name` on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * The Transaction Context should not be mutated by other functions while - * setting a name on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name( - sentry_transaction_context_t *tx_cxt, const char *name); - -/** - * Sets the `operation` on a Transaction Context, which will be used in the - * Transaction constructed off of the context - * - * See https://develop.sentry.dev/sdk/performance/span-operations/ for - * conventions on `operation`s. - * - * The Transaction Context should not be mutated by other functions while - * setting an operation on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation( - sentry_transaction_context_t *tx_cxt, const char *operation); - -/** - * Sets the `sampled` field on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * When passed any value above 0, the Transaction will bypass all sampling - * options and always be sent to sentry. If passed 0, this Transaction and its - * child spans will never be sent to sentry. - * - * The Transaction Context should not be mutated by other functions while - * setting `sampled` on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_sampled( - sentry_transaction_context_t *tx_cxt, int sampled); - -/** - * Removes the `sampled` field on a Transaction Context, which will be used in - * the Transaction constructed off of the context. - * - * The Transaction will use the sampling rate as defined in `sentry_options`. - * - * The Transaction Context should not be mutated by other functions while - * removing `sampled`. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_remove_sampled( - sentry_transaction_context_t *tx_cxt); - -/** - * Update the Transaction Context with the given HTTP header key/value pair. - * - * This is used to propagate distributed tracing metadata from upstream - * services. Therefore, the headers of incoming requests should be fed into this - * function so that sentry is able to continue a trace that was started by an - * upstream service. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header( - sentry_transaction_context_t *tx_cxt, const char *key, const char *value); - -/** - * Starts a new Transaction based on the provided context, restored from an - * external integration (i.e. a span from a different SDK) or manually - * constructed by a user. - * - * The second parameter is a custom Sampling Context to be used with a Traces - * Sampler to make a more informed sampling decision. The SDK does not currently - * support a custom Traces Sampler and this parameter is ignored for the time - * being but needs to be provided. - * - * Returns a Transaction, which is expected to be manually managed by the - * caller. Manual management involves ensuring that `sentry_transaction_finish` - * is invoked for the Transaction, and that the caller manually starts and - * finishes any child Spans as needed on the Transaction. - * - * Not invoking `sentry_transaction_finish` with the returned Transaction means - * it will be discarded, and will not be sent to sentry. - * - * To ensure that any Events or Message Events are associated with this - * Transaction while it is active, invoke and pass in the Transaction returned - * by this function to `sentry_set_transaction_object`. Further documentation on - * this can be found in `sentry_set_transaction_object`'s docstring. - * - * Takes ownership of `transaction_context`. A Transaction Context cannot be - * modified or re-used after it is used to start a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction if it - * needs to be mutated across threads. Methods operating on the Transaction will - * mention what kind of expectations they carry if they need to mutate or access - * the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start( - sentry_transaction_context_t *tx_cxt, sentry_value_t sampling_ctx); - -/** - * Finishes and sends a Transaction to sentry. The event ID of the Transaction - * will be returned if this was successful; A nil UUID will be returned - * otherwise. - * - * Always takes ownership of `transaction`, regardless of whether the operation - * was successful or not. A Transaction cannot be modified or re-used after it - * is finished. - */ -SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish( - sentry_transaction_t *tx); - -/** - * Sets the Transaction so any Events sent while the Transaction - * is active will be associated with the Transaction. - * - * If the Transaction being passed in is unsampled, it will still be associated - * with any new Events. This will lead to some Events pointing to orphan or - * missing traces in sentry, see - * https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#orphan-traces-and-broken-subtraces - * - * This increases the number of references pointing to the Transaction. Invoke - * `sentry_transaction_finish` to remove the Transaction set by this function as - * well as its reference by passing in the same Transaction as the one passed - * into this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_transaction_object( - sentry_transaction_t *tx); - -/** - * Sets the Span so any Events sent while the Span - * is active will be associated with the Span. - * - * This increases the number of references pointing to the Span. Invoke - * `sentry_span_finish` to remove the Span set by this function as well - * as its reference by passing in the same Span as the one passed into - * this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_span(sentry_span_t *span); - -/** - * Starts a new Span. - * - * The return value of `sentry_transaction_start` should be passed in as - * `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * This increases the number of references pointing to the Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child( - sentry_transaction_t *parent, char *operation, char *description); - -/** - * Starts a new Span. - * - * The return value of `sentry_span_start_child` may be passed in as `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child( - sentry_span_t *parent, char *operation, char *description); - -/** - * Finishes a Span. - * - * This takes ownership of `span`. A Span cannot be modified or re-used after it - * is finished. - * - * This will mutate the `span`'s containing Transaction, so the containing - * Transaction should also not be mutated by other functions when finishing a - * span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_finish(sentry_span_t *span); - -/** - * Sets a tag on a Transaction to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Transaction should not be mutated by other functions while a tag is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag( - sentry_transaction_t *transaction, const char *tag, const char *value); - -/** - * Removes a tag from a Transaction. - * - * The Transaction should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag( - sentry_transaction_t *transaction, const char *tag); - -/** - * Sets the given key in a Transaction's "data" section to the given value. - * - * The Transaction should not be mutated by other functions while data is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data( - sentry_transaction_t *transaction, const char *key, sentry_value_t value); - -/** - * Removes a key from a Transaction's "data" section. - * - * The Transaction should not be mutated by other functions while data is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data( - sentry_transaction_t *transaction, const char *key); - -/** - * Sets a tag on a Span to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Span should not be mutated by other functions while a tag is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_tag( - sentry_span_t *span, const char *tag, const char *value); - -/** - * Removes a tag from a Span. - * - * The Span should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag( - sentry_span_t *span, const char *tag); - -/** - * Sets the given key in a Span's "data" section to the given value. - * - * The Span should not be mutated by other functions while data is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_data( - sentry_span_t *span, const char *key, sentry_value_t value); - -/** - * Removes a key from a Span's "data" section. - * - * The Span should not be mutated by other functions while data is being removed - * from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_data( - sentry_span_t *span, const char *key); - -/** - * Sets a Transaction's name. - * - * The Transaction should not be mutated by other functions while setting its - * name. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name( - sentry_transaction_t *transaction, const char *name); - -/** - * The status of a Span or Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for documentation. - */ -typedef enum { - // The operation completed successfully. - // HTTP status 100..299 + successful redirects from the 3xx range. - SENTRY_SPAN_STATUS_OK, - // The operation was cancelled (typically by the user). - SENTRY_SPAN_STATUS_CANCELLED, - // Unknown. Any non-standard HTTP status code. - // "We do not know whether the transaction failed or succeeded." - SENTRY_SPAN_STATUS_UNKNOWN, - // Client specified an invalid argument. 4xx. - // Note that this differs from FailedPrecondition. InvalidArgument - // indicates arguments that are problematic regardless of the - // state of the system. - SENTRY_SPAN_STATUS_INVALID_ARGUMENT, - // Deadline expired before operation could complete. - // For operations that change the state of the system, this error may be - // returned even if the operation has been completed successfully. - // HTTP redirect loops and 504 Gateway Timeout. - SENTRY_SPAN_STATUS_DEADLINE_EXCEEDED, - // 404 Not Found. Some requested entity (file or directory) was not found. - SENTRY_SPAN_STATUS_NOT_FOUND, - // Already exists (409) - // Some entity that we attempted to create already exists. - SENTRY_SPAN_STATUS_ALREADY_EXISTS, - // 403 Forbidden - // The caller does not have permission to execute the specified operation. - SENTRY_SPAN_STATUS_PERMISSION_DENIED, - // 429 Too Many Requests - // Some resource has been exhausted, perhaps a per-user quota or perhaps - // the entire file system is out of space. - SENTRY_SPAN_STATUS_RESOURCE_EXHAUSTED, - // Operation was rejected because the system is not in a state required for - // the operation's execution. - SENTRY_SPAN_STATUS_FAILED_PRECONDITION, - // The operation was aborted, typically due to a concurrency issue. - SENTRY_SPAN_STATUS_ABORTED, - // Operation was attempted past the valid range. - SENTRY_SPAN_STATUS_OUT_OF_RANGE, - // 501 Not Implemented - // Operation is not implemented or not enabled. - SENTRY_SPAN_STATUS_UNIMPLEMENTED, - // Other/generic 5xx - SENTRY_SPAN_STATUS_INTERNAL_ERROR, - // 503 Service Unavailable - SENTRY_SPAN_STATUS_UNAVAILABLE, - // Unrecoverable data loss or corruption - SENTRY_SPAN_STATUS_DATA_LOSS, - // 401 Unauthorized (actually does mean unauthenticated according to RFC - // 7235) - // Prefer PermissionDenied if a user is logged in. - SENTRY_SPAN_STATUS_UNAUTHENTICATED, -} sentry_span_status_t; - -/** - * Sets a Span's status. - * - * The Span should not be mutated by other functions while setting its status. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_status( - sentry_span_t *span, sentry_span_status_t status); - -/** - * Sets a Transaction's status. - * - * The Transaction should not be mutated by other functions while setting its - * status. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_status( - sentry_transaction_t *tx, sentry_span_status_t status); - -/** - * Type of the `iter_headers` callback. - * - * The callback is being called with HTTP header key/value pairs. - * These headers can be attached to outgoing HTTP requests to propagate - * distributed tracing metadata to downstream services. - * - */ -typedef void (*sentry_iter_headers_function_t)( - const char *key, const char *value, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_iter_headers(sentry_span_t *span, - sentry_iter_headers_function_t callback, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers( - sentry_transaction_t *tx, sentry_iter_headers_function_t callback, - void *userdata); - -/** - * Returns whether the application has crashed on the last run. - * - * Notes: - * * The underlying value is set by sentry_init() - it must be called first. - * * Call sentry_clear_crashed_last_run() to reset for the next app run. - * - * Possible return values: - * 1 = the last run was a crash - * 0 = no crash recognized - * -1 = sentry_init() hasn't been called yet - */ -SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(); - -/** - * Clear the status of the "crashed-last-run". You should explicitly call - * this after sentry_init() if you're using sentry_get_crashed_last_run(). - * Otherwise, the same information is reported on any subsequent runs. - * - * Notes: - * * This doesn't change the value of sentry_get_crashed_last_run() yet. - * However, if sentry_init() is called again, the value will change. - * * This may only be called after sentry_init() and before sentry_close(). - * - * Returns 0 on success, 1 on error. - */ -SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(); - -/** - * Sentry SDK version. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(); - -/** - * Sentry SDK name. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(); - -/** - * Sentry SDK User-Agent. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/plugin-dev/Source/ThirdParty/Mac/bin/crashpad_handler b/plugin-dev/Source/ThirdParty/Mac/bin/crashpad_handler deleted file mode 100755 index b5b77bedf..000000000 Binary files a/plugin-dev/Source/ThirdParty/Mac/bin/crashpad_handler and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib b/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib deleted file mode 100755 index 221fac4c2..000000000 Binary files a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Info.plist b/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Info.plist deleted file mode 100644 index 76e35e877..000000000 --- a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - com.apple.xcode.dsym.libsentry.dylib - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - dSYM - CFBundleSignature - ???? - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Resources/DWARF/libsentry.dylib b/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Resources/DWARF/libsentry.dylib deleted file mode 100644 index 1221c605c..000000000 Binary files a/plugin-dev/Source/ThirdParty/Mac/bin/libsentry.dylib.dSYM/Contents/Resources/DWARF/libsentry.dylib and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Mac/include/sentry.h b/plugin-dev/Source/ThirdParty/Mac/include/sentry.h deleted file mode 100644 index 44a0f878f..000000000 --- a/plugin-dev/Source/ThirdParty/Mac/include/sentry.h +++ /dev/null @@ -1,1874 +0,0 @@ -/** - * sentry-native - * - * sentry-native is a C client to send events to native from - * C and C++ applications. It can work together with breakpad/crashpad - * but also send events on its own. - * - * NOTE on encodings: - * - * Sentry will assume an encoding of UTF-8 for all string data that is captured - * and being sent to sentry as an Event. - * All the functions that are dealing with *paths* will assume an OS-specific - * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on - * Linux; and they provide wchar-compatible alternatives on Windows which are - * preferred. - */ - -#ifndef SENTRY_H_INCLUDED -#define SENTRY_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* SDK Version */ -#ifndef SENTRY_SDK_NAME -# ifdef __ANDROID__ -# define SENTRY_SDK_NAME "sentry.native.android" -# else -# define SENTRY_SDK_NAME "sentry.native" -# endif -#endif -#define SENTRY_SDK_VERSION "0.5.0" -#define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION - -/* common platform detection */ -#ifdef _WIN32 -# define SENTRY_PLATFORM_WINDOWS -#elif defined(__APPLE__) -# include -# if defined(TARGET_OS_OSX) && TARGET_OS_OSX -# define SENTRY_PLATFORM_MACOS -# elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE -# define SENTRY_PLATFORM_IOS -# endif -# define SENTRY_PLATFORM_DARWIN -# define SENTRY_PLATFORM_UNIX -#elif defined(__ANDROID__) -# define SENTRY_PLATFORM_ANDROID -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(__linux) || defined(__linux__) -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(_AIX) -/* IBM i PASE is also counted as AIX */ -# define SENTRY_PLATFORM_AIX -# define SENTRY_PLATFORM_UNIX -#else -# error unsupported platform -#endif - -/* marks a function as part of the sentry API */ -#ifndef SENTRY_API -# ifdef _WIN32 -# if defined(SENTRY_BUILD_SHARED) /* build dll */ -# define SENTRY_API __declspec(dllexport) -# elif !defined(SENTRY_BUILD_STATIC) /* use dll */ -# define SENTRY_API __declspec(dllimport) -# else /* static library */ -# define SENTRY_API -# endif -# else -# if __GNUC__ >= 4 -# define SENTRY_API __attribute__((visibility("default"))) -# else -# define SENTRY_API -# endif -# endif -#endif - -/* marks a function as experimental api */ -#ifndef SENTRY_EXPERIMENTAL_API -# define SENTRY_EXPERIMENTAL_API SENTRY_API -#endif - -#include -#include -#include - -/* context type dependencies */ -#ifdef _WIN32 -# include -#else -# include -#endif - -/** - * The library internally uses the system malloc and free functions to manage - * memory. It does not use realloc. The reason for this is that on unix - * platforms we fall back to a simplistic page allocator once we have - * encountered a SIGSEGV or other terminating signal as malloc is no longer - * safe to use. Since we cannot portably reallocate allocations made on the - * pre-existing allocator we're instead not using realloc. - * - * Note also that after SIGSEGV sentry_free() becomes a noop. - */ - -/** - * Allocates memory with the underlying allocator. - */ -SENTRY_API void *sentry_malloc(size_t size); - -/** - * Releases memory allocated from the underlying allocator. - */ -SENTRY_API void sentry_free(void *ptr); - -/** - * Legacy function. Alias for `sentry_free`. - */ -#define sentry_string_free sentry_free - -/* -- Protocol Value API -- */ - -/** - * Type of a sentry value. - */ -typedef enum { - SENTRY_VALUE_TYPE_NULL, - SENTRY_VALUE_TYPE_BOOL, - SENTRY_VALUE_TYPE_INT32, - SENTRY_VALUE_TYPE_DOUBLE, - SENTRY_VALUE_TYPE_STRING, - SENTRY_VALUE_TYPE_LIST, - SENTRY_VALUE_TYPE_OBJECT, -} sentry_value_type_t; - -/** - * Represents a sentry protocol value. - * - * The members of this type should never be accessed. They are only here - * so that alignment for the type can be properly determined. - * - * Values must be released with `sentry_value_decref`. This lowers the - * internal refcount by one. If the refcount hits zero it's freed. Some - * values like primitives have no refcount (like null) so operations on - * those are no-ops. - * - * In addition values can be frozen. Some values like primitives are always - * frozen but lists and dicts are not and can be frozen on demand. This - * automatically happens for some shared values in the event payload like - * the module list. - */ -union sentry_value_u { - uint64_t _bits; - double _double; -}; -typedef union sentry_value_u sentry_value_t; - -/** - * Increments the reference count on the value. - */ -SENTRY_API void sentry_value_incref(sentry_value_t value); - -/** - * Decrements the reference count on the value. - */ -SENTRY_API void sentry_value_decref(sentry_value_t value); - -/** - * Returns the refcount of a value. - */ -SENTRY_API size_t sentry_value_refcount(sentry_value_t value); - -/** - * Freezes a value. - */ -SENTRY_API void sentry_value_freeze(sentry_value_t value); - -/** - * Checks if a value is frozen. - */ -SENTRY_API int sentry_value_is_frozen(sentry_value_t value); - -/** - * Creates a null value. - */ -SENTRY_API sentry_value_t sentry_value_new_null(void); - -/** - * Creates a new 32-bit signed integer value. - */ -SENTRY_API sentry_value_t sentry_value_new_int32(int32_t value); - -/** - * Creates a new double value. - */ -SENTRY_API sentry_value_t sentry_value_new_double(double value); - -/** - * Creates a new boolean value. - */ -SENTRY_API sentry_value_t sentry_value_new_bool(int value); - -/** - * Creates a new null terminated string. - */ -SENTRY_API sentry_value_t sentry_value_new_string(const char *value); - -/** - * Creates a new list value. - */ -SENTRY_API sentry_value_t sentry_value_new_list(void); - -/** - * Creates a new object. - */ -SENTRY_API sentry_value_t sentry_value_new_object(void); - -/** - * Returns the type of the value passed. - */ -SENTRY_API sentry_value_type_t sentry_value_get_type(sentry_value_t value); - -/** - * Sets a key to a value in the map. - * - * This moves the ownership of the value into the map. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_set_by_key( - sentry_value_t value, const char *k, sentry_value_t v); - -/** - * This removes a value from the map by key. - */ -SENTRY_API int sentry_value_remove_by_key(sentry_value_t value, const char *k); - -/** - * Appends a value to a list. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_append(sentry_value_t value, sentry_value_t v); - -/** - * Inserts a value into the list at a certain position. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - * - * If the list is shorter than the given index it's automatically extended - * and filled with `null` values. - */ -SENTRY_API int sentry_value_set_by_index( - sentry_value_t value, size_t index, sentry_value_t v); - -/** - * This removes a value from the list by index. - */ -SENTRY_API int sentry_value_remove_by_index(sentry_value_t value, size_t index); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key_owned( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a list by index. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index( - sentry_value_t value, size_t index); - -/** - * Looks up a value in a list by index. If missing a null value is - * returned. The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index_owned( - sentry_value_t value, size_t index); - -/** - * Returns the length of the given map or list. - * - * If an item is not a list or map the return value is 0. - */ -SENTRY_API size_t sentry_value_get_length(sentry_value_t value); - -/** - * Converts a value into a 32bit signed integer. - */ -SENTRY_API int32_t sentry_value_as_int32(sentry_value_t value); - -/** - * Converts a value into a double value. - */ -SENTRY_API double sentry_value_as_double(sentry_value_t value); - -/** - * Returns the value as c string. - */ -SENTRY_API const char *sentry_value_as_string(sentry_value_t value); - -/** - * Returns `true` if the value is boolean true. - */ -SENTRY_API int sentry_value_is_true(sentry_value_t value); - -/** - * Returns `true` if the value is null. - */ -SENTRY_API int sentry_value_is_null(sentry_value_t value); - -/** - * Serialize a sentry value to JSON. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. - */ -SENTRY_API char *sentry_value_to_json(sentry_value_t value); - -/** - * Sentry levels for events and breadcrumbs. - */ -typedef enum sentry_level_e { - SENTRY_LEVEL_DEBUG = -1, - SENTRY_LEVEL_INFO = 0, - SENTRY_LEVEL_WARNING = 1, - SENTRY_LEVEL_ERROR = 2, - SENTRY_LEVEL_FATAL = 3, -} sentry_level_t; - -/** - * Creates a new empty Event value. - * - * See https://docs.sentry.io/platforms/native/enriching-events/ for how to - * further work with events, and https://develop.sentry.dev/sdk/event-payloads/ - * for a detailed overview of the possible properties of an Event. - */ -SENTRY_API sentry_value_t sentry_value_new_event(void); - -/** - * Creates a new Message Event value. - * - * See https://develop.sentry.dev/sdk/event-payloads/message/ - * - * `logger` can be NULL to omit the logger value. - */ -SENTRY_API sentry_value_t sentry_value_new_message_event( - sentry_level_t level, const char *logger, const char *text); - -/** - * Creates a new Breadcrumb with a specific type and message. - * - * See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ - * - * Either parameter can be NULL in which case no such attributes is created. - */ -SENTRY_API sentry_value_t sentry_value_new_breadcrumb( - const char *type, const char *message); - -/** - * Creates a new Exception value. - * - * This is intended for capturing language-level exception, such as from a - * try-catch block. `type` and `value` here refer to the exception class and - * a possible description. - * - * See https://develop.sentry.dev/sdk/event-payloads/exception/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_exception`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_exception( - const char *type, const char *value); - -/** - * Creates a new Thread value. - * - * See https://develop.sentry.dev/sdk/event-payloads/threads/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_thread`. - * - * `name` can be NULL. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( - uint64_t id, const char *name); - -/** - * Creates a new Stack Trace conforming to the Stack Trace Interface. - * - * See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ - * - * The returned object must be attached to either an exception or thread - * object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_stacktrace( - void **ips, size_t len); - -/** - * Sets the Stack Trace conforming to the Stack Trace Interface in a value. - * - * The value argument must be either an exception or thread object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` stack - * trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_value_set_stacktrace( - sentry_value_t value, void **ips, size_t len); - -/** - * Adds an Exception to an Event value. - * - * This takes ownership of the `exception`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_exception( - sentry_value_t event, sentry_value_t exception); - -/** - * Adds a Thread to an Event value. - * - * This takes ownership of the `thread`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_thread( - sentry_value_t event, sentry_value_t thread); - -/* -- Experimental APIs -- */ - -/** - * Serialize a sentry value to msgpack. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. Since msgpack is not zero terminated - * the size is written to the `size_out` parameter. - */ -SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack( - sentry_value_t value, size_t *size_out); - -/** - * Adds a stack trace to an event. - * - * The stack trace is added as part of a new thread object. - * This function is **deprecated** in favor of using - * `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` - * and `sentry_event_add_thread`. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_value_add_stacktrace( - sentry_value_t event, void **ips, size_t len); - -/** - * This represents the OS dependent user context in the case of a crash, and can - * be used to manually capture a crash. - */ -typedef struct sentry_ucontext_s { -#ifdef _WIN32 - EXCEPTION_POINTERS exception_ptrs; -#else - int signum; - siginfo_t *siginfo; - ucontext_t *user_context; -#endif -} sentry_ucontext_t; - -/** - * Unwinds the stack from the given address. - * - * If the address is given in `addr` the stack is unwound form there. - * Otherwise (NULL is passed) the current instruction pointer is used as - * start address. - * Unwinding with a given `addr` is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( - void *addr, void **stacktrace_out, size_t max_len); - -/** - * Unwinds the stack from the given context. - * - * The caller is responsible to construct an appropriate `sentry_ucontext_t`. - * Unwinding from a user context is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext( - const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len); - -/** - * A UUID - */ -typedef struct sentry_uuid_s { - char bytes[16]; -} sentry_uuid_t; - -/** - * Creates the nil uuid. - */ -SENTRY_API sentry_uuid_t sentry_uuid_nil(void); - -/** - * Creates a new uuid4. - */ -SENTRY_API sentry_uuid_t sentry_uuid_new_v4(void); - -/** - * Parses a uuid from a string. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_string(const char *str); - -/** - * Creates a uuid from bytes. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_bytes(const char bytes[16]); - -/** - * Checks if the uuid is nil. - */ -SENTRY_API int sentry_uuid_is_nil(const sentry_uuid_t *uuid); - -/** - * Returns the bytes of the uuid. - */ -SENTRY_API void sentry_uuid_as_bytes(const sentry_uuid_t *uuid, char bytes[16]); - -/** - * Formats the uuid into a string buffer. - */ -SENTRY_API void sentry_uuid_as_string(const sentry_uuid_t *uuid, char str[37]); - -/** - * A Sentry Envelope. - * - * The Envelope is an abstract type which represents a payload being sent to - * sentry. It can contain one or more items, typically an Event. - * See https://develop.sentry.dev/sdk/envelopes/ - */ -struct sentry_envelope_s; -typedef struct sentry_envelope_s sentry_envelope_t; - -/** - * Frees an envelope. - */ -SENTRY_API void sentry_envelope_free(sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Event if there is one. - * - * This returns a borrowed value to the Event in the Envelope. - */ -SENTRY_API sentry_value_t sentry_envelope_get_event( - const sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Transaction if there is one. - * - * This returns a borrowed value to the Transaction in the Envelope. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( - const sentry_envelope_t *envelope); - -/** - * Serializes the envelope. - * - * The return value needs to be freed with sentry_string_free(). - */ -SENTRY_API char *sentry_envelope_serialize( - const sentry_envelope_t *envelope, size_t *size_out); - -/** - * Serializes the envelope into a file. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_envelope_write_to_file( - const sentry_envelope_t *envelope, const char *path); - -/** - * The Sentry Client Options. - * - * See https://docs.sentry.io/platforms/native/configuration/ - */ -struct sentry_options_s; -typedef struct sentry_options_s sentry_options_t; - -/** - * This represents an interface for user-defined transports. - * - * Transports are responsible for sending envelopes to sentry and are the last - * step in the event pipeline. - * - * Envelopes will be submitted to the transport in a _fire and forget_ fashion, - * and the transport must send those envelopes _in order_. - * - * A transport has the following hooks, all of which - * take the user provided `state` as last parameter. The transport state needs - * to be set with `sentry_transport_set_state` and typically holds handles and - * other information that can be reused across requests. - * - * * `send_func`: This function will take ownership of an envelope, and is - * responsible for freeing it via `sentry_envelope_free`. - * * `startup_func`: This hook will be called by sentry inside of `sentry_init` - * and instructs the transport to initialize itself. Failures will bubble up - * to `sentry_init`. - * * `flush_func`: Instructs the transport to flush its queue. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport queue is flushed within the timeout. - * * `shutdown_func`: Instructs the transport to flush its queue and shut down. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport is flushed and shut down successfully. - * In case of a non-zero return value, sentry will log an error, but continue - * with freeing the transport. - * * `free_func`: Frees the transports `state`. This hook might be called even - * though `shutdown_func` returned a failure code previously. - * - * The transport interface might be extended in the future with hooks to flush - * its internal queue without shutting down, and to dump its internal queue to - * disk in case of a hard crash. - */ -struct sentry_transport_s; -typedef struct sentry_transport_s sentry_transport_t; - -/** - * Creates a new transport with an initial `send_func`. - */ -SENTRY_API sentry_transport_t *sentry_transport_new( - void (*send_func)(sentry_envelope_t *envelope, void *state)); - -/** - * Sets the transport `state`. - * - * If the state is owned by the transport and needs to be freed, use - * `sentry_transport_set_free_func` to set an appropriate hook. - */ -SENTRY_API void sentry_transport_set_state( - sentry_transport_t *transport, void *state); - -/** - * Sets the transport hook to free the transport `state`. - */ -SENTRY_API void sentry_transport_set_free_func( - sentry_transport_t *transport, void (*free_func)(void *state)); - -/** - * Sets the transport startup hook. - * - * This hook is called from within `sentry_init` and will get a reference to the - * options which can be used to initialize a transports internal state. - * It should return `0` on success. A failure will bubble up to `sentry_init`. - */ -SENTRY_API void sentry_transport_set_startup_func(sentry_transport_t *transport, - int (*startup_func)(const sentry_options_t *options, void *state)); - -/** - * Sets the transport flush hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` if all the pending envelopes are - * sent within the timeout, or `1` if the timeout is hit. - */ -SENTRY_API void sentry_transport_set_flush_func(sentry_transport_t *transport, - int (*flush_func)(uint64_t timeout, void *state)); - -/** - * Sets the transport shutdown hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` on success in case all the pending envelopes have been - * sent within the timeout, or `1` if the timeout was hit. - */ -SENTRY_API void sentry_transport_set_shutdown_func( - sentry_transport_t *transport, - int (*shutdown_func)(uint64_t timeout, void *state)); - -/** - * Generic way to free a transport. - */ -SENTRY_API void sentry_transport_free(sentry_transport_t *transport); - -/** - * Create a new function transport. - * - * It is a convenience function which works with a borrowed `data`, and will - * automatically free the envelope, so the user provided function does not need - * to do that. - * - * This function is *deprecated* and will be removed in a future version. - * It is here for backwards compatibility. Users should migrate to the - * `sentry_transport_new` API. - */ -SENTRY_API sentry_transport_t *sentry_new_function_transport( - void (*func)(const sentry_envelope_t *envelope, void *data), void *data); - -/** - * This represents an interface for user-defined backends. - * - * Backends are responsible to handle crashes. They are maintained at runtime - * via various life-cycle hooks from the sentry-core. - * - * At this point none of those interfaces are exposed in the API including - * creation and destruction. The main use-case of the backend in the API at this - * point is to disable it via `sentry_options_set_backend` at runtime before it - * is initialized. - */ -struct sentry_backend_s; -typedef struct sentry_backend_s sentry_backend_t; - -/* -- Options APIs -- */ - -/** - * The state of user consent. - */ -typedef enum { - SENTRY_USER_CONSENT_UNKNOWN = -1, - SENTRY_USER_CONSENT_GIVEN = 1, - SENTRY_USER_CONSENT_REVOKED = 0, -} sentry_user_consent_t; - -/** - * Creates a new options struct. - * Can be freed with `sentry_options_free`. - */ -SENTRY_API sentry_options_t *sentry_options_new(void); - -/** - * Deallocates previously allocated sentry options. - */ -SENTRY_API void sentry_options_free(sentry_options_t *opts); - -/** - * Sets a transport. - */ -SENTRY_API void sentry_options_set_transport( - sentry_options_t *opts, sentry_transport_t *transport); - -/** - * Type of the `before_send` callback. - * - * The callback takes ownership of the `event`, and should usually return that - * same event. In case the event should be discarded, the callback needs to - * call `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * If you have set an `on_crash` callback (independent of whether it discards or - * retains the event), `before_send` will no longer be invoked for crash-events, - * which allows you to better distinguish between crashes and all other events - * in client-side pre-processing. - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Up to version 0.4.18 the `before_send` callback wasn't invoked in case the - * event sampling discarded an event. In the current implementation the - * `before_send` callback is invoked even if the event sampling discards the - * event, following the cross-SDK session filter order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - */ -typedef sentry_value_t (*sentry_event_function_t)( - sentry_value_t event, void *hint, void *closure); - -/** - * Sets the `before_send` callback. - * - * See the `sentry_event_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_before_send( - sentry_options_t *opts, sentry_event_function_t func, void *data); - -/** - * Type of the `on_crash` callback. - * - * The `on_crash` callback replaces the `before_send` callback for crash events. - * The interface is analogous to `before_send` in that the callback takes - * ownership of the `event`, and should usually return that same event. In case - * the event should be discarded, the callback needs to call - * `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * Only the `inproc` backend currently fills the passed-in event with useful - * data and processes any modifications to the return value. Since both - * `breakpad` and `crashpad` use minidumps to capture the crash state, the - * passed-in event is empty when using these backends, and they ignore any - * changes to the return value. - * - * If you set this callback in the options, it prevents a concurrently enabled - * `before_send` callback from being invoked in the crash case. This allows for - * better differentiation between crashes and other events and gradual migration - * from existing `before_send` implementations: - * - * - if you have a `before_send` implementation and do not define an `on_crash` - * callback your application will receive both normal and crash events as - * before - * - if you have a `before_send` implementation but only want to handle normal - * events with it, then you can define an `on_crash` callback that returns - * the passed-in event and does nothing else - * - if you are not interested in normal events, but only want to act on - * crashes (within the limits mentioned below), then only define an - * `on_crash` callback with the option to filter (on all backends) or enrich - * (only inproc) the crash event - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Platform-specific behavior: - * - * - does not work with crashpad on macOS. - * - for breakpad on Linux the `uctx` parameter is always NULL. - */ -typedef sentry_value_t (*sentry_crash_function_t)( - const sentry_ucontext_t *uctx, sentry_value_t event, void *closure); - -/** - * Sets the `on_crash` callback. - * - * See the `sentry_crash_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_on_crash( - sentry_options_t *opts, sentry_crash_function_t func, void *data); - -/** - * Sets the DSN. - */ -SENTRY_API void sentry_options_set_dsn(sentry_options_t *opts, const char *dsn); - -/** - * Gets the DSN. - */ -SENTRY_API const char *sentry_options_get_dsn(const sentry_options_t *opts); - -/** - * Sets the sample rate, which should be a double between `0.0` and `1.0`. - * Sentry will randomly discard any event that is captured using - * `sentry_capture_event` when a sample rate < 1 is set. - * - * The sampling happens at the end of the event processing according to the - * following order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - * - * Only items 3. to 6. are currently applicable to sentry-native. This means - * each processing step is executed even if the sampling discards the event - * before sending it to the backend. This is particularly relevant to users of - * the `before_send` callback. - * - * The above is in contrast to versions up to 0.4.18 where the sampling happened - * at the beginning of the processing/filter sequence. - */ -SENTRY_API void sentry_options_set_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Gets the sample rate. - */ -SENTRY_API double sentry_options_get_sample_rate(const sentry_options_t *opts); - -/** - * Sets the release. - */ -SENTRY_API void sentry_options_set_release( - sentry_options_t *opts, const char *release); - -/** - * Gets the release. - */ -SENTRY_API const char *sentry_options_get_release(const sentry_options_t *opts); - -/** - * Sets the environment. - */ -SENTRY_API void sentry_options_set_environment( - sentry_options_t *opts, const char *environment); - -/** - * Gets the environment. - */ -SENTRY_API const char *sentry_options_get_environment( - const sentry_options_t *opts); - -/** - * Sets the dist. - */ -SENTRY_API void sentry_options_set_dist( - sentry_options_t *opts, const char *dist); - -/** - * Gets the dist. - */ -SENTRY_API const char *sentry_options_get_dist(const sentry_options_t *opts); - -/** - * Configures the http proxy. - * - * The given proxy has to include the full scheme, eg. `http://some.proxy/`. - */ -SENTRY_API void sentry_options_set_http_proxy( - sentry_options_t *opts, const char *proxy); - -/** - * Returns the configured http proxy. - */ -SENTRY_API const char *sentry_options_get_http_proxy( - const sentry_options_t *opts); - -/** - * Configures the path to a file containing ssl certificates for - * verification. - */ -SENTRY_API void sentry_options_set_ca_certs( - sentry_options_t *opts, const char *path); - -/** - * Returns the configured path for ca certificates. - */ -SENTRY_API const char *sentry_options_get_ca_certs( - const sentry_options_t *opts); - -/** - * Configures the name of the http transport thread. - */ -SENTRY_API void sentry_options_set_transport_thread_name( - sentry_options_t *opts, const char *name); - -/** - * Returns the configured http transport thread name. - */ -SENTRY_API const char *sentry_options_get_transport_thread_name( - const sentry_options_t *opts); - -/** - * Enables or disables debug printing mode. - */ -SENTRY_API void sentry_options_set_debug(sentry_options_t *opts, int debug); - -/** - * Returns the current value of the debug flag. - */ -SENTRY_API int sentry_options_get_debug(const sentry_options_t *opts); - -/** - * Sets the number of breadcrumbs being tracked and attached to events. - * - * Defaults to 100. - */ -SENTRY_API void sentry_options_set_max_breadcrumbs( - sentry_options_t *opts, size_t max_breadcrumbs); - -/** - * Gets the number of breadcrumbs being tracked and attached to events. - */ -SENTRY_API size_t sentry_options_get_max_breadcrumbs( - const sentry_options_t *opts); - -/** - * Type of the callback for logger function. - */ -typedef void (*sentry_logger_function_t)( - sentry_level_t level, const char *message, va_list args, void *userdata); - -/** - * Sets the sentry-native logger function. - * - * Used for logging debug events when the `debug` option is set to true. - */ -SENTRY_API void sentry_options_set_logger( - sentry_options_t *opts, sentry_logger_function_t func, void *userdata); - -/** - * Enables or disables automatic session tracking. - * - * Automatic session tracking is enabled by default and is equivalent to calling - * `sentry_start_session` after startup. - * There can only be one running session, and the current session will always be - * closed implicitly by `sentry_close`, when starting a new session with - * `sentry_start_session`, or manually by calling `sentry_end_session`. - */ -SENTRY_API void sentry_options_set_auto_session_tracking( - sentry_options_t *opts, int val); - -/** - * Returns true if automatic session tracking is enabled. - */ -SENTRY_API int sentry_options_get_auto_session_tracking( - const sentry_options_t *opts); - -/** - * Enables or disables user consent requirements for uploads. - * - * This disables uploads until the user has given the consent to the SDK. - * Consent itself is given with `sentry_user_consent_give` and - * `sentry_user_consent_revoke`. - */ -SENTRY_API void sentry_options_set_require_user_consent( - sentry_options_t *opts, int val); - -/** - * Returns true if user consent is required. - */ -SENTRY_API int sentry_options_get_require_user_consent( - const sentry_options_t *opts); - -/** - * Enables or disables on-device symbolication of stack traces. - * - * This feature can have a performance impact, and is enabled by default on - * Android. It is usually only needed when it is not possible to provide debug - * information files for system libraries which are needed for serverside - * symbolication. - */ -SENTRY_API void sentry_options_set_symbolize_stacktraces( - sentry_options_t *opts, int val); - -/** - * Returns true if on-device symbolication of stack traces is enabled. - */ -SENTRY_API int sentry_options_get_symbolize_stacktraces( - const sentry_options_t *opts); - -/** - * Adds a new attachment to be sent along. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_add_attachmentw` - * instead. - */ -SENTRY_API void sentry_options_add_attachment( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the crashpad handler if the crashpad backend is used. - * - * The path defaults to the `crashpad_handler`/`crashpad_handler.exe` - * executable, depending on platform, which is expected to be present in the - * same directory as the app executable. - * - * It is recommended that library users set an explicit handler path, depending - * on the directory/executable structure of their app. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_set_handler_pathw` - * instead. - */ -SENTRY_API void sentry_options_set_handler_path( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the Sentry Database Directory. - * - * Sentry will use this path to persist user consent, sessions, and other - * artifacts in case of a crash. This will also be used by the crashpad backend - * if it is configured. - * - * The directory is used for "cached" data, which needs to persist across - * application restarts to ensure proper flagging of release-health sessions, - * but might otherwise be safely purged regularly. - * - * It is roughly equivalent to the type of `AppData/Local` on Windows and - * `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other - * platforms. - * - * It is recommended that users set an explicit absolute path, depending - * on their apps runtime directory. The path will be created if it does not - * exist, and will be resolved to an absolute path inside of `sentry_init`. The - * directory should not be shared with other application data/configuration, as - * sentry-native will enumerate and possibly delete files in that directory. An - * example might be `$XDG_CACHE_HOME/your-app/sentry` - * - * If no explicit path it set, sentry-native will default to `.sentry-native` in - * the current working directory, with no specific platform-specific handling. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use - * `sentry_options_set_database_pathw` instead. - */ -SENTRY_API void sentry_options_set_database_path( - sentry_options_t *opts, const char *path); - -#ifdef SENTRY_PLATFORM_WINDOWS -/** - * Wide char version of `sentry_options_add_attachment`. - */ -SENTRY_API void sentry_options_add_attachmentw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_handler_path`. - */ -SENTRY_API void sentry_options_set_handler_pathw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_database_path`. - */ -SENTRY_API void sentry_options_set_database_pathw( - sentry_options_t *opts, const wchar_t *path); -#endif - -/** - * Enables forwarding to the system crash reporter. Disabled by default. - * - * This setting only has an effect when using Crashpad on macOS. If enabled, - * Crashpad forwards crashes to the macOS system crash reporter. Depending - * on the crash, this may impact the crash time. Even if enabled, Crashpad - * may choose not to forward certain crashes. - */ -SENTRY_API void sentry_options_set_system_crash_reporter_enabled( - sentry_options_t *opts, int enabled); - -/** - * Sets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API void sentry_options_set_shutdown_timeout( - sentry_options_t *opts, uint64_t shutdown_timeout); - -/** - * Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts); - -/** - * Sets a user-defined backend. - * - * Since creation and destruction of backends is not exposed in the API, this - * can only be used to set the backend to `NULL`, which disables the backend in - * the initialization. - */ -SENTRY_API void sentry_options_set_backend( - sentry_options_t *opts, sentry_backend_t *backend); - -/* -- Global APIs -- */ - -/** - * Initializes the Sentry SDK with the specified options. - * - * This takes ownership of the options. After the options have been set - * they cannot be modified any more. - * Depending on the configured transport and backend, this function might not be - * fully thread-safe. - * Returns 0 on success. - */ -SENTRY_API int sentry_init(sentry_options_t *options); - -/** - * Instructs the transport to flush its send queue. - * - * The `timeout` parameter is in milliseconds. - * - * Returns 0 on success, or a non-zero return value in case the timeout is hit. - */ -SENTRY_API int sentry_flush(uint64_t timeout); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_close(void); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * This is a **deprecated** alias for `sentry_close`. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_shutdown(void); - -/** - * This will lazily load and cache a list of all the loaded libraries. - * - * Returns a new reference to an immutable, frozen list. - * The reference must be released with `sentry_value_decref`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_get_modules_list(void); - -/** - * Clears the internal module cache. - * - * For performance reasons, sentry will cache the list of loaded libraries when - * capturing events. This cache can get out-of-date when loading or unloading - * libraries at runtime. It is therefore recommended to call - * `sentry_clear_modulecache` when doing so, to make sure that the next call to - * `sentry_capture_event` will have an up-to-date module list. - */ -SENTRY_EXPERIMENTAL_API void sentry_clear_modulecache(void); - -/** - * Re-initializes the Sentry backend. - * - * This is needed if a third-party library overrides the previously installed - * signal handler. Calling this function can be potentially dangerous and should - * only be done when necessary. - * - * Returns 0 on success. - */ -SENTRY_EXPERIMENTAL_API int sentry_reinstall_backend(void); - -/** - * Gives user consent. - */ -SENTRY_API void sentry_user_consent_give(void); - -/** - * Revokes user consent. - */ -SENTRY_API void sentry_user_consent_revoke(void); - -/** - * Resets the user consent (back to unknown). - */ -SENTRY_API void sentry_user_consent_reset(void); - -/** - * Checks the current state of user consent. - */ -SENTRY_API sentry_user_consent_t sentry_user_consent_get(void); - -/** - * Sends a sentry event. - * - * If returns a nil UUID if the event being passed in is a transaction, and the - * transaction will not be sent nor consumed. `sentry_transaction_finish` should - * be used to send transactions. - */ -SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event); - -/** - * Captures an exception to be handled by the backend. - * - * This is safe to be called from a crashing thread and may not return. - */ -SENTRY_EXPERIMENTAL_API void sentry_handle_exception( - const sentry_ucontext_t *uctx); - -/** - * Adds the breadcrumb to be sent in case of an event. - */ -SENTRY_API void sentry_add_breadcrumb(sentry_value_t breadcrumb); - -/** - * Sets the specified user. - */ -SENTRY_API void sentry_set_user(sentry_value_t user); - -/** - * Removes a user. - */ -SENTRY_API void sentry_remove_user(void); - -/** - * Sets a tag. - */ -SENTRY_API void sentry_set_tag(const char *key, const char *value); - -/** - * Removes the tag with the specified key. - */ -SENTRY_API void sentry_remove_tag(const char *key); - -/** - * Sets extra information. - */ -SENTRY_API void sentry_set_extra(const char *key, sentry_value_t value); - -/** - * Removes the extra with the specified key. - */ -SENTRY_API void sentry_remove_extra(const char *key); - -/** - * Sets a context object. - */ -SENTRY_API void sentry_set_context(const char *key, sentry_value_t value); - -/** - * Removes the context object with the specified key. - */ -SENTRY_API void sentry_remove_context(const char *key); - -/** - * Sets the event fingerprint. - * - * This accepts a variable number of arguments, and needs to be terminated by a - * trailing `NULL`. - */ -SENTRY_API void sentry_set_fingerprint(const char *fingerprint, ...); - -/** - * Removes the fingerprint. - */ -SENTRY_API void sentry_remove_fingerprint(void); - -/** - * Sets the transaction. - */ -SENTRY_API void sentry_set_transaction(const char *transaction); - -/** - * Sets the event level. - */ -SENTRY_API void sentry_set_level(sentry_level_t level); - -/** - * Starts a new session. - */ -SENTRY_API void sentry_start_session(void); - -/** - * Ends a session. - */ -SENTRY_API void sentry_end_session(void); - -/** - * Sets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_max_spans( - sentry_options_t *opts, size_t max_spans); - -/** - * Gets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_options_get_max_spans( - sentry_options_t *opts); - -/** - * Sets the sample rate for transactions. Should be a double between - * `0.0` and `1.0`. Transactions will be randomly discarded during - * `sentry_transaction_finish` when the sample rate is < 1.0. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Returns the sample rate for transactions. - */ -SENTRY_EXPERIMENTAL_API double sentry_options_get_traces_sample_rate( - sentry_options_t *opts); - -/* -- Performance Monitoring/Tracing APIs -- */ - -/** - * A sentry Transaction Context. - * - * See Transaction Interface under - * https://develop.sentry.dev/sdk/performance/#new-span-and-transaction-classes - */ -struct sentry_transaction_context_s; -typedef struct sentry_transaction_context_s sentry_transaction_context_t; - -/** - * A sentry Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/transaction/ - */ -struct sentry_transaction_s; -typedef struct sentry_transaction_s sentry_transaction_t; - -/** - * A sentry Span. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ - */ -struct sentry_span_s; -typedef struct sentry_span_s sentry_span_t; - -/** - * Constructs a new Transaction Context. The returned value needs to be passed - * into `sentry_transaction_start` in order to be recorded and sent to sentry. - * - * See - * https://docs.sentry.io/platforms/native/enriching-events/transaction-name/ - * for an explanation of a Transaction's `name`, and - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around an `operation`'s value. - * - * Also see https://develop.sentry.dev/sdk/event-payloads/transaction/#anatomy - * for an explanation of `operation`, in addition to other properties and - * actions that can be performed on a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction Context - * if it needs to be mutated across threads. Methods operating on the - * Transaction Context will mention what kind of expectations they carry if they - * need to mutate or access the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * -sentry_transaction_context_new(const char *name, const char *operation); - -/** - * Sets the `name` on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * The Transaction Context should not be mutated by other functions while - * setting a name on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name( - sentry_transaction_context_t *tx_cxt, const char *name); - -/** - * Sets the `operation` on a Transaction Context, which will be used in the - * Transaction constructed off of the context - * - * See https://develop.sentry.dev/sdk/performance/span-operations/ for - * conventions on `operation`s. - * - * The Transaction Context should not be mutated by other functions while - * setting an operation on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation( - sentry_transaction_context_t *tx_cxt, const char *operation); - -/** - * Sets the `sampled` field on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * When passed any value above 0, the Transaction will bypass all sampling - * options and always be sent to sentry. If passed 0, this Transaction and its - * child spans will never be sent to sentry. - * - * The Transaction Context should not be mutated by other functions while - * setting `sampled` on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_sampled( - sentry_transaction_context_t *tx_cxt, int sampled); - -/** - * Removes the `sampled` field on a Transaction Context, which will be used in - * the Transaction constructed off of the context. - * - * The Transaction will use the sampling rate as defined in `sentry_options`. - * - * The Transaction Context should not be mutated by other functions while - * removing `sampled`. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_remove_sampled( - sentry_transaction_context_t *tx_cxt); - -/** - * Update the Transaction Context with the given HTTP header key/value pair. - * - * This is used to propagate distributed tracing metadata from upstream - * services. Therefore, the headers of incoming requests should be fed into this - * function so that sentry is able to continue a trace that was started by an - * upstream service. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header( - sentry_transaction_context_t *tx_cxt, const char *key, const char *value); - -/** - * Starts a new Transaction based on the provided context, restored from an - * external integration (i.e. a span from a different SDK) or manually - * constructed by a user. - * - * The second parameter is a custom Sampling Context to be used with a Traces - * Sampler to make a more informed sampling decision. The SDK does not currently - * support a custom Traces Sampler and this parameter is ignored for the time - * being but needs to be provided. - * - * Returns a Transaction, which is expected to be manually managed by the - * caller. Manual management involves ensuring that `sentry_transaction_finish` - * is invoked for the Transaction, and that the caller manually starts and - * finishes any child Spans as needed on the Transaction. - * - * Not invoking `sentry_transaction_finish` with the returned Transaction means - * it will be discarded, and will not be sent to sentry. - * - * To ensure that any Events or Message Events are associated with this - * Transaction while it is active, invoke and pass in the Transaction returned - * by this function to `sentry_set_transaction_object`. Further documentation on - * this can be found in `sentry_set_transaction_object`'s docstring. - * - * Takes ownership of `transaction_context`. A Transaction Context cannot be - * modified or re-used after it is used to start a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction if it - * needs to be mutated across threads. Methods operating on the Transaction will - * mention what kind of expectations they carry if they need to mutate or access - * the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start( - sentry_transaction_context_t *tx_cxt, sentry_value_t sampling_ctx); - -/** - * Finishes and sends a Transaction to sentry. The event ID of the Transaction - * will be returned if this was successful; A nil UUID will be returned - * otherwise. - * - * Always takes ownership of `transaction`, regardless of whether the operation - * was successful or not. A Transaction cannot be modified or re-used after it - * is finished. - */ -SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish( - sentry_transaction_t *tx); - -/** - * Sets the Transaction so any Events sent while the Transaction - * is active will be associated with the Transaction. - * - * If the Transaction being passed in is unsampled, it will still be associated - * with any new Events. This will lead to some Events pointing to orphan or - * missing traces in sentry, see - * https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#orphan-traces-and-broken-subtraces - * - * This increases the number of references pointing to the Transaction. Invoke - * `sentry_transaction_finish` to remove the Transaction set by this function as - * well as its reference by passing in the same Transaction as the one passed - * into this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_transaction_object( - sentry_transaction_t *tx); - -/** - * Sets the Span so any Events sent while the Span - * is active will be associated with the Span. - * - * This increases the number of references pointing to the Span. Invoke - * `sentry_span_finish` to remove the Span set by this function as well - * as its reference by passing in the same Span as the one passed into - * this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_span(sentry_span_t *span); - -/** - * Starts a new Span. - * - * The return value of `sentry_transaction_start` should be passed in as - * `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * This increases the number of references pointing to the Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child( - sentry_transaction_t *parent, char *operation, char *description); - -/** - * Starts a new Span. - * - * The return value of `sentry_span_start_child` may be passed in as `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child( - sentry_span_t *parent, char *operation, char *description); - -/** - * Finishes a Span. - * - * This takes ownership of `span`. A Span cannot be modified or re-used after it - * is finished. - * - * This will mutate the `span`'s containing Transaction, so the containing - * Transaction should also not be mutated by other functions when finishing a - * span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_finish(sentry_span_t *span); - -/** - * Sets a tag on a Transaction to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Transaction should not be mutated by other functions while a tag is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag( - sentry_transaction_t *transaction, const char *tag, const char *value); - -/** - * Removes a tag from a Transaction. - * - * The Transaction should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag( - sentry_transaction_t *transaction, const char *tag); - -/** - * Sets the given key in a Transaction's "data" section to the given value. - * - * The Transaction should not be mutated by other functions while data is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data( - sentry_transaction_t *transaction, const char *key, sentry_value_t value); - -/** - * Removes a key from a Transaction's "data" section. - * - * The Transaction should not be mutated by other functions while data is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data( - sentry_transaction_t *transaction, const char *key); - -/** - * Sets a tag on a Span to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Span should not be mutated by other functions while a tag is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_tag( - sentry_span_t *span, const char *tag, const char *value); - -/** - * Removes a tag from a Span. - * - * The Span should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag( - sentry_span_t *span, const char *tag); - -/** - * Sets the given key in a Span's "data" section to the given value. - * - * The Span should not be mutated by other functions while data is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_data( - sentry_span_t *span, const char *key, sentry_value_t value); - -/** - * Removes a key from a Span's "data" section. - * - * The Span should not be mutated by other functions while data is being removed - * from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_data( - sentry_span_t *span, const char *key); - -/** - * Sets a Transaction's name. - * - * The Transaction should not be mutated by other functions while setting its - * name. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name( - sentry_transaction_t *transaction, const char *name); - -/** - * The status of a Span or Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for documentation. - */ -typedef enum { - // The operation completed successfully. - // HTTP status 100..299 + successful redirects from the 3xx range. - SENTRY_SPAN_STATUS_OK, - // The operation was cancelled (typically by the user). - SENTRY_SPAN_STATUS_CANCELLED, - // Unknown. Any non-standard HTTP status code. - // "We do not know whether the transaction failed or succeeded." - SENTRY_SPAN_STATUS_UNKNOWN, - // Client specified an invalid argument. 4xx. - // Note that this differs from FailedPrecondition. InvalidArgument - // indicates arguments that are problematic regardless of the - // state of the system. - SENTRY_SPAN_STATUS_INVALID_ARGUMENT, - // Deadline expired before operation could complete. - // For operations that change the state of the system, this error may be - // returned even if the operation has been completed successfully. - // HTTP redirect loops and 504 Gateway Timeout. - SENTRY_SPAN_STATUS_DEADLINE_EXCEEDED, - // 404 Not Found. Some requested entity (file or directory) was not found. - SENTRY_SPAN_STATUS_NOT_FOUND, - // Already exists (409) - // Some entity that we attempted to create already exists. - SENTRY_SPAN_STATUS_ALREADY_EXISTS, - // 403 Forbidden - // The caller does not have permission to execute the specified operation. - SENTRY_SPAN_STATUS_PERMISSION_DENIED, - // 429 Too Many Requests - // Some resource has been exhausted, perhaps a per-user quota or perhaps - // the entire file system is out of space. - SENTRY_SPAN_STATUS_RESOURCE_EXHAUSTED, - // Operation was rejected because the system is not in a state required for - // the operation's execution. - SENTRY_SPAN_STATUS_FAILED_PRECONDITION, - // The operation was aborted, typically due to a concurrency issue. - SENTRY_SPAN_STATUS_ABORTED, - // Operation was attempted past the valid range. - SENTRY_SPAN_STATUS_OUT_OF_RANGE, - // 501 Not Implemented - // Operation is not implemented or not enabled. - SENTRY_SPAN_STATUS_UNIMPLEMENTED, - // Other/generic 5xx - SENTRY_SPAN_STATUS_INTERNAL_ERROR, - // 503 Service Unavailable - SENTRY_SPAN_STATUS_UNAVAILABLE, - // Unrecoverable data loss or corruption - SENTRY_SPAN_STATUS_DATA_LOSS, - // 401 Unauthorized (actually does mean unauthenticated according to RFC - // 7235) - // Prefer PermissionDenied if a user is logged in. - SENTRY_SPAN_STATUS_UNAUTHENTICATED, -} sentry_span_status_t; - -/** - * Sets a Span's status. - * - * The Span should not be mutated by other functions while setting its status. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_status( - sentry_span_t *span, sentry_span_status_t status); - -/** - * Sets a Transaction's status. - * - * The Transaction should not be mutated by other functions while setting its - * status. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_status( - sentry_transaction_t *tx, sentry_span_status_t status); - -/** - * Type of the `iter_headers` callback. - * - * The callback is being called with HTTP header key/value pairs. - * These headers can be attached to outgoing HTTP requests to propagate - * distributed tracing metadata to downstream services. - * - */ -typedef void (*sentry_iter_headers_function_t)( - const char *key, const char *value, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_iter_headers(sentry_span_t *span, - sentry_iter_headers_function_t callback, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers( - sentry_transaction_t *tx, sentry_iter_headers_function_t callback, - void *userdata); - -/** - * Returns whether the application has crashed on the last run. - * - * Notes: - * * The underlying value is set by sentry_init() - it must be called first. - * * Call sentry_clear_crashed_last_run() to reset for the next app run. - * - * Possible return values: - * 1 = the last run was a crash - * 0 = no crash recognized - * -1 = sentry_init() hasn't been called yet - */ -SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(); - -/** - * Clear the status of the "crashed-last-run". You should explicitly call - * this after sentry_init() if you're using sentry_get_crashed_last_run(). - * Otherwise, the same information is reported on any subsequent runs. - * - * Notes: - * * This doesn't change the value of sentry_get_crashed_last_run() yet. - * However, if sentry_init() is called again, the value will change. - * * This may only be called after sentry_init() and before sentry_close(). - * - * Returns 0 on success, 1 on error. - */ -SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(); - -/** - * Sentry SDK version. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(); - -/** - * Sentry SDK name. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(); - -/** - * Sentry SDK User-Agent. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/plugin-dev/Source/ThirdParty/Win64/bin/crashpad_handler.exe b/plugin-dev/Source/ThirdParty/Win64/bin/crashpad_handler.exe deleted file mode 100644 index 254fc56ff..000000000 Binary files a/plugin-dev/Source/ThirdParty/Win64/bin/crashpad_handler.exe and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Win64/bin/sentry.dll b/plugin-dev/Source/ThirdParty/Win64/bin/sentry.dll deleted file mode 100644 index 2736aef88..000000000 Binary files a/plugin-dev/Source/ThirdParty/Win64/bin/sentry.dll and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Win64/bin/sentry.pdb b/plugin-dev/Source/ThirdParty/Win64/bin/sentry.pdb deleted file mode 100644 index b196f3ec9..000000000 Binary files a/plugin-dev/Source/ThirdParty/Win64/bin/sentry.pdb and /dev/null differ diff --git a/plugin-dev/Source/ThirdParty/Win64/include/sentry.h b/plugin-dev/Source/ThirdParty/Win64/include/sentry.h deleted file mode 100644 index 44a0f878f..000000000 --- a/plugin-dev/Source/ThirdParty/Win64/include/sentry.h +++ /dev/null @@ -1,1874 +0,0 @@ -/** - * sentry-native - * - * sentry-native is a C client to send events to native from - * C and C++ applications. It can work together with breakpad/crashpad - * but also send events on its own. - * - * NOTE on encodings: - * - * Sentry will assume an encoding of UTF-8 for all string data that is captured - * and being sent to sentry as an Event. - * All the functions that are dealing with *paths* will assume an OS-specific - * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on - * Linux; and they provide wchar-compatible alternatives on Windows which are - * preferred. - */ - -#ifndef SENTRY_H_INCLUDED -#define SENTRY_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* SDK Version */ -#ifndef SENTRY_SDK_NAME -# ifdef __ANDROID__ -# define SENTRY_SDK_NAME "sentry.native.android" -# else -# define SENTRY_SDK_NAME "sentry.native" -# endif -#endif -#define SENTRY_SDK_VERSION "0.5.0" -#define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION - -/* common platform detection */ -#ifdef _WIN32 -# define SENTRY_PLATFORM_WINDOWS -#elif defined(__APPLE__) -# include -# if defined(TARGET_OS_OSX) && TARGET_OS_OSX -# define SENTRY_PLATFORM_MACOS -# elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE -# define SENTRY_PLATFORM_IOS -# endif -# define SENTRY_PLATFORM_DARWIN -# define SENTRY_PLATFORM_UNIX -#elif defined(__ANDROID__) -# define SENTRY_PLATFORM_ANDROID -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(__linux) || defined(__linux__) -# define SENTRY_PLATFORM_LINUX -# define SENTRY_PLATFORM_UNIX -#elif defined(_AIX) -/* IBM i PASE is also counted as AIX */ -# define SENTRY_PLATFORM_AIX -# define SENTRY_PLATFORM_UNIX -#else -# error unsupported platform -#endif - -/* marks a function as part of the sentry API */ -#ifndef SENTRY_API -# ifdef _WIN32 -# if defined(SENTRY_BUILD_SHARED) /* build dll */ -# define SENTRY_API __declspec(dllexport) -# elif !defined(SENTRY_BUILD_STATIC) /* use dll */ -# define SENTRY_API __declspec(dllimport) -# else /* static library */ -# define SENTRY_API -# endif -# else -# if __GNUC__ >= 4 -# define SENTRY_API __attribute__((visibility("default"))) -# else -# define SENTRY_API -# endif -# endif -#endif - -/* marks a function as experimental api */ -#ifndef SENTRY_EXPERIMENTAL_API -# define SENTRY_EXPERIMENTAL_API SENTRY_API -#endif - -#include -#include -#include - -/* context type dependencies */ -#ifdef _WIN32 -# include -#else -# include -#endif - -/** - * The library internally uses the system malloc and free functions to manage - * memory. It does not use realloc. The reason for this is that on unix - * platforms we fall back to a simplistic page allocator once we have - * encountered a SIGSEGV or other terminating signal as malloc is no longer - * safe to use. Since we cannot portably reallocate allocations made on the - * pre-existing allocator we're instead not using realloc. - * - * Note also that after SIGSEGV sentry_free() becomes a noop. - */ - -/** - * Allocates memory with the underlying allocator. - */ -SENTRY_API void *sentry_malloc(size_t size); - -/** - * Releases memory allocated from the underlying allocator. - */ -SENTRY_API void sentry_free(void *ptr); - -/** - * Legacy function. Alias for `sentry_free`. - */ -#define sentry_string_free sentry_free - -/* -- Protocol Value API -- */ - -/** - * Type of a sentry value. - */ -typedef enum { - SENTRY_VALUE_TYPE_NULL, - SENTRY_VALUE_TYPE_BOOL, - SENTRY_VALUE_TYPE_INT32, - SENTRY_VALUE_TYPE_DOUBLE, - SENTRY_VALUE_TYPE_STRING, - SENTRY_VALUE_TYPE_LIST, - SENTRY_VALUE_TYPE_OBJECT, -} sentry_value_type_t; - -/** - * Represents a sentry protocol value. - * - * The members of this type should never be accessed. They are only here - * so that alignment for the type can be properly determined. - * - * Values must be released with `sentry_value_decref`. This lowers the - * internal refcount by one. If the refcount hits zero it's freed. Some - * values like primitives have no refcount (like null) so operations on - * those are no-ops. - * - * In addition values can be frozen. Some values like primitives are always - * frozen but lists and dicts are not and can be frozen on demand. This - * automatically happens for some shared values in the event payload like - * the module list. - */ -union sentry_value_u { - uint64_t _bits; - double _double; -}; -typedef union sentry_value_u sentry_value_t; - -/** - * Increments the reference count on the value. - */ -SENTRY_API void sentry_value_incref(sentry_value_t value); - -/** - * Decrements the reference count on the value. - */ -SENTRY_API void sentry_value_decref(sentry_value_t value); - -/** - * Returns the refcount of a value. - */ -SENTRY_API size_t sentry_value_refcount(sentry_value_t value); - -/** - * Freezes a value. - */ -SENTRY_API void sentry_value_freeze(sentry_value_t value); - -/** - * Checks if a value is frozen. - */ -SENTRY_API int sentry_value_is_frozen(sentry_value_t value); - -/** - * Creates a null value. - */ -SENTRY_API sentry_value_t sentry_value_new_null(void); - -/** - * Creates a new 32-bit signed integer value. - */ -SENTRY_API sentry_value_t sentry_value_new_int32(int32_t value); - -/** - * Creates a new double value. - */ -SENTRY_API sentry_value_t sentry_value_new_double(double value); - -/** - * Creates a new boolean value. - */ -SENTRY_API sentry_value_t sentry_value_new_bool(int value); - -/** - * Creates a new null terminated string. - */ -SENTRY_API sentry_value_t sentry_value_new_string(const char *value); - -/** - * Creates a new list value. - */ -SENTRY_API sentry_value_t sentry_value_new_list(void); - -/** - * Creates a new object. - */ -SENTRY_API sentry_value_t sentry_value_new_object(void); - -/** - * Returns the type of the value passed. - */ -SENTRY_API sentry_value_type_t sentry_value_get_type(sentry_value_t value); - -/** - * Sets a key to a value in the map. - * - * This moves the ownership of the value into the map. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_set_by_key( - sentry_value_t value, const char *k, sentry_value_t v); - -/** - * This removes a value from the map by key. - */ -SENTRY_API int sentry_value_remove_by_key(sentry_value_t value, const char *k); - -/** - * Appends a value to a list. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - */ -SENTRY_API int sentry_value_append(sentry_value_t value, sentry_value_t v); - -/** - * Inserts a value into the list at a certain position. - * - * This moves the ownership of the value into the list. The caller does not - * have to call `sentry_value_decref` on it. - * - * If the list is shorter than the given index it's automatically extended - * and filled with `null` values. - */ -SENTRY_API int sentry_value_set_by_index( - sentry_value_t value, size_t index, sentry_value_t v); - -/** - * This removes a value from the list by index. - */ -SENTRY_API int sentry_value_remove_by_index(sentry_value_t value, size_t index); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a map by key. If missing a null value is returned. - * The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_key_owned( - sentry_value_t value, const char *k); - -/** - * Looks up a value in a list by index. If missing a null value is returned. - * The returned value is borrowed. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index( - sentry_value_t value, size_t index); - -/** - * Looks up a value in a list by index. If missing a null value is - * returned. The returned value is owned. - * - * If the caller no longer needs the value it must be released with - * `sentry_value_decref`. - */ -SENTRY_API sentry_value_t sentry_value_get_by_index_owned( - sentry_value_t value, size_t index); - -/** - * Returns the length of the given map or list. - * - * If an item is not a list or map the return value is 0. - */ -SENTRY_API size_t sentry_value_get_length(sentry_value_t value); - -/** - * Converts a value into a 32bit signed integer. - */ -SENTRY_API int32_t sentry_value_as_int32(sentry_value_t value); - -/** - * Converts a value into a double value. - */ -SENTRY_API double sentry_value_as_double(sentry_value_t value); - -/** - * Returns the value as c string. - */ -SENTRY_API const char *sentry_value_as_string(sentry_value_t value); - -/** - * Returns `true` if the value is boolean true. - */ -SENTRY_API int sentry_value_is_true(sentry_value_t value); - -/** - * Returns `true` if the value is null. - */ -SENTRY_API int sentry_value_is_null(sentry_value_t value); - -/** - * Serialize a sentry value to JSON. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. - */ -SENTRY_API char *sentry_value_to_json(sentry_value_t value); - -/** - * Sentry levels for events and breadcrumbs. - */ -typedef enum sentry_level_e { - SENTRY_LEVEL_DEBUG = -1, - SENTRY_LEVEL_INFO = 0, - SENTRY_LEVEL_WARNING = 1, - SENTRY_LEVEL_ERROR = 2, - SENTRY_LEVEL_FATAL = 3, -} sentry_level_t; - -/** - * Creates a new empty Event value. - * - * See https://docs.sentry.io/platforms/native/enriching-events/ for how to - * further work with events, and https://develop.sentry.dev/sdk/event-payloads/ - * for a detailed overview of the possible properties of an Event. - */ -SENTRY_API sentry_value_t sentry_value_new_event(void); - -/** - * Creates a new Message Event value. - * - * See https://develop.sentry.dev/sdk/event-payloads/message/ - * - * `logger` can be NULL to omit the logger value. - */ -SENTRY_API sentry_value_t sentry_value_new_message_event( - sentry_level_t level, const char *logger, const char *text); - -/** - * Creates a new Breadcrumb with a specific type and message. - * - * See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ - * - * Either parameter can be NULL in which case no such attributes is created. - */ -SENTRY_API sentry_value_t sentry_value_new_breadcrumb( - const char *type, const char *message); - -/** - * Creates a new Exception value. - * - * This is intended for capturing language-level exception, such as from a - * try-catch block. `type` and `value` here refer to the exception class and - * a possible description. - * - * See https://develop.sentry.dev/sdk/event-payloads/exception/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_exception`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_exception( - const char *type, const char *value); - -/** - * Creates a new Thread value. - * - * See https://develop.sentry.dev/sdk/event-payloads/threads/ - * - * The returned value needs to be attached to an event via - * `sentry_event_add_thread`. - * - * `name` can be NULL. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( - uint64_t id, const char *name); - -/** - * Creates a new Stack Trace conforming to the Stack Trace Interface. - * - * See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ - * - * The returned object must be attached to either an exception or thread - * object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_stacktrace( - void **ips, size_t len); - -/** - * Sets the Stack Trace conforming to the Stack Trace Interface in a value. - * - * The value argument must be either an exception or thread object. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` stack - * trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_value_set_stacktrace( - sentry_value_t value, void **ips, size_t len); - -/** - * Adds an Exception to an Event value. - * - * This takes ownership of the `exception`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_exception( - sentry_value_t event, sentry_value_t exception); - -/** - * Adds a Thread to an Event value. - * - * This takes ownership of the `thread`. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_add_thread( - sentry_value_t event, sentry_value_t thread); - -/* -- Experimental APIs -- */ - -/** - * Serialize a sentry value to msgpack. - * - * The string is freshly allocated and must be freed with - * `sentry_string_free`. Since msgpack is not zero terminated - * the size is written to the `size_out` parameter. - */ -SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack( - sentry_value_t value, size_t *size_out); - -/** - * Adds a stack trace to an event. - * - * The stack trace is added as part of a new thread object. - * This function is **deprecated** in favor of using - * `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` - * and `sentry_event_add_thread`. - * - * If `ips` is NULL the current stack trace is captured, otherwise `len` - * stack trace instruction pointers are attached to the event. - */ -SENTRY_EXPERIMENTAL_API void sentry_event_value_add_stacktrace( - sentry_value_t event, void **ips, size_t len); - -/** - * This represents the OS dependent user context in the case of a crash, and can - * be used to manually capture a crash. - */ -typedef struct sentry_ucontext_s { -#ifdef _WIN32 - EXCEPTION_POINTERS exception_ptrs; -#else - int signum; - siginfo_t *siginfo; - ucontext_t *user_context; -#endif -} sentry_ucontext_t; - -/** - * Unwinds the stack from the given address. - * - * If the address is given in `addr` the stack is unwound form there. - * Otherwise (NULL is passed) the current instruction pointer is used as - * start address. - * Unwinding with a given `addr` is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( - void *addr, void **stacktrace_out, size_t max_len); - -/** - * Unwinds the stack from the given context. - * - * The caller is responsible to construct an appropriate `sentry_ucontext_t`. - * Unwinding from a user context is not supported on all platforms. - * - * The stack trace in the form of instruction-addresses, is written to the - * caller allocated `stacktrace_out`, with up to `max_len` frames being written. - * The actual number of unwound stackframes is returned. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext( - const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len); - -/** - * A UUID - */ -typedef struct sentry_uuid_s { - char bytes[16]; -} sentry_uuid_t; - -/** - * Creates the nil uuid. - */ -SENTRY_API sentry_uuid_t sentry_uuid_nil(void); - -/** - * Creates a new uuid4. - */ -SENTRY_API sentry_uuid_t sentry_uuid_new_v4(void); - -/** - * Parses a uuid from a string. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_string(const char *str); - -/** - * Creates a uuid from bytes. - */ -SENTRY_API sentry_uuid_t sentry_uuid_from_bytes(const char bytes[16]); - -/** - * Checks if the uuid is nil. - */ -SENTRY_API int sentry_uuid_is_nil(const sentry_uuid_t *uuid); - -/** - * Returns the bytes of the uuid. - */ -SENTRY_API void sentry_uuid_as_bytes(const sentry_uuid_t *uuid, char bytes[16]); - -/** - * Formats the uuid into a string buffer. - */ -SENTRY_API void sentry_uuid_as_string(const sentry_uuid_t *uuid, char str[37]); - -/** - * A Sentry Envelope. - * - * The Envelope is an abstract type which represents a payload being sent to - * sentry. It can contain one or more items, typically an Event. - * See https://develop.sentry.dev/sdk/envelopes/ - */ -struct sentry_envelope_s; -typedef struct sentry_envelope_s sentry_envelope_t; - -/** - * Frees an envelope. - */ -SENTRY_API void sentry_envelope_free(sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Event if there is one. - * - * This returns a borrowed value to the Event in the Envelope. - */ -SENTRY_API sentry_value_t sentry_envelope_get_event( - const sentry_envelope_t *envelope); - -/** - * Given an Envelope, returns the embedded Transaction if there is one. - * - * This returns a borrowed value to the Transaction in the Envelope. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( - const sentry_envelope_t *envelope); - -/** - * Serializes the envelope. - * - * The return value needs to be freed with sentry_string_free(). - */ -SENTRY_API char *sentry_envelope_serialize( - const sentry_envelope_t *envelope, size_t *size_out); - -/** - * Serializes the envelope into a file. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_envelope_write_to_file( - const sentry_envelope_t *envelope, const char *path); - -/** - * The Sentry Client Options. - * - * See https://docs.sentry.io/platforms/native/configuration/ - */ -struct sentry_options_s; -typedef struct sentry_options_s sentry_options_t; - -/** - * This represents an interface for user-defined transports. - * - * Transports are responsible for sending envelopes to sentry and are the last - * step in the event pipeline. - * - * Envelopes will be submitted to the transport in a _fire and forget_ fashion, - * and the transport must send those envelopes _in order_. - * - * A transport has the following hooks, all of which - * take the user provided `state` as last parameter. The transport state needs - * to be set with `sentry_transport_set_state` and typically holds handles and - * other information that can be reused across requests. - * - * * `send_func`: This function will take ownership of an envelope, and is - * responsible for freeing it via `sentry_envelope_free`. - * * `startup_func`: This hook will be called by sentry inside of `sentry_init` - * and instructs the transport to initialize itself. Failures will bubble up - * to `sentry_init`. - * * `flush_func`: Instructs the transport to flush its queue. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport queue is flushed within the timeout. - * * `shutdown_func`: Instructs the transport to flush its queue and shut down. - * This hook receives a millisecond-resolution `timeout` parameter and should - * return `0` if the transport is flushed and shut down successfully. - * In case of a non-zero return value, sentry will log an error, but continue - * with freeing the transport. - * * `free_func`: Frees the transports `state`. This hook might be called even - * though `shutdown_func` returned a failure code previously. - * - * The transport interface might be extended in the future with hooks to flush - * its internal queue without shutting down, and to dump its internal queue to - * disk in case of a hard crash. - */ -struct sentry_transport_s; -typedef struct sentry_transport_s sentry_transport_t; - -/** - * Creates a new transport with an initial `send_func`. - */ -SENTRY_API sentry_transport_t *sentry_transport_new( - void (*send_func)(sentry_envelope_t *envelope, void *state)); - -/** - * Sets the transport `state`. - * - * If the state is owned by the transport and needs to be freed, use - * `sentry_transport_set_free_func` to set an appropriate hook. - */ -SENTRY_API void sentry_transport_set_state( - sentry_transport_t *transport, void *state); - -/** - * Sets the transport hook to free the transport `state`. - */ -SENTRY_API void sentry_transport_set_free_func( - sentry_transport_t *transport, void (*free_func)(void *state)); - -/** - * Sets the transport startup hook. - * - * This hook is called from within `sentry_init` and will get a reference to the - * options which can be used to initialize a transports internal state. - * It should return `0` on success. A failure will bubble up to `sentry_init`. - */ -SENTRY_API void sentry_transport_set_startup_func(sentry_transport_t *transport, - int (*startup_func)(const sentry_options_t *options, void *state)); - -/** - * Sets the transport flush hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` if all the pending envelopes are - * sent within the timeout, or `1` if the timeout is hit. - */ -SENTRY_API void sentry_transport_set_flush_func(sentry_transport_t *transport, - int (*flush_func)(uint64_t timeout, void *state)); - -/** - * Sets the transport shutdown hook. - * - * This hook will receive a millisecond-resolution timeout. - * It should return `0` on success in case all the pending envelopes have been - * sent within the timeout, or `1` if the timeout was hit. - */ -SENTRY_API void sentry_transport_set_shutdown_func( - sentry_transport_t *transport, - int (*shutdown_func)(uint64_t timeout, void *state)); - -/** - * Generic way to free a transport. - */ -SENTRY_API void sentry_transport_free(sentry_transport_t *transport); - -/** - * Create a new function transport. - * - * It is a convenience function which works with a borrowed `data`, and will - * automatically free the envelope, so the user provided function does not need - * to do that. - * - * This function is *deprecated* and will be removed in a future version. - * It is here for backwards compatibility. Users should migrate to the - * `sentry_transport_new` API. - */ -SENTRY_API sentry_transport_t *sentry_new_function_transport( - void (*func)(const sentry_envelope_t *envelope, void *data), void *data); - -/** - * This represents an interface for user-defined backends. - * - * Backends are responsible to handle crashes. They are maintained at runtime - * via various life-cycle hooks from the sentry-core. - * - * At this point none of those interfaces are exposed in the API including - * creation and destruction. The main use-case of the backend in the API at this - * point is to disable it via `sentry_options_set_backend` at runtime before it - * is initialized. - */ -struct sentry_backend_s; -typedef struct sentry_backend_s sentry_backend_t; - -/* -- Options APIs -- */ - -/** - * The state of user consent. - */ -typedef enum { - SENTRY_USER_CONSENT_UNKNOWN = -1, - SENTRY_USER_CONSENT_GIVEN = 1, - SENTRY_USER_CONSENT_REVOKED = 0, -} sentry_user_consent_t; - -/** - * Creates a new options struct. - * Can be freed with `sentry_options_free`. - */ -SENTRY_API sentry_options_t *sentry_options_new(void); - -/** - * Deallocates previously allocated sentry options. - */ -SENTRY_API void sentry_options_free(sentry_options_t *opts); - -/** - * Sets a transport. - */ -SENTRY_API void sentry_options_set_transport( - sentry_options_t *opts, sentry_transport_t *transport); - -/** - * Type of the `before_send` callback. - * - * The callback takes ownership of the `event`, and should usually return that - * same event. In case the event should be discarded, the callback needs to - * call `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * If you have set an `on_crash` callback (independent of whether it discards or - * retains the event), `before_send` will no longer be invoked for crash-events, - * which allows you to better distinguish between crashes and all other events - * in client-side pre-processing. - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Up to version 0.4.18 the `before_send` callback wasn't invoked in case the - * event sampling discarded an event. In the current implementation the - * `before_send` callback is invoked even if the event sampling discards the - * event, following the cross-SDK session filter order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - */ -typedef sentry_value_t (*sentry_event_function_t)( - sentry_value_t event, void *hint, void *closure); - -/** - * Sets the `before_send` callback. - * - * See the `sentry_event_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_before_send( - sentry_options_t *opts, sentry_event_function_t func, void *data); - -/** - * Type of the `on_crash` callback. - * - * The `on_crash` callback replaces the `before_send` callback for crash events. - * The interface is analogous to `before_send` in that the callback takes - * ownership of the `event`, and should usually return that same event. In case - * the event should be discarded, the callback needs to call - * `sentry_value_decref` on the provided event, and return a - * `sentry_value_new_null()` instead. - * - * Only the `inproc` backend currently fills the passed-in event with useful - * data and processes any modifications to the return value. Since both - * `breakpad` and `crashpad` use minidumps to capture the crash state, the - * passed-in event is empty when using these backends, and they ignore any - * changes to the return value. - * - * If you set this callback in the options, it prevents a concurrently enabled - * `before_send` callback from being invoked in the crash case. This allows for - * better differentiation between crashes and other events and gradual migration - * from existing `before_send` implementations: - * - * - if you have a `before_send` implementation and do not define an `on_crash` - * callback your application will receive both normal and crash events as - * before - * - if you have a `before_send` implementation but only want to handle normal - * events with it, then you can define an `on_crash` callback that returns - * the passed-in event and does nothing else - * - if you are not interested in normal events, but only want to act on - * crashes (within the limits mentioned below), then only define an - * `on_crash` callback with the option to filter (on all backends) or enrich - * (only inproc) the crash event - * - * This function may be invoked inside of a signal handler and must be safe for - * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. - * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see - * the documentation on SEH (structured exception handling) for more information - * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling - * - * Platform-specific behavior: - * - * - does not work with crashpad on macOS. - * - for breakpad on Linux the `uctx` parameter is always NULL. - */ -typedef sentry_value_t (*sentry_crash_function_t)( - const sentry_ucontext_t *uctx, sentry_value_t event, void *closure); - -/** - * Sets the `on_crash` callback. - * - * See the `sentry_crash_function_t` typedef above for more information. - */ -SENTRY_API void sentry_options_set_on_crash( - sentry_options_t *opts, sentry_crash_function_t func, void *data); - -/** - * Sets the DSN. - */ -SENTRY_API void sentry_options_set_dsn(sentry_options_t *opts, const char *dsn); - -/** - * Gets the DSN. - */ -SENTRY_API const char *sentry_options_get_dsn(const sentry_options_t *opts); - -/** - * Sets the sample rate, which should be a double between `0.0` and `1.0`. - * Sentry will randomly discard any event that is captured using - * `sentry_capture_event` when a sample rate < 1 is set. - * - * The sampling happens at the end of the event processing according to the - * following order: - * - * https://develop.sentry.dev/sdk/sessions/#filter-order - * - * Only items 3. to 6. are currently applicable to sentry-native. This means - * each processing step is executed even if the sampling discards the event - * before sending it to the backend. This is particularly relevant to users of - * the `before_send` callback. - * - * The above is in contrast to versions up to 0.4.18 where the sampling happened - * at the beginning of the processing/filter sequence. - */ -SENTRY_API void sentry_options_set_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Gets the sample rate. - */ -SENTRY_API double sentry_options_get_sample_rate(const sentry_options_t *opts); - -/** - * Sets the release. - */ -SENTRY_API void sentry_options_set_release( - sentry_options_t *opts, const char *release); - -/** - * Gets the release. - */ -SENTRY_API const char *sentry_options_get_release(const sentry_options_t *opts); - -/** - * Sets the environment. - */ -SENTRY_API void sentry_options_set_environment( - sentry_options_t *opts, const char *environment); - -/** - * Gets the environment. - */ -SENTRY_API const char *sentry_options_get_environment( - const sentry_options_t *opts); - -/** - * Sets the dist. - */ -SENTRY_API void sentry_options_set_dist( - sentry_options_t *opts, const char *dist); - -/** - * Gets the dist. - */ -SENTRY_API const char *sentry_options_get_dist(const sentry_options_t *opts); - -/** - * Configures the http proxy. - * - * The given proxy has to include the full scheme, eg. `http://some.proxy/`. - */ -SENTRY_API void sentry_options_set_http_proxy( - sentry_options_t *opts, const char *proxy); - -/** - * Returns the configured http proxy. - */ -SENTRY_API const char *sentry_options_get_http_proxy( - const sentry_options_t *opts); - -/** - * Configures the path to a file containing ssl certificates for - * verification. - */ -SENTRY_API void sentry_options_set_ca_certs( - sentry_options_t *opts, const char *path); - -/** - * Returns the configured path for ca certificates. - */ -SENTRY_API const char *sentry_options_get_ca_certs( - const sentry_options_t *opts); - -/** - * Configures the name of the http transport thread. - */ -SENTRY_API void sentry_options_set_transport_thread_name( - sentry_options_t *opts, const char *name); - -/** - * Returns the configured http transport thread name. - */ -SENTRY_API const char *sentry_options_get_transport_thread_name( - const sentry_options_t *opts); - -/** - * Enables or disables debug printing mode. - */ -SENTRY_API void sentry_options_set_debug(sentry_options_t *opts, int debug); - -/** - * Returns the current value of the debug flag. - */ -SENTRY_API int sentry_options_get_debug(const sentry_options_t *opts); - -/** - * Sets the number of breadcrumbs being tracked and attached to events. - * - * Defaults to 100. - */ -SENTRY_API void sentry_options_set_max_breadcrumbs( - sentry_options_t *opts, size_t max_breadcrumbs); - -/** - * Gets the number of breadcrumbs being tracked and attached to events. - */ -SENTRY_API size_t sentry_options_get_max_breadcrumbs( - const sentry_options_t *opts); - -/** - * Type of the callback for logger function. - */ -typedef void (*sentry_logger_function_t)( - sentry_level_t level, const char *message, va_list args, void *userdata); - -/** - * Sets the sentry-native logger function. - * - * Used for logging debug events when the `debug` option is set to true. - */ -SENTRY_API void sentry_options_set_logger( - sentry_options_t *opts, sentry_logger_function_t func, void *userdata); - -/** - * Enables or disables automatic session tracking. - * - * Automatic session tracking is enabled by default and is equivalent to calling - * `sentry_start_session` after startup. - * There can only be one running session, and the current session will always be - * closed implicitly by `sentry_close`, when starting a new session with - * `sentry_start_session`, or manually by calling `sentry_end_session`. - */ -SENTRY_API void sentry_options_set_auto_session_tracking( - sentry_options_t *opts, int val); - -/** - * Returns true if automatic session tracking is enabled. - */ -SENTRY_API int sentry_options_get_auto_session_tracking( - const sentry_options_t *opts); - -/** - * Enables or disables user consent requirements for uploads. - * - * This disables uploads until the user has given the consent to the SDK. - * Consent itself is given with `sentry_user_consent_give` and - * `sentry_user_consent_revoke`. - */ -SENTRY_API void sentry_options_set_require_user_consent( - sentry_options_t *opts, int val); - -/** - * Returns true if user consent is required. - */ -SENTRY_API int sentry_options_get_require_user_consent( - const sentry_options_t *opts); - -/** - * Enables or disables on-device symbolication of stack traces. - * - * This feature can have a performance impact, and is enabled by default on - * Android. It is usually only needed when it is not possible to provide debug - * information files for system libraries which are needed for serverside - * symbolication. - */ -SENTRY_API void sentry_options_set_symbolize_stacktraces( - sentry_options_t *opts, int val); - -/** - * Returns true if on-device symbolication of stack traces is enabled. - */ -SENTRY_API int sentry_options_get_symbolize_stacktraces( - const sentry_options_t *opts); - -/** - * Adds a new attachment to be sent along. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_add_attachmentw` - * instead. - */ -SENTRY_API void sentry_options_add_attachment( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the crashpad handler if the crashpad backend is used. - * - * The path defaults to the `crashpad_handler`/`crashpad_handler.exe` - * executable, depending on platform, which is expected to be present in the - * same directory as the app executable. - * - * It is recommended that library users set an explicit handler path, depending - * on the directory/executable structure of their app. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use `sentry_options_set_handler_pathw` - * instead. - */ -SENTRY_API void sentry_options_set_handler_path( - sentry_options_t *opts, const char *path); - -/** - * Sets the path to the Sentry Database Directory. - * - * Sentry will use this path to persist user consent, sessions, and other - * artifacts in case of a crash. This will also be used by the crashpad backend - * if it is configured. - * - * The directory is used for "cached" data, which needs to persist across - * application restarts to ensure proper flagging of release-health sessions, - * but might otherwise be safely purged regularly. - * - * It is roughly equivalent to the type of `AppData/Local` on Windows and - * `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other - * platforms. - * - * It is recommended that users set an explicit absolute path, depending - * on their apps runtime directory. The path will be created if it does not - * exist, and will be resolved to an absolute path inside of `sentry_init`. The - * directory should not be shared with other application data/configuration, as - * sentry-native will enumerate and possibly delete files in that directory. An - * example might be `$XDG_CACHE_HOME/your-app/sentry` - * - * If no explicit path it set, sentry-native will default to `.sentry-native` in - * the current working directory, with no specific platform-specific handling. - * - * `path` is assumed to be in platform-specific filesystem path encoding. - * API Users on windows are encouraged to use - * `sentry_options_set_database_pathw` instead. - */ -SENTRY_API void sentry_options_set_database_path( - sentry_options_t *opts, const char *path); - -#ifdef SENTRY_PLATFORM_WINDOWS -/** - * Wide char version of `sentry_options_add_attachment`. - */ -SENTRY_API void sentry_options_add_attachmentw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_handler_path`. - */ -SENTRY_API void sentry_options_set_handler_pathw( - sentry_options_t *opts, const wchar_t *path); - -/** - * Wide char version of `sentry_options_set_database_path`. - */ -SENTRY_API void sentry_options_set_database_pathw( - sentry_options_t *opts, const wchar_t *path); -#endif - -/** - * Enables forwarding to the system crash reporter. Disabled by default. - * - * This setting only has an effect when using Crashpad on macOS. If enabled, - * Crashpad forwards crashes to the macOS system crash reporter. Depending - * on the crash, this may impact the crash time. Even if enabled, Crashpad - * may choose not to forward certain crashes. - */ -SENTRY_API void sentry_options_set_system_crash_reporter_enabled( - sentry_options_t *opts, int enabled); - -/** - * Sets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API void sentry_options_set_shutdown_timeout( - sentry_options_t *opts, uint64_t shutdown_timeout); - -/** - * Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to - * end on shutdown, before attempting a forced termination. - */ -SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts); - -/** - * Sets a user-defined backend. - * - * Since creation and destruction of backends is not exposed in the API, this - * can only be used to set the backend to `NULL`, which disables the backend in - * the initialization. - */ -SENTRY_API void sentry_options_set_backend( - sentry_options_t *opts, sentry_backend_t *backend); - -/* -- Global APIs -- */ - -/** - * Initializes the Sentry SDK with the specified options. - * - * This takes ownership of the options. After the options have been set - * they cannot be modified any more. - * Depending on the configured transport and backend, this function might not be - * fully thread-safe. - * Returns 0 on success. - */ -SENTRY_API int sentry_init(sentry_options_t *options); - -/** - * Instructs the transport to flush its send queue. - * - * The `timeout` parameter is in milliseconds. - * - * Returns 0 on success, or a non-zero return value in case the timeout is hit. - */ -SENTRY_API int sentry_flush(uint64_t timeout); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_close(void); - -/** - * Shuts down the sentry client and forces transports to flush out. - * - * This is a **deprecated** alias for `sentry_close`. - * - * Returns 0 on success. - */ -SENTRY_API int sentry_shutdown(void); - -/** - * This will lazily load and cache a list of all the loaded libraries. - * - * Returns a new reference to an immutable, frozen list. - * The reference must be released with `sentry_value_decref`. - */ -SENTRY_EXPERIMENTAL_API sentry_value_t sentry_get_modules_list(void); - -/** - * Clears the internal module cache. - * - * For performance reasons, sentry will cache the list of loaded libraries when - * capturing events. This cache can get out-of-date when loading or unloading - * libraries at runtime. It is therefore recommended to call - * `sentry_clear_modulecache` when doing so, to make sure that the next call to - * `sentry_capture_event` will have an up-to-date module list. - */ -SENTRY_EXPERIMENTAL_API void sentry_clear_modulecache(void); - -/** - * Re-initializes the Sentry backend. - * - * This is needed if a third-party library overrides the previously installed - * signal handler. Calling this function can be potentially dangerous and should - * only be done when necessary. - * - * Returns 0 on success. - */ -SENTRY_EXPERIMENTAL_API int sentry_reinstall_backend(void); - -/** - * Gives user consent. - */ -SENTRY_API void sentry_user_consent_give(void); - -/** - * Revokes user consent. - */ -SENTRY_API void sentry_user_consent_revoke(void); - -/** - * Resets the user consent (back to unknown). - */ -SENTRY_API void sentry_user_consent_reset(void); - -/** - * Checks the current state of user consent. - */ -SENTRY_API sentry_user_consent_t sentry_user_consent_get(void); - -/** - * Sends a sentry event. - * - * If returns a nil UUID if the event being passed in is a transaction, and the - * transaction will not be sent nor consumed. `sentry_transaction_finish` should - * be used to send transactions. - */ -SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event); - -/** - * Captures an exception to be handled by the backend. - * - * This is safe to be called from a crashing thread and may not return. - */ -SENTRY_EXPERIMENTAL_API void sentry_handle_exception( - const sentry_ucontext_t *uctx); - -/** - * Adds the breadcrumb to be sent in case of an event. - */ -SENTRY_API void sentry_add_breadcrumb(sentry_value_t breadcrumb); - -/** - * Sets the specified user. - */ -SENTRY_API void sentry_set_user(sentry_value_t user); - -/** - * Removes a user. - */ -SENTRY_API void sentry_remove_user(void); - -/** - * Sets a tag. - */ -SENTRY_API void sentry_set_tag(const char *key, const char *value); - -/** - * Removes the tag with the specified key. - */ -SENTRY_API void sentry_remove_tag(const char *key); - -/** - * Sets extra information. - */ -SENTRY_API void sentry_set_extra(const char *key, sentry_value_t value); - -/** - * Removes the extra with the specified key. - */ -SENTRY_API void sentry_remove_extra(const char *key); - -/** - * Sets a context object. - */ -SENTRY_API void sentry_set_context(const char *key, sentry_value_t value); - -/** - * Removes the context object with the specified key. - */ -SENTRY_API void sentry_remove_context(const char *key); - -/** - * Sets the event fingerprint. - * - * This accepts a variable number of arguments, and needs to be terminated by a - * trailing `NULL`. - */ -SENTRY_API void sentry_set_fingerprint(const char *fingerprint, ...); - -/** - * Removes the fingerprint. - */ -SENTRY_API void sentry_remove_fingerprint(void); - -/** - * Sets the transaction. - */ -SENTRY_API void sentry_set_transaction(const char *transaction); - -/** - * Sets the event level. - */ -SENTRY_API void sentry_set_level(sentry_level_t level); - -/** - * Starts a new session. - */ -SENTRY_API void sentry_start_session(void); - -/** - * Ends a session. - */ -SENTRY_API void sentry_end_session(void); - -/** - * Sets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_max_spans( - sentry_options_t *opts, size_t max_spans); - -/** - * Gets the maximum number of spans that can be attached to a - * transaction. - */ -SENTRY_EXPERIMENTAL_API size_t sentry_options_get_max_spans( - sentry_options_t *opts); - -/** - * Sets the sample rate for transactions. Should be a double between - * `0.0` and `1.0`. Transactions will be randomly discarded during - * `sentry_transaction_finish` when the sample rate is < 1.0. - */ -SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sample_rate( - sentry_options_t *opts, double sample_rate); - -/** - * Returns the sample rate for transactions. - */ -SENTRY_EXPERIMENTAL_API double sentry_options_get_traces_sample_rate( - sentry_options_t *opts); - -/* -- Performance Monitoring/Tracing APIs -- */ - -/** - * A sentry Transaction Context. - * - * See Transaction Interface under - * https://develop.sentry.dev/sdk/performance/#new-span-and-transaction-classes - */ -struct sentry_transaction_context_s; -typedef struct sentry_transaction_context_s sentry_transaction_context_t; - -/** - * A sentry Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/transaction/ - */ -struct sentry_transaction_s; -typedef struct sentry_transaction_s sentry_transaction_t; - -/** - * A sentry Span. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ - */ -struct sentry_span_s; -typedef struct sentry_span_s sentry_span_t; - -/** - * Constructs a new Transaction Context. The returned value needs to be passed - * into `sentry_transaction_start` in order to be recorded and sent to sentry. - * - * See - * https://docs.sentry.io/platforms/native/enriching-events/transaction-name/ - * for an explanation of a Transaction's `name`, and - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around an `operation`'s value. - * - * Also see https://develop.sentry.dev/sdk/event-payloads/transaction/#anatomy - * for an explanation of `operation`, in addition to other properties and - * actions that can be performed on a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction Context - * if it needs to be mutated across threads. Methods operating on the - * Transaction Context will mention what kind of expectations they carry if they - * need to mutate or access the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * -sentry_transaction_context_new(const char *name, const char *operation); - -/** - * Sets the `name` on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * The Transaction Context should not be mutated by other functions while - * setting a name on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name( - sentry_transaction_context_t *tx_cxt, const char *name); - -/** - * Sets the `operation` on a Transaction Context, which will be used in the - * Transaction constructed off of the context - * - * See https://develop.sentry.dev/sdk/performance/span-operations/ for - * conventions on `operation`s. - * - * The Transaction Context should not be mutated by other functions while - * setting an operation on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation( - sentry_transaction_context_t *tx_cxt, const char *operation); - -/** - * Sets the `sampled` field on a Transaction Context, which will be used in the - * Transaction constructed off of the context. - * - * When passed any value above 0, the Transaction will bypass all sampling - * options and always be sent to sentry. If passed 0, this Transaction and its - * child spans will never be sent to sentry. - * - * The Transaction Context should not be mutated by other functions while - * setting `sampled` on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_sampled( - sentry_transaction_context_t *tx_cxt, int sampled); - -/** - * Removes the `sampled` field on a Transaction Context, which will be used in - * the Transaction constructed off of the context. - * - * The Transaction will use the sampling rate as defined in `sentry_options`. - * - * The Transaction Context should not be mutated by other functions while - * removing `sampled`. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_remove_sampled( - sentry_transaction_context_t *tx_cxt); - -/** - * Update the Transaction Context with the given HTTP header key/value pair. - * - * This is used to propagate distributed tracing metadata from upstream - * services. Therefore, the headers of incoming requests should be fed into this - * function so that sentry is able to continue a trace that was started by an - * upstream service. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header( - sentry_transaction_context_t *tx_cxt, const char *key, const char *value); - -/** - * Starts a new Transaction based on the provided context, restored from an - * external integration (i.e. a span from a different SDK) or manually - * constructed by a user. - * - * The second parameter is a custom Sampling Context to be used with a Traces - * Sampler to make a more informed sampling decision. The SDK does not currently - * support a custom Traces Sampler and this parameter is ignored for the time - * being but needs to be provided. - * - * Returns a Transaction, which is expected to be manually managed by the - * caller. Manual management involves ensuring that `sentry_transaction_finish` - * is invoked for the Transaction, and that the caller manually starts and - * finishes any child Spans as needed on the Transaction. - * - * Not invoking `sentry_transaction_finish` with the returned Transaction means - * it will be discarded, and will not be sent to sentry. - * - * To ensure that any Events or Message Events are associated with this - * Transaction while it is active, invoke and pass in the Transaction returned - * by this function to `sentry_set_transaction_object`. Further documentation on - * this can be found in `sentry_set_transaction_object`'s docstring. - * - * Takes ownership of `transaction_context`. A Transaction Context cannot be - * modified or re-used after it is used to start a Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Transaction if it - * needs to be mutated across threads. Methods operating on the Transaction will - * mention what kind of expectations they carry if they need to mutate or access - * the object in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start( - sentry_transaction_context_t *tx_cxt, sentry_value_t sampling_ctx); - -/** - * Finishes and sends a Transaction to sentry. The event ID of the Transaction - * will be returned if this was successful; A nil UUID will be returned - * otherwise. - * - * Always takes ownership of `transaction`, regardless of whether the operation - * was successful or not. A Transaction cannot be modified or re-used after it - * is finished. - */ -SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish( - sentry_transaction_t *tx); - -/** - * Sets the Transaction so any Events sent while the Transaction - * is active will be associated with the Transaction. - * - * If the Transaction being passed in is unsampled, it will still be associated - * with any new Events. This will lead to some Events pointing to orphan or - * missing traces in sentry, see - * https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#orphan-traces-and-broken-subtraces - * - * This increases the number of references pointing to the Transaction. Invoke - * `sentry_transaction_finish` to remove the Transaction set by this function as - * well as its reference by passing in the same Transaction as the one passed - * into this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_transaction_object( - sentry_transaction_t *tx); - -/** - * Sets the Span so any Events sent while the Span - * is active will be associated with the Span. - * - * This increases the number of references pointing to the Span. Invoke - * `sentry_span_finish` to remove the Span set by this function as well - * as its reference by passing in the same Span as the one passed into - * this function. - */ -SENTRY_EXPERIMENTAL_API void sentry_set_span(sentry_span_t *span); - -/** - * Starts a new Span. - * - * The return value of `sentry_transaction_start` should be passed in as - * `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * This increases the number of references pointing to the Transaction. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child( - sentry_transaction_t *parent, char *operation, char *description); - -/** - * Starts a new Span. - * - * The return value of `sentry_span_start_child` may be passed in as `parent`. - * - * Both `operation` and `description` can be null, but it is recommended to - * supply the former. See - * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions - * around operations. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of - * the created Span's properties and expectations for `operation` and - * `description`. - * - * Returns a value that should be passed into `sentry_span_finish`. Not - * finishing the Span means it will be discarded, and will not be sent to - * sentry. `sentry_value_null` will be returned if the child Span could not be - * created. - * - * To ensure that any Events or Message Events are associated with this - * Span while it is active, invoke and pass in the Span returned - * by this function to `sentry_set_span`. Further documentation on this can be - * found in `sentry_set_span`'s docstring. - * - * The returned value is not thread-safe. Users are expected to ensure that - * appropriate locking mechanisms are implemented over the Span if it needs - * to be mutated across threads. Methods operating on the Span will mention what - * kind of expectations they carry if they need to mutate or access the object - * in a thread-safe way. - */ -SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child( - sentry_span_t *parent, char *operation, char *description); - -/** - * Finishes a Span. - * - * This takes ownership of `span`. A Span cannot be modified or re-used after it - * is finished. - * - * This will mutate the `span`'s containing Transaction, so the containing - * Transaction should also not be mutated by other functions when finishing a - * span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_finish(sentry_span_t *span); - -/** - * Sets a tag on a Transaction to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Transaction should not be mutated by other functions while a tag is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag( - sentry_transaction_t *transaction, const char *tag, const char *value); - -/** - * Removes a tag from a Transaction. - * - * The Transaction should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag( - sentry_transaction_t *transaction, const char *tag); - -/** - * Sets the given key in a Transaction's "data" section to the given value. - * - * The Transaction should not be mutated by other functions while data is being - * set on it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data( - sentry_transaction_t *transaction, const char *key, sentry_value_t value); - -/** - * Removes a key from a Transaction's "data" section. - * - * The Transaction should not be mutated by other functions while data is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data( - sentry_transaction_t *transaction, const char *key); - -/** - * Sets a tag on a Span to the given string value. - * - * Tags longer than 200 bytes will be truncated. - * - * The Span should not be mutated by other functions while a tag is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_tag( - sentry_span_t *span, const char *tag, const char *value); - -/** - * Removes a tag from a Span. - * - * The Span should not be mutated by other functions while a tag is being - * removed from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag( - sentry_span_t *span, const char *tag); - -/** - * Sets the given key in a Span's "data" section to the given value. - * - * The Span should not be mutated by other functions while data is being set on - * it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_data( - sentry_span_t *span, const char *key, sentry_value_t value); - -/** - * Removes a key from a Span's "data" section. - * - * The Span should not be mutated by other functions while data is being removed - * from it. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_remove_data( - sentry_span_t *span, const char *key); - -/** - * Sets a Transaction's name. - * - * The Transaction should not be mutated by other functions while setting its - * name. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name( - sentry_transaction_t *transaction, const char *name); - -/** - * The status of a Span or Transaction. - * - * See https://develop.sentry.dev/sdk/event-payloads/span/ for documentation. - */ -typedef enum { - // The operation completed successfully. - // HTTP status 100..299 + successful redirects from the 3xx range. - SENTRY_SPAN_STATUS_OK, - // The operation was cancelled (typically by the user). - SENTRY_SPAN_STATUS_CANCELLED, - // Unknown. Any non-standard HTTP status code. - // "We do not know whether the transaction failed or succeeded." - SENTRY_SPAN_STATUS_UNKNOWN, - // Client specified an invalid argument. 4xx. - // Note that this differs from FailedPrecondition. InvalidArgument - // indicates arguments that are problematic regardless of the - // state of the system. - SENTRY_SPAN_STATUS_INVALID_ARGUMENT, - // Deadline expired before operation could complete. - // For operations that change the state of the system, this error may be - // returned even if the operation has been completed successfully. - // HTTP redirect loops and 504 Gateway Timeout. - SENTRY_SPAN_STATUS_DEADLINE_EXCEEDED, - // 404 Not Found. Some requested entity (file or directory) was not found. - SENTRY_SPAN_STATUS_NOT_FOUND, - // Already exists (409) - // Some entity that we attempted to create already exists. - SENTRY_SPAN_STATUS_ALREADY_EXISTS, - // 403 Forbidden - // The caller does not have permission to execute the specified operation. - SENTRY_SPAN_STATUS_PERMISSION_DENIED, - // 429 Too Many Requests - // Some resource has been exhausted, perhaps a per-user quota or perhaps - // the entire file system is out of space. - SENTRY_SPAN_STATUS_RESOURCE_EXHAUSTED, - // Operation was rejected because the system is not in a state required for - // the operation's execution. - SENTRY_SPAN_STATUS_FAILED_PRECONDITION, - // The operation was aborted, typically due to a concurrency issue. - SENTRY_SPAN_STATUS_ABORTED, - // Operation was attempted past the valid range. - SENTRY_SPAN_STATUS_OUT_OF_RANGE, - // 501 Not Implemented - // Operation is not implemented or not enabled. - SENTRY_SPAN_STATUS_UNIMPLEMENTED, - // Other/generic 5xx - SENTRY_SPAN_STATUS_INTERNAL_ERROR, - // 503 Service Unavailable - SENTRY_SPAN_STATUS_UNAVAILABLE, - // Unrecoverable data loss or corruption - SENTRY_SPAN_STATUS_DATA_LOSS, - // 401 Unauthorized (actually does mean unauthenticated according to RFC - // 7235) - // Prefer PermissionDenied if a user is logged in. - SENTRY_SPAN_STATUS_UNAUTHENTICATED, -} sentry_span_status_t; - -/** - * Sets a Span's status. - * - * The Span should not be mutated by other functions while setting its status. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_set_status( - sentry_span_t *span, sentry_span_status_t status); - -/** - * Sets a Transaction's status. - * - * The Transaction should not be mutated by other functions while setting its - * status. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_set_status( - sentry_transaction_t *tx, sentry_span_status_t status); - -/** - * Type of the `iter_headers` callback. - * - * The callback is being called with HTTP header key/value pairs. - * These headers can be attached to outgoing HTTP requests to propagate - * distributed tracing metadata to downstream services. - * - */ -typedef void (*sentry_iter_headers_function_t)( - const char *key, const char *value, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given span. - */ -SENTRY_EXPERIMENTAL_API void sentry_span_iter_headers(sentry_span_t *span, - sentry_iter_headers_function_t callback, void *userdata); - -/** - * Iterates the distributed tracing HTTP headers for the given transaction. - */ -SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers( - sentry_transaction_t *tx, sentry_iter_headers_function_t callback, - void *userdata); - -/** - * Returns whether the application has crashed on the last run. - * - * Notes: - * * The underlying value is set by sentry_init() - it must be called first. - * * Call sentry_clear_crashed_last_run() to reset for the next app run. - * - * Possible return values: - * 1 = the last run was a crash - * 0 = no crash recognized - * -1 = sentry_init() hasn't been called yet - */ -SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(); - -/** - * Clear the status of the "crashed-last-run". You should explicitly call - * this after sentry_init() if you're using sentry_get_crashed_last_run(). - * Otherwise, the same information is reported on any subsequent runs. - * - * Notes: - * * This doesn't change the value of sentry_get_crashed_last_run() yet. - * However, if sentry_init() is called again, the value will change. - * * This may only be called after sentry_init() and before sentry_close(). - * - * Returns 0 on success, 1 on error. - */ -SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(); - -/** - * Sentry SDK version. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(); - -/** - * Sentry SDK name. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(); - -/** - * Sentry SDK User-Agent. - */ -SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/plugin-dev/Source/ThirdParty/Win64/lib/sentry.lib b/plugin-dev/Source/ThirdParty/Win64/lib/sentry.lib deleted file mode 100644 index 67881a39b..000000000 Binary files a/plugin-dev/Source/ThirdParty/Win64/lib/sentry.lib and /dev/null differ diff --git a/scripts/build-java.sh b/scripts/build-android.sh similarity index 69% rename from scripts/build-java.sh rename to scripts/build-android.sh index fc9f86b8d..a439d41ce 100755 --- a/scripts/build-java.sh +++ b/scripts/build-android.sh @@ -7,10 +7,12 @@ export sentryArtifactsDestination=$2 rm -rf "${sentryArtifactsDestination}/"* pushd ${sentryJavaRoot} -"./gradlew" -PsentryAndroidSdkName=sentry.native.android.unreal :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar --no-daemon --stacktrace --warning-mode none +./gradlew -PsentryAndroidSdkName=sentry.native.android.unreal \ + :sentry-android-core:assembleRelease :sentry-android-ndk:assembleRelease :sentry:jar \ + --no-daemon --stacktrace --warning-mode none popd cp "${sentryJavaRoot}/sentry-android-ndk/build/outputs/aar/sentry-android-ndk-release.aar" "${sentryArtifactsDestination}/sentry-android-ndk-release.aar" cp "${sentryJavaRoot}/sentry-android-core/build/outputs/aar/sentry-android-core-release.aar" "${sentryArtifactsDestination}/sentry-android-core-release.aar" -cp "${sentryJavaRoot}/sentry/build/libs/"sentry-*.jar "${sentryArtifactsDestination}/sentry.jar" \ No newline at end of file +cp "${sentryJavaRoot}/sentry/build/libs/"sentry-*.jar "${sentryArtifactsDestination}/sentry.jar" diff --git a/scripts/build-cocoa.sh b/scripts/build-ios.sh similarity index 100% rename from scripts/build-cocoa.sh rename to scripts/build-ios.sh diff --git a/scripts/build-native-linux.sh b/scripts/build-linux.sh similarity index 86% rename from scripts/build-native-linux.sh rename to scripts/build-linux.sh index f854b3e32..c6d938a65 100755 --- a/scripts/build-native-linux.sh +++ b/scripts/build-linux.sh @@ -4,18 +4,19 @@ set -euo pipefail export sentryNativeRoot=$1 export sentryArtifactsDestination=$2 -rm -rf "${sentryArtifactsDestination}/bin/"* -rm -rf "${sentryArtifactsDestination}/include/"* +rm -rf "${sentryArtifactsDestination}/"* cmake -S "${sentryNativeRoot}" -B "${sentryNativeRoot}/build" -D SENTRY_BACKEND=crashpad -D SENTRY_SDK_NAME=sentry.native.unreal -D CMAKE_BUILD_TYPE=RelWithDebInfo cmake --build "${sentryNativeRoot}/build" --target sentry --parallel -strip -s "${sentryNativeRoot}/build/libsentry.so" -w -K sentry_[^_]* -o "${sentryArtifactsDestination}/bin/libsentry.so" +mkdir "${sentryArtifactsDestination}/bin" +mkdir "${sentryArtifactsDestination}/include" +strip -s "${sentryNativeRoot}/build/libsentry.so" -w -K sentry_[^_]* -o "${sentryArtifactsDestination}/bin/libsentry.so" cp "${sentryNativeRoot}/build/libsentry.so" "${sentryArtifactsDestination}/bin/libsentry.dbg.so" cp "${sentryNativeRoot}/build/crashpad_build/handler/crashpad_handler" "${sentryArtifactsDestination}/bin/crashpad_handler" cp "${sentryNativeRoot}/include/sentry.h" "${sentryArtifactsDestination}/include/sentry.h" pushd ${sentryArtifactsDestination}/bin objcopy --add-gnu-debuglink="libsentry.dbg.so" "libsentry.so" -popd \ No newline at end of file +popd diff --git a/scripts/build-native-mac.sh b/scripts/build-mac.sh similarity index 87% rename from scripts/build-native-mac.sh rename to scripts/build-mac.sh index 520105f53..045d823c6 100755 --- a/scripts/build-native-mac.sh +++ b/scripts/build-mac.sh @@ -4,13 +4,15 @@ set -euo pipefail export sentryNativeRoot=$1 export sentryArtifactsDestination=$2 -rm -rf "${sentryArtifactsDestination}/bin/"* -rm -rf "${sentryArtifactsDestination}/include/"* +rm -rf "${sentryArtifactsDestination}/"* cmake -S "${sentryNativeRoot}" -B "${sentryNativeRoot}/build" -D SENTRY_BACKEND=crashpad -D SENTRY_SDK_NAME=sentry.native.unreal -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 cmake --build "${sentryNativeRoot}/build" --target sentry --config RelWithDebInfo --parallel cmake --build "${sentryNativeRoot}/build" --target crashpad_handler --config Release --parallel +mkdir "${sentryArtifactsDestination}/bin" +mkdir "${sentryArtifactsDestination}/include" + cp "${sentryNativeRoot}/build/libsentry.dylib" "${sentryArtifactsDestination}/bin/libsentry.dylib" cp -R "${sentryNativeRoot}/build/libsentry.dylib.dSYM" "${sentryArtifactsDestination}/bin/libsentry.dylib.dSYM" cp "${sentryNativeRoot}/build/crashpad_build/handler/crashpad_handler" "${sentryArtifactsDestination}/bin/crashpad_handler" diff --git a/scripts/build-native-windows.ps1 b/scripts/build-native-windows.ps1 deleted file mode 100755 index 79eeedd8c..000000000 --- a/scripts/build-native-windows.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -param([string] $SentryNativeRoot,[string] $SentryArtifactsDestination) - -Remove-Item ${SentryArtifactsDestination}/bin/* -Remove-Item ${SentryArtifactsDestination}/lib/* -Remove-Item ${SentryArtifactsDestination}/include/* - -Push-Location $SentryNativeRoot - -cmake -B build -D SENTRY_BACKEND=crashpad -D SENTRY_SDK_NAME=sentry.native.unreal -cmake --build build --target sentry --config RelWithDebInfo --parallel -cmake --build build --target crashpad_handler --config Release --parallel - -Pop-Location - -Copy-Item ${SentryNativeRoot}/build/RelWithDebInfo/sentry.lib -Destination ${SentryArtifactsDestination}/lib/sentry.lib -Copy-Item ${SentryNativeRoot}/build/RelWithDebInfo/sentry.dll -Destination ${SentryArtifactsDestination}/bin/sentry.dll -Copy-Item ${SentryNativeRoot}/build/RelWithDebInfo/sentry.pdb -Destination ${SentryArtifactsDestination}/bin/sentry.pdb -Copy-Item ${SentryNativeRoot}/build/crashpad_build/handler/Release/crashpad_handler.exe -Destination ${SentryArtifactsDestination}/bin/crashpad_handler.exe -Copy-Item ${SentryNativeRoot}/include/sentry.h -Destination ${SentryArtifactsDestination}/include/sentry.h - diff --git a/scripts/build-win64.sh b/scripts/build-win64.sh new file mode 100755 index 000000000..0215d913b --- /dev/null +++ b/scripts/build-win64.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -euo pipefail + +export sentryNativeRoot=$1 +export sentryArtifactsDestination=$2 + +rm -rf "${sentryArtifactsDestination}/"* + +cmake -S "${sentryNativeRoot}" -B "${sentryNativeRoot}/build" -D SENTRY_BACKEND=crashpad -D SENTRY_SDK_NAME=sentry.native.unreal +cmake --build "${sentryNativeRoot}/build" --target sentry --config RelWithDebInfo --parallel +cmake --build "${sentryNativeRoot}/build" --target crashpad_handler --config Release --parallel + +mkdir "${sentryArtifactsDestination}/bin" +mkdir "${sentryArtifactsDestination}/include" +mkdir "${sentryArtifactsDestination}/lib" + +cp ${sentryNativeRoot}/build/RelWithDebInfo/sentry.lib ${sentryArtifactsDestination}/lib/sentry.lib +cp ${sentryNativeRoot}/build/RelWithDebInfo/sentry.dll ${sentryArtifactsDestination}/bin/sentry.dll +cp ${sentryNativeRoot}/build/RelWithDebInfo/sentry.pdb ${sentryArtifactsDestination}/bin/sentry.pdb +cp ${sentryNativeRoot}/build/crashpad_build/handler/Release/crashpad_handler.exe ${sentryArtifactsDestination}/bin/crashpad_handler.exe +cp ${sentryNativeRoot}/include/sentry.h ${sentryArtifactsDestination}/include/sentry.h diff --git a/scripts/bump-version-android.sh b/scripts/bump-version-android.sh old mode 100755 new mode 100644 diff --git a/scripts/checkout-submodule.sh b/scripts/checkout-submodule.sh deleted file mode 100755 index 6c53fe99d..000000000 --- a/scripts/checkout-submodule.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -euo pipefail - -git submodule foreach git submodule update --init --recursive \ No newline at end of file diff --git a/scripts/download-sdks.sh b/scripts/download-sdks.sh new file mode 100755 index 000000000..9726be4cd --- /dev/null +++ b/scripts/download-sdks.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +mkdir -p "$(dirname $0)/../plugin-dev/Source/ThirdParty" +cd "$(dirname $0)/../plugin-dev/Source/ThirdParty" + +findCiRun() { + echo "Looking for the latest successful CI run on branch $1" >/dev/stderr + id=$(gh run list --branch $1 --workflow package-plugin-workflow \ + --json 'conclusion,databaseId' --jq 'first(.[] | select(.conclusion == "success") | .databaseId)') + if [[ "$id" == "" ]]; then + echo " ... no successful CI run found on $1" >/dev/stderr + return 1 + else + echo " ... found CI run ID: $id" >/dev/stderr + echo "$id" + return 0 + fi +} + +runId=$(findCiRun "$(git rev-parse --abbrev-ref HEAD)" || findCiRun main) +if [[ "$runId" == "" ]]; then + exit 1 +fi + +declare -a sdks=("Android" "IOS" "Linux" "Mac" "Win64") +for sdk in "${sdks[@]}"; do + echo "Downloading $sdk SDK to $PWD/$sdk ..." + rm -rf "./$sdk" + gh run download $runId -n "$sdk-sdk" -D $sdk +done diff --git a/scripts/update-cocoa.sh b/scripts/update-cocoa.sh deleted file mode 100755 index 84d6dfe6c..000000000 --- a/scripts/update-cocoa.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -submodulePath=$"modules/sentry-cocoa" -targetPlatform=$"iOS" - -case $1 in -get-version) - git submodule update --init --no-fetch --single-branch $submodulePath >/dev/null - version=$(git -C $submodulePath describe --tags) - echo $version - ;; -get-repo) - echo "https://github.com/getsentry/sentry-cocoa.git" - ;; -set-version) - version=$2 - - git -C $submodulePath checkout $version - - ./scripts/checkout-submodule.sh $submodulePath - ./scripts/build-cocoa.sh $submodulePath plugin-dev/Source/ThirdParty/$targetPlatform - - echo "Setting submodule version to '$version'" - ;; -*) - echo "Unknown argument $1" - exit 1 - ;; -esac diff --git a/scripts/update-java.sh b/scripts/update-java.sh index 0b631d419..61ff89a7e 100755 --- a/scripts/update-java.sh +++ b/scripts/update-java.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -submodulePath=$"modules/sentry-java" -targetPlatform=$"Android" +submodulePath="modules/sentry-java" case $1 in get-version) @@ -15,15 +14,9 @@ get-repo) ;; set-version) version=$2 - + echo "Setting submodule version to '$version'" git -C $submodulePath checkout $version - - ./scripts/checkout-submodule.sh $submodulePath - ./scripts/build-java.sh $submodulePath plugin-dev/Source/ThirdParty/$targetPlatform - ./scripts/bump-version-android.sh $version - - echo "Setting submodule version to '$version'" ;; *) echo "Unknown argument $1" diff --git a/scripts/update-native-linux.sh b/scripts/update-native-linux.sh deleted file mode 100755 index 5621a246d..000000000 --- a/scripts/update-native-linux.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -submodulePath=$"modules/sentry-native" -targetPlatform=$"Linux" - -case $1 in -get-version) - git submodule update --init --no-fetch --single-branch $submodulePath >/dev/null - version=$(git -C $submodulePath describe --tags) - echo $version - ;; -get-repo) - echo "https://github.com/getsentry/sentry-native.git" - ;; -set-version) - version=$2 - - sudo apt-get update - sudo apt-get install zlib1g-dev libcurl4-openssl-dev libssl-dev - - git -C $submodulePath checkout $version - - ./scripts/checkout-submodule.sh $submodulePath - ./scripts/build-native-linux.sh $submodulePath plugin-dev/Source/ThirdParty/$targetPlatform - - echo "Setting submodule version to '$version'" - ;; -*) - echo "Unknown argument $1" - exit 1 - ;; -esac diff --git a/scripts/update-native-mac.sh b/scripts/update-native-mac.sh deleted file mode 100755 index dd45c02d1..000000000 --- a/scripts/update-native-mac.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -submodulePath=$"modules/sentry-native" -targetPlatform=$"Mac" - -case $1 in -get-version) - git submodule update --init --no-fetch --single-branch $submodulePath >/dev/null - version=$(git -C $submodulePath describe --tags) - echo $version - ;; -get-repo) - echo "https://github.com/getsentry/sentry-native.git" - ;; -set-version) - version=$2 - - git -C $submodulePath checkout $version - - ./scripts/checkout-submodule.sh $submodulePath - ./scripts/build-native-mac.sh $submodulePath plugin-dev/Source/ThirdParty/$targetPlatform - - echo "Setting submodule version to '$version'" - ;; -*) - echo "Unknown argument $1" - exit 1 - ;; -esac diff --git a/scripts/update-native-windows.ps1 b/scripts/update-native-windows.ps1 deleted file mode 100755 index c7df03bd6..000000000 --- a/scripts/update-native-windows.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -param([string] $Action, [string] $Tag) - -$submodulePath = "modules/sentry-native" -$targetPlatform = "Win64" - -function get-version () -{ - git submodule update --init --no-fetch --single-branch $submodulePath | Out-Null - $version = $(git -C $submodulePath describe --tags) - return $version -} - -function get-repo () -{ - $repo = "https://github.com/getsentry/sentry-native.git" - return $repo -} - -function set-version ([string] $version) -{ - git -C $submodulePath checkout $version - - git submodule foreach git submodule update --init --recursive - - & ./scripts/build-native-windows.ps1 $submodulePath plugin-dev/Source/ThirdParty/$targetPlatform -} - -switch ($Action) -{ - "get-version" - { - return get-version - } - "get-repo" - { - return get-repo - } - "set-version" - { - set-version $Tag - } - Default - { - throw "Unknown action $Action" - } -} \ No newline at end of file