From 11dbde856d7d93cfade5ca999878e453a50ebafd Mon Sep 17 00:00:00 2001 From: John Borges Date: Wed, 23 Jun 2021 17:39:11 -0400 Subject: [PATCH 1/5] chore(crashes): adding keywords for npm --- appcenter-crashes/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appcenter-crashes/package.json b/appcenter-crashes/package.json index 90f2154..485d253 100644 --- a/appcenter-crashes/package.json +++ b/appcenter-crashes/package.json @@ -25,7 +25,12 @@ "keywords": [ "capacitor", "plugin", - "native" + "appcenter", + "reporting", + "crash", + "error", + "azure", + "microsoft" ], "scripts": { "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", From 3cad3ee1be845b9bb9e9c627c87b01e748dd9c17 Mon Sep 17 00:00:00 2001 From: John Borges Date: Thu, 24 Jun 2021 19:46:53 -0400 Subject: [PATCH 2/5] refactor(crashes): use latest appcenter sdks --- .../CapacitorCommunityAppcenterCrashes.podspec | 4 ++-- appcenter-crashes/ios/Podfile | 4 ++-- appcenter-crashes/package.json | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appcenter-crashes/CapacitorCommunityAppcenterCrashes.podspec b/appcenter-crashes/CapacitorCommunityAppcenterCrashes.podspec index 2007dbc..87f47e9 100644 --- a/appcenter-crashes/CapacitorCommunityAppcenterCrashes.podspec +++ b/appcenter-crashes/CapacitorCommunityAppcenterCrashes.podspec @@ -15,6 +15,6 @@ Pod::Spec.new do |s| s.swift_version = '5.1' s.static_framework = true s.dependency 'Capacitor' - s.dependency 'AppCenterCapacitorShared', '0.3.0' - s.dependency 'AppCenter/Crashes', '4.1.1' + s.dependency 'AppCenterCapacitorShared', '0.3.1' + s.dependency 'AppCenter/Crashes', '4.2.0' end diff --git a/appcenter-crashes/ios/Podfile b/appcenter-crashes/ios/Podfile index ccc23ff..2754f12 100644 --- a/appcenter-crashes/ios/Podfile +++ b/appcenter-crashes/ios/Podfile @@ -9,8 +9,8 @@ end target 'Plugin' do capacitor_pods - pod 'AppCenterCapacitorShared', '0.3.0' - pod 'AppCenter/Crashes', '4.1.1' + pod 'AppCenterCapacitorShared', '0.3.1' + pod 'AppCenter/Crashes', '4.2.0' end target 'PluginTests' do diff --git a/appcenter-crashes/package.json b/appcenter-crashes/package.json index 485d253..24055df 100644 --- a/appcenter-crashes/package.json +++ b/appcenter-crashes/package.json @@ -1,7 +1,7 @@ { "name": "@capacitor-community/appcenter-crashes", - "version": "0.3.0", - "description": "Capacitor plugin for Microsoft AppCenter Crashes.", + "version": "0.3.1", + "description": "Capacitor plugin for Microsoft's App Center Crashes", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", "types": "dist/esm/index.d.ts", @@ -51,7 +51,7 @@ "devDependencies": { "@capacitor/android": "3.0.0", "@capacitor/core": "3.0.0", - "@capacitor/docgen": "^0.0.10", + "@capacitor/docgen": "^0.0.17", "@capacitor/ios": "3.0.0", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^1.0.1", @@ -65,7 +65,7 @@ "typescript": "~4.0.3" }, "peerDependencies": { - "@capacitor/core": "next" + "@capacitor/core": "3.0.0" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", From 8695a87370f476ff3be8f64851c516230066f70d Mon Sep 17 00:00:00 2001 From: John Borges Date: Thu, 24 Jun 2021 19:47:39 -0400 Subject: [PATCH 3/5] docs(crashes): cleanup jsdocs --- appcenter-crashes/CHANGELOG.md | 6 ++ appcenter-crashes/README.md | 82 ++++++++++----------- appcenter-crashes/src/definitions.ts | 106 ++++++++++++++++++++------- 3 files changed, 124 insertions(+), 70 deletions(-) diff --git a/appcenter-crashes/CHANGELOG.md b/appcenter-crashes/CHANGELOG.md index 326b499..8dd252d 100644 --- a/appcenter-crashes/CHANGELOG.md +++ b/appcenter-crashes/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 0.3.1 + +* Update `Appcenter/Analytics` to 4.2.0 +* Update `AppCenterCapacitorShared` to 0.3.1 +* Update `docgen` to 0.0.17 + ## 0.3.0 ### Features diff --git a/appcenter-crashes/README.md b/appcenter-crashes/README.md index cc5e34e..c462426 100644 --- a/appcenter-crashes/README.md +++ b/appcenter-crashes/README.md @@ -58,12 +58,12 @@ npx cap sync ### isEnabled() ```typescript -isEnabled() => any +isEnabled() => Promise<{ value: boolean; }> ``` Check if Crashes is enabled or not. -**Returns:** any +**Returns:** Promise<{ value: boolean; }> **Since:** 0.1.0 @@ -73,7 +73,7 @@ Check if Crashes is enabled or not. ### setEnabled(...) ```typescript -setEnabled(options: { shouldEnable: boolean; }) => any +setEnabled(options: { shouldEnable: boolean; }) => Promise ``` You can enable and disable App Center Crashes at runtime. If you disable it, the SDK won't do any crash reporting for the app. @@ -83,8 +83,6 @@ The state is persisted in the device's storage across application launches. | ------------- | --------------------------------------- | | **`options`** | { shouldEnable: boolean; } | -**Returns:** any - **Since:** 0.1.0 -------------------- @@ -93,13 +91,11 @@ The state is persisted in the device's storage across application launches. ### generateTestCrash() ```typescript -generateTestCrash() => any +generateTestCrash() => Promise ``` Generate a test crash for easy testing of the SDK. This API can only be used in test/beta apps and won't do anything in production apps. -**Returns:** any - **Since:** 0.2.0 -------------------- @@ -108,12 +104,12 @@ Generate a test crash for easy testing of the SDK. This API can only be used in ### hasReceivedMemoryWarningInLastSession() ```typescript -hasReceivedMemoryWarningInLastSession() => any +hasReceivedMemoryWarningInLastSession() => Promise<{ value: boolean; }> ``` Check if app recieved memory warning in the last session. -**Returns:** any +**Returns:** Promise<{ value: boolean; }> **Since:** 0.2.0 @@ -123,12 +119,12 @@ Check if app recieved memory warning in the last session. ### hasCrashedInLastSession() ```typescript -hasCrashedInLastSession() => any +hasCrashedInLastSession() => Promise<{ value: boolean; }> ``` Check if the app has crashed in the last session. -**Returns:** any +**Returns:** Promise<{ value: boolean; }> **Since:** 0.3.0 @@ -138,12 +134,12 @@ Check if the app has crashed in the last session. ### lastSessionCrashReport() ```typescript -lastSessionCrashReport() => any +lastSessionCrashReport() => Promise<{ value: ErrorReport; }> ``` Provides details about the crash that occurred in the last app session. -**Returns:** any +**Returns:** Promise<{ value: ErrorReport; }> **Since:** 0.3.0 @@ -155,38 +151,38 @@ Provides details about the crash that occurred in the last app session. #### ErrorReport -| Prop | Type | -| -------------------------- | ----------------------------------------- | -| **`id`** | string | -| **`threadName`** | string | -| **`appErrorTime`** | string \| number | -| **`appStartTime`** | string \| number | -| **`exceptionName`** | string | -| **`exceptionReason`** | string | -| **`device`** | Device | -| **`signal`** | string | -| **`appProcessIdentifier`** | number | +| Prop | Type | Description | +| -------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | +| **`id`** | string | UUID for the crash report. | +| **`threadName`** | string | | +| **`appErrorTime`** | string \| number | Date and time the error occurred. | +| **`appStartTime`** | string \| number | Date and time the app started. | +| **`exceptionName`** | string | Exception name that triggered the crash. | +| **`exceptionReason`** | string | Exception reason. | +| **`device`** | Device | Device information of the app when it crashed. | +| **`signal`** | string | Signal that caused the crash. | +| **`appProcessIdentifier`** | number | Identifier of the app process that crashed. | #### Device -| Prop | Type | -| -------------------- | ------------------- | -| **`sdkName`** | string | -| **`sdkVersion`** | string | -| **`model`** | string | -| **`oemName`** | string | -| **`osName`** | string | -| **`osVersion`** | string | -| **`osBuild`** | string | -| **`osApiLevel`** | number | -| **`locale`** | string | -| **`timeZoneOffset`** | number | -| **`screenSize`** | string | -| **`appVersion`** | string | -| **`carrierName`** | string | -| **`carrierCountry`** | string | -| **`appBuild`** | string | -| **`appNamespace`** | string | +| Prop | Type | Description | +| -------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| **`sdkName`** | string | Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android" | +| **`sdkVersion`** | string | Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1". | +| **`model`** | string | Device model (example: iPad2,3). | +| **`oemName`** | string | Device manufacturer (example: HTC). | +| **`osName`** | string | OS name (example: iOS). | +| **`osVersion`** | string | OS version (example: 9.3.0). | +| **`osBuild`** | string | OS build code (example: LMY47X). | +| **`osApiLevel`** | number | API level when applicable like in Android (example: 15). | +| **`locale`** | string | Language code (example: en_US). | +| **`timeZoneOffset`** | number | The offset in minutes from UTC for the device time zone, including daylight savings time. | +| **`screenSize`** | string | Screen size of the device in pixels (example: 640x480). | +| **`appVersion`** | string | Application version name, e.g. 1.1.0 | +| **`carrierName`** | string | Carrier name (for mobile devices). | +| **`carrierCountry`** | string | Carrier country code (for mobile devices). | +| **`appBuild`** | string | The app's build number, e.g. 42. | +| **`appNamespace`** | string | The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example. | diff --git a/appcenter-crashes/src/definitions.ts b/appcenter-crashes/src/definitions.ts index d4b064e..df4076e 100644 --- a/appcenter-crashes/src/definitions.ts +++ b/appcenter-crashes/src/definitions.ts @@ -5,57 +5,105 @@ export enum UserConfirmation { } export interface Device { - /* Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android" */ + /** + * Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android" + */ sdkName: string; - /* Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1". */ + /** + * Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1". + */ sdkVersion: string; - /* Device model (example: iPad2,3). */ + /** + * Device model (example: iPad2,3). + */ model: string; - /* Device manufacturer (example: HTC). */ + /** + * Device manufacturer (example: HTC). + */ oemName: string; - /* OS name (example: iOS). */ + /** + * OS name (example: iOS). + */ osName: string; - /* OS version (example: 9.3.0). */ + /** + * OS version (example: 9.3.0). + */ osVersion: string; - /* OS build code (example: LMY47X). */ + /** + * OS build code (example: LMY47X). + */ osBuild?: string; - /* API level when applicable like in Android (example: 15). */ + /** + * API level when applicable like in Android (example: 15). + */ osApiLevel?: number; - /* Language code (example: en_US). */ + /** + * Language code (example: en_US). + */ locale: string; - /* The offset in minutes from UTC for the device time zone, including daylight savings time. */ + /** + * The offset in minutes from UTC for the device time zone, including daylight savings time. + */ timeZoneOffset: number; - /* Screen size of the device in pixels (example: 640x480). */ + /** + * Screen size of the device in pixels (example: 640x480). + */ screenSize: string; - /* Application version name, e.g. 1.1.0 */ + /** + * Application version name, e.g. 1.1.0 + */ appVersion: string; - /* Carrier name (for mobile devices). */ + /** + * Carrier name (for mobile devices). + */ carrierName?: string; - /* Carrier country code (for mobile devices). */ + /** + * Carrier country code (for mobile devices). + */ carrierCountry?: string; - /* The app's build number, e.g. 42. */ + /** + * The app's build number, e.g. 42. + */ appBuild: string; - /* The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example. */ + /** + * The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example. + */ appNamespace?: string; } export interface ErrorReport { - /* UUID for the crash report. */ + /** + * UUID for the crash report. + */ id: string; threadName?: string; - /* Date and time the error occurred. */ + /** + * Date and time the error occurred. + */ appErrorTime?: string | number; - /* Date and time the app started. */ + /** + * Date and time the app started. + */ appStartTime?: string | number; - /* Exception name that triggered the crash. */ + /** + * Exception name that triggered the crash. + */ exceptionName?: string; - /* Exception reason. */ + /** + * Exception reason. + */ exceptionReason?: string; - /* Device information of the app when it crashed. */ + /** + * Device information of the app when it crashed. + */ device: Device; - /* Signal that caused the crash. */ + /** + * Signal that caused the crash. + */ signal: string; - /* Identifier of the app process that crashed. */ + /** + * Identifier of the app process that crashed. + */ appProcessIdentifier: number; } @@ -69,11 +117,15 @@ export interface CrashesListener { } export class ErrorAttachmentLog { - // Create text attachment for an error report + /** + * Create text attachment for an error report + */ public static attachmentWithText(text: string, fileName?: string): ErrorAttachmentLog { return { text, fileName }; } - // Create binary attachment for an error report, binary must be passed as a base64 string + /** + * Create binary attachment for an error report, binary must be passed as a base64 string + */ public static attachmentWithBinary( data: string, fileName: string | null, @@ -137,7 +189,7 @@ export interface CrashesPlugin { * * const { value: hasCrashed } = await Crashes.hasCrashedInLastSession(); */ - hasCrashedInLastSession(): Promise<{ value: boolean}>; + hasCrashedInLastSession(): Promise<{value: boolean}>; /** * Provides details about the crash that occurred in the last app session. From 6ba198bfdd8455ae73d5d99dc2b65c1903df05a8 Mon Sep 17 00:00:00 2001 From: John Borges Date: Thu, 24 Jun 2021 19:48:05 -0400 Subject: [PATCH 4/5] fix(crashes): fix void return method --- appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.m b/appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.m index afdc5dd..5958a7a 100644 --- a/appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.m +++ b/appcenter-crashes/ios/Plugin/AppCenterCrashesPlugin.m @@ -4,7 +4,7 @@ // Define the plugin using the CAP_PLUGIN Macro, and // each method the plugin supports using the CAP_PLUGIN_METHOD macro. CAP_PLUGIN(CrashesPlugin, "Crashes", - CAP_PLUGIN_METHOD(setEnabled, CAPPluginReturnPromise); + CAP_PLUGIN_METHOD(setEnabled, CAPPluginReturnNone); CAP_PLUGIN_METHOD(isEnabled, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(generateTestCrash, CAPPluginReturnNone); CAP_PLUGIN_METHOD(hasReceivedMemoryWarningInLastSession, CAPPluginReturnPromise); From 628b76e082027a4a6495c3edc686302d019af03f Mon Sep 17 00:00:00 2001 From: John Borges Date: Thu, 24 Jun 2021 19:48:52 -0400 Subject: [PATCH 5/5] chore(example): use latest crash plugin --- example/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/package.json b/example/package.json index 7268a19..4a096a5 100644 --- a/example/package.json +++ b/example/package.json @@ -21,7 +21,7 @@ "dependencies": { "@capacitor-community/appcenter": "^0.4.0", "@capacitor-community/appcenter-analytics": "0.2.1", - "@capacitor-community/appcenter-crashes": "^0.3.0", + "@capacitor-community/appcenter-crashes": "^0.3.1", "@capacitor/app": "^1.0.0", "@capacitor/cli": "3.0.0", "@capacitor/core": "3.0.0",