From 83a1424993db51feacc03023160690a6c0ea58d2 Mon Sep 17 00:00:00 2001 From: Kai Bolay Date: Wed, 24 Aug 2022 16:02:31 -0400 Subject: [PATCH] Change payload based on API council feedback: - combine `display_version` and `build_version` into `app_version`. - change repeated field `screenshot_uris` to (optional) field `screenshot_uri`. --- src/v2/providers/alerts/appDistribution.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/v2/providers/alerts/appDistribution.ts b/src/v2/providers/alerts/appDistribution.ts index 6e519a23e..512c3e95a 100644 --- a/src/v2/providers/alerts/appDistribution.ts +++ b/src/v2/providers/alerts/appDistribution.ts @@ -60,21 +60,14 @@ export interface InAppFeedbackPayload { /** Email of the tester */ testerEmail: string; /** - * Display version of the release. For an Android release, the display version - * is the `versionName`. For an iOS release, the display version is the - * `CFBundleShortVersionString`. + * Version consisting of `versionName` and `versionCode` for Android and + * `CFBundleShortVersionString` and `CFBundleVersion` for iOS. */ - displayVersion: string; - /** - * Build version of the release. For an Android release, the build version - * is the `versionCode`. For an iOS release, the build version is the - * `CFBundleVersion`. - */ - buildVersion: string; + appVersion: string; /** Text entered by the tester */ text: string; - /** URIs to download screenshot(s). These URIs are fast expiring. */ - screenshotUris: string[]; + /** URI to download screenshot. This URIs are is fast expiring. */ + screenshotUri?: string; } /** @@ -332,10 +325,7 @@ export function onInAppFeedbackPublished( const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler); const func = (raw: CloudEvent) => { - const event = raw as AppDistributionEvent; - // Consolidate the case of empty array and null array - event.data.payload.screenshotUris = event.data.payload.screenshotUris || []; - return handler(event); + return handler(raw as AppDistributionEvent); }; func.run = handler;