codeplay-common 4.1.7 → 4.1.8

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.
package/README.md CHANGED
@@ -11,6 +11,8 @@ Make it to ionic project
11
11
  Donate to get full code including many common functions
12
12
  https://ko-fi.com/codeplay
13
13
 
14
+ Version 4.1.8
15
+ "consentDebug: false" is added
14
16
 
15
17
  Version 4.1.7
16
18
  admob configuration automatically added.
@@ -2739,43 +2739,44 @@ const ADMOB_NEXTGEN_DEFAULTS = {
2739
2739
  VERSION: "1.6",
2740
2740
  ios: { nativeid: "" },
2741
2741
  android: { nativeid: "" },
2742
- config: {
2743
- bannerStartupDelayMs: "",
2744
- interstitialStartupDelayMs: "",
2745
- appOpenLoadOnColdStart: "",
2746
- appOpenStartupDelayMs: "",
2747
- useAndroidPreloadAds: true,
2748
- useAndroidBannerPreloadAds: false,
2749
- preloadBufferSize: 1,
2750
- isKidsApp: false,
2751
- isTesting: false,
2752
- consentDebug: false,
2753
- isConsoleLogEnabled: false,
2754
- bannerEnabled: true,
2755
- interstitialEnabled: true,
2756
- appOpenEnabled: true,
2757
- rewardVideoEnabled: false,
2758
- rewardInterstitialEnabled: false,
2759
- collapsibleEnabled: "",
2760
- isLandScape: "",
2761
- isOverlappingEnable: "",
2762
- bannerTypeAndroid: "",
2763
- bannerTypeiOS: "",
2764
- bannerTopSpaceColor: "",
2765
- interstitialLoadScreenTextColor: "",
2766
- interstitialLoadScreenBackgroundColor: "",
2767
- beforeBannerSpace: "",
2768
- whenShow: "",
2769
- minimumClick: "",
2770
- interstitialTimeOut: "",
2771
- interstitialFirstTimeOut: "",
2772
- appOpenAdsTimeOut: "",
2773
- maxRetryCount: "",
2774
- retrySecondsAr: "",
2775
- appOpenPerSession: "",
2776
- interstitialPerSession: "",
2777
- appOpenFirstTimeOut: ""
2778
- },
2742
+ config: {
2743
+ bannerStartupDelayMs: "",
2744
+ interstitialStartupDelayMs: "",
2745
+ appOpenLoadOnColdStart: "",
2746
+ appOpenStartupDelayMs: "",
2747
+ useAndroidPreloadAds: true,
2748
+ useAndroidBannerPreloadAds: false,
2749
+ preloadBufferSize: 1,
2750
+ consentDebug: false,
2751
+ isKidsApp: false,
2752
+ isTesting: false,
2753
+ consentDebug: false,
2754
+ isConsoleLogEnabled: false,
2755
+ bannerEnabled: true,
2756
+ interstitialEnabled: true,
2757
+ appOpenEnabled: true,
2758
+ rewardVideoEnabled: false,
2759
+ rewardInterstitialEnabled: false,
2760
+ collapsibleEnabled: "",
2761
+ isLandScape: "",
2762
+ isOverlappingEnable: "",
2763
+ bannerTypeAndroid: "",
2764
+ bannerTypeiOS: "",
2765
+ bannerTopSpaceColor: "",
2766
+ interstitialLoadScreenTextColor: "",
2767
+ interstitialLoadScreenBackgroundColor: "",
2768
+ beforeBannerSpace: "",
2769
+ whenShow: "",
2770
+ minimumClick: "",
2771
+ interstitialTimeOut: "",
2772
+ interstitialFirstTimeOut: "",
2773
+ appOpenAdsTimeOut: "",
2774
+ maxRetryCount: "",
2775
+ retrySecondsAr: "",
2776
+ appOpenPerSession: "",
2777
+ interstitialPerSession: "",
2778
+ appOpenFirstTimeOut: ""
2779
+ },
2779
2780
  testid: {
2780
2781
  nativeid: "",
2781
2782
  nativeid_android: "ca-app-pub-3940256099942544/2247696110",
@@ -2855,22 +2856,22 @@ const mergeObjects = (template, source) => {
2855
2856
  return output;
2856
2857
  };
2857
2858
 
2858
- const hasObjectKeys = (value) => {
2859
- return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2860
- };
2861
-
2862
- const ensureAdmobNextgenConfigDefaults = (config) => {
2863
- const normalizedConfig = { ...config };
2864
- const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2865
-
2866
- normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2867
- delete normalizedConfig.config.overlappingHeight;
2868
-
2869
- return normalizedConfig;
2870
- };
2871
-
2872
- const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2873
- const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2859
+ const hasObjectKeys = (value) => {
2860
+ return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2861
+ };
2862
+
2863
+ const ensureAdmobNextgenConfigDefaults = (config) => {
2864
+ const normalizedConfig = { ...config };
2865
+ const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2866
+
2867
+ normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2868
+ delete normalizedConfig.config.overlappingHeight;
2869
+
2870
+ return normalizedConfig;
2871
+ };
2872
+
2873
+ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2874
+ const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2874
2875
 
2875
2876
  if (hasObjectKeys(oldConfig)) {
2876
2877
  if (hasObjectKeys(oldConfig.ios)) {
@@ -2894,12 +2895,12 @@ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenCon
2894
2895
  const existingRuntimeConfig = existingNextgenConfig.config || {};
2895
2896
  mergedConfig.config = mergeObjects(templateRuntimeConfig, mergeObjects(existingRuntimeConfig, oldConfig.config));
2896
2897
  }
2897
- }
2898
-
2899
- mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2900
-
2901
- return ensureAdmobNextgenConfigDefaults(mergedConfig);
2902
- };
2898
+ }
2899
+
2900
+ mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2901
+
2902
+ return ensureAdmobNextgenConfigDefaults(mergedConfig);
2903
+ };
2903
2904
 
2904
2905
  const syncAdmobNextgenPackage = () => {
2905
2906
  if (!fs.existsSync(packageJsonPath)) {
@@ -2995,16 +2996,16 @@ const ensureAdmobNextgenFiles = async () => {
2995
2996
  }
2996
2997
  }
2997
2998
 
2998
- let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
2999
-
3000
- if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
3001
- const downloadedTemplateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
3002
- templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, downloadedTemplateConfig);
3003
- templateConfig.VERSION = downloadedTemplateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3004
- fs.unlinkSync(tempTemplatePath);
3005
- } else if (fs.existsSync(nextgenConfigPath)) {
3006
- templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
3007
- }
2999
+ let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
3000
+
3001
+ if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
3002
+ const downloadedTemplateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
3003
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, downloadedTemplateConfig);
3004
+ templateConfig.VERSION = downloadedTemplateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3005
+ fs.unlinkSync(tempTemplatePath);
3006
+ } else if (fs.existsSync(nextgenConfigPath)) {
3007
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
3008
+ }
3008
3009
 
3009
3010
  const oldConfig = fs.existsSync(oldConfigPath)
3010
3011
  ? JSON.parse(fs.readFileSync(oldConfigPath, "utf8"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.1.7",
3
+ "version": "4.1.8",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",