Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api-compat/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const _isFirstRun: boolean = pkg.isFirstRun;
const _isMandatory: boolean = pkg.isMandatory;
const _isPending: boolean = pkg.isPending;
const _label: string = pkg.label;
const _versionLabel: string | undefined = pkg.versionLabel;
const _packageHash: string = pkg.packageHash;
const _packageSize: number = pkg.packageSize;

Expand Down
2 changes: 2 additions & 0 deletions code-push-plugin-testing-framework/script/serverUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function createDefaultResponse() {
defaultResponse.target_binary_range = "";
defaultResponse.package_hash = "";
defaultResponse.label = "";
defaultResponse.version_label = "";
defaultResponse.package_size = 0;
defaultResponse.should_run_binary_version = false;
defaultResponse.update_app_version = false;
Expand All @@ -144,6 +145,7 @@ function createUpdateResponse(mandatory, targetPlatform, randomHash) {
updateResponse.download_url = "mock.url/v0.1/public/codepush/report_status/download";
updateResponse.is_mandatory = mandatory;
updateResponse.label = "mock-update";
updateResponse.version_label = "v1";
updateResponse.package_hash = "12345-67890";
updateResponse.package_size = 12345;
updateResponse.should_run_binary_version = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ declare module 'code-push-plugin-testing-framework/script/serverUtil' {
is_disabled: boolean;
description: string;
label: string;
version_label: string;
package_hash: string;
is_mandatory: boolean;
}
Expand Down
3 changes: 2 additions & 1 deletion docs/api-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ Contains details about an update that has been downloaded locally or already ins
- __isFirstRun__: Indicates whether this is the first time the update has been run after being installed. This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update. *(Boolean)*
- __isMandatory__: Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released. *(Boolean)*
- __isPending__: Indicates whether this update is in a "pending" state. When `true`, that means the update has been downloaded and installed, but the app restart needed to apply it hasn't occurred yet, and therefore, it's changes aren't currently visible to the end-user. *(Boolean)*
- __label__: The internal label automatically given to the update by the CodePush server, such as `v5`. This value uniquely identifies the update within it's deployment. *(String)*
- __label__: The internal label automatically given to the update by the CodePush server. This value uniquely identifies the update within its deployment. *(String)*
Comment thread
miklosboros marked this conversation as resolved.
- __packageHash__: The SHA hash value of the update. *(String)*
- __packageSize__: The size of the code contained within the update, in bytes. *(Number)*
- __versionLabel__: The human-readable version label of the update within its deployment, such as `v5`, matching what the Bitrise UI and CLI show. This is `undefined` for updates downloaded by an older version of this SDK, or served by a server that does not yet provide it. *(String)*

###### Methods

Expand Down
1 change: 1 addition & 0 deletions src/acquisition-sdk/__tests__/acquisition-rest-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export var latestPackage = <types.UpdateCheckResponse>{
description: "Angry flappy birds",
target_binary_range: "1.5.0",
label: "2.4.0",
version_label: "v3",
is_mandatory: false,
is_available: true,
update_app_version: false,
Expand Down
1 change: 1 addition & 0 deletions src/acquisition-sdk/__tests__/acquisition-sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var scriptUpdateResult: acquisitionSdk.RemotePackage = {
description: latestPackage.description,
downloadUrl: latestPackage.download_url,
label: latestPackage.label,
versionLabel: latestPackage.version_label,
appVersion: latestPackage.target_binary_range,
isMandatory: latestPackage.is_mandatory,
packageHash: latestPackage.package_hash,
Expand Down
4 changes: 4 additions & 0 deletions src/acquisition-sdk/acquisition-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export interface Package {
deploymentKey: string;
description: string;
label: string;
// "vN" release number of the update within its deployment. Undefined for packages
// persisted by an older SDK version, or served by a server that predates the field.
versionLabel?: string;
appVersion: string;
isMandatory: boolean;
packageHash: string;
Expand Down Expand Up @@ -165,6 +168,7 @@ export class AcquisitionManager {
deploymentKey: this._deploymentKey,
description: updateInfo.description,
label: updateInfo.label,
versionLabel: updateInfo.version_label,
appVersion: updateInfo.target_binary_range,
isMandatory: updateInfo.is_mandatory,
packageHash: updateInfo.package_hash,
Expand Down
3 changes: 3 additions & 0 deletions src/acquisition-sdk/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export interface UpdateCheckResponse {
is_disabled?: boolean;
target_binary_range: string;
/*generated*/ label?: string;
// Human-readable "vN" release number of the update within its deployment.
// Absent from servers that predate it.
/*generated*/ version_label?: string;
/*generated*/ package_hash?: string;
package_size?: number;
should_run_binary_version?: boolean;
Expand Down
1 change: 1 addition & 0 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ PluginTestingFramework.initializeTests(new RNProjectManager(), supportedTargetPl
assert.strictEqual(remotePackage.downloadUrl, updateResponse.download_url);
assert.strictEqual(remotePackage.isMandatory, updateResponse.is_mandatory);
assert.strictEqual(remotePackage.label, updateResponse.label);
assert.strictEqual(remotePackage.versionLabel, updateResponse.version_label);
assert.strictEqual(remotePackage.packageHash, updateResponse.package_hash);
assert.strictEqual(remotePackage.packageSize, updateResponse.package_size);
assert.strictEqual(remotePackage.deploymentKey, targetPlatform.getDefaultDeploymentKey());
Expand Down
6 changes: 6 additions & 0 deletions typings/react-native-code-push.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export interface Package {
*/
label: string;

/**
* The human-readable version label of the update within its deployment, such as `v5`, matching what the Bitrise UI and CLI show.
* Undefined for updates downloaded by an older version of this SDK, or served by a server that does not yet provide it.
*/
versionLabel?: string;

/**
* The SHA hash value of the update.
*/
Expand Down
Loading