@bravemobile/react-native-code-push 13.1.0 → 13.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +18 -1
  2. package/android/app/proguard-rules.pro +0 -7
  3. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +3 -0
  4. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +25 -0
  5. package/cli/commands/createHistoryCommand/createReleaseHistory.test.ts +2 -2
  6. package/cli/commands/releaseCommand/addToReleaseHistory.ts +6 -0
  7. package/cli/commands/releaseCommand/index.test.ts +29 -0
  8. package/cli/commands/releaseCommand/index.ts +9 -0
  9. package/cli/commands/releaseCommand/release.test.ts +28 -0
  10. package/cli/commands/releaseCommand/release.ts +2 -0
  11. package/cli/commands/updateHistoryCommand/index.test.ts +129 -0
  12. package/cli/commands/updateHistoryCommand/index.ts +28 -2
  13. package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +3 -0
  14. package/cli/dist/commands/createHistoryCommand/createReleaseHistory.test.js +2 -2
  15. package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +5 -1
  16. package/cli/dist/commands/releaseCommand/index.js +7 -1
  17. package/cli/dist/commands/releaseCommand/index.test.js +22 -0
  18. package/cli/dist/commands/releaseCommand/release.js +2 -2
  19. package/cli/dist/commands/releaseCommand/release.test.js +18 -1
  20. package/cli/dist/commands/updateHistoryCommand/index.js +23 -2
  21. package/cli/dist/commands/updateHistoryCommand/index.test.js +102 -0
  22. package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +4 -1
  23. package/cli/dist/utils/fsUtils.js +35 -9
  24. package/cli/package.json +5 -1
  25. package/cli/utils/fsUtils.ts +43 -9
  26. package/ios/CodePush/CodePush.h +8 -3
  27. package/ios/CodePush/CodePush.mm +61 -1
  28. package/package.json +14 -6
  29. package/src/CodePush.js +16 -3
  30. package/src/CodePush.test.js +57 -0
  31. package/typings/react-native-code-push.d.ts +20 -0
@@ -44,6 +44,13 @@ export interface ReleaseInfo {
44
44
  */
45
45
  diffPackages?: Record<string, string>;
46
46
  packageHash: string;
47
+ /**
48
+ * The minimum number of seconds the app has to have been in the background before this
49
+ * release is applied, with the same meaning as `SyncOptions.minimumBackgroundDuration`.
50
+ * When it is present it takes precedence over the value passed to `sync`, so a single
51
+ * release can be applied sooner or later than the app asks for by default.
52
+ */
53
+ minimumBackgroundDuration?: number;
47
54
  rollout?: number;
48
55
  }
49
56
 
@@ -73,6 +80,11 @@ export interface UpdateCheckResponse {
73
80
  should_run_binary_version?: boolean;
74
81
  update_app_version?: boolean;
75
82
  is_mandatory?: boolean;
83
+ /**
84
+ * The minimum number of seconds the app has to have been in the background before this
85
+ * update is applied. It is only present when the release asked for one of its own.
86
+ */
87
+ minimum_background_duration?: number;
76
88
  }
77
89
 
78
90
  /**
@@ -345,6 +357,13 @@ export interface RemotePackage extends Package {
345
357
  * `UpdateArchiveResult`.
346
358
  */
347
359
  assetDiffDownloadUrl?: string;
360
+
361
+ /**
362
+ * The minimum number of seconds the app has to have been in the background before this
363
+ * update is applied. It is only present when the release history entry set it, and it
364
+ * then takes precedence over the `minimumBackgroundDuration` passed to `sync`.
365
+ */
366
+ minimumBackgroundDuration?: number;
348
367
  }
349
368
 
350
369
  export interface SyncOptions {
@@ -372,6 +391,7 @@ export interface SyncOptions {
372
391
  * only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful
373
392
  * for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying
374
393
  * the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.
394
+ * A `minimumBackgroundDuration` set on the release history entry of the update being installed takes precedence over this option.
375
395
  */
376
396
  minimumBackgroundDuration?: number;
377
397