@mpgd/target-config 0.5.0 → 0.6.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.
- package/dist/effective.d.ts +3 -1
- package/dist/effective.js +6 -1
- package/dist/index.js +70 -48
- package/dist/runtime.d.ts +10 -0
- package/dist/runtime.js +19 -11
- package/package.json +4 -3
- package/targets.json +19 -1
package/dist/effective.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AdPlacementEntry, AdPlacements, ProductCatalog, ProductCatalogEntry } from '@mpgd/catalog';
|
|
2
|
-
import { type FeatureAvailabilityReason, type TargetCapabilityConfig, type TargetConfig, type TargetConfigMatrix, type TargetFeatureConfig, type TargetIntegrationConfig, type TargetPolicyRestrictions, type TargetReleaseConfig, type TargetRuntimeKind } from './runtime.js';
|
|
2
|
+
import { type FeatureAvailabilityReason, type TargetCapabilityConfig, type TargetConfig, type TargetConfigMatrix, type TargetFeatureConfig, type TargetIntegrationConfig, type TargetLocalizationConfig, type TargetPolicyRestrictions, type TargetReleaseConfig, type TargetRuntimeKind } from './runtime.js';
|
|
3
3
|
export type EffectiveAvailabilityReason = FeatureAvailabilityReason | 'missing-platform-id';
|
|
4
4
|
export interface EffectivePlatformTargetMetadata {
|
|
5
5
|
readonly kind: string;
|
|
@@ -7,6 +7,7 @@ export interface EffectivePlatformTargetMetadata {
|
|
|
7
7
|
readonly artifact?: string;
|
|
8
8
|
readonly output?: string;
|
|
9
9
|
readonly webDir?: string;
|
|
10
|
+
readonly integrations?: Partial<TargetIntegrationConfig>;
|
|
10
11
|
}
|
|
11
12
|
export interface EffectiveTargetConfigSources {
|
|
12
13
|
readonly targetConfig: string;
|
|
@@ -53,6 +54,7 @@ export interface EffectiveStorageConfig {
|
|
|
53
54
|
}
|
|
54
55
|
export interface EffectiveLocalizationConfig {
|
|
55
56
|
readonly enabled: boolean;
|
|
57
|
+
readonly fallbackLocale: TargetLocalizationConfig['fallbackLocale'];
|
|
56
58
|
}
|
|
57
59
|
export interface EffectiveTargetConfig {
|
|
58
60
|
readonly version: string;
|
package/dist/effective.js
CHANGED
|
@@ -4,6 +4,10 @@ export function createEffectiveTargetConfig(input) {
|
|
|
4
4
|
const products = input.catalog.products.map((product) => createEffectiveProductConfig(input.target, input.config, product));
|
|
5
5
|
const placements = input.adPlacements.placements.map((placement) => createEffectiveAdPlacementConfig(input.target, input.config, placement));
|
|
6
6
|
const leaderboardEnabled = input.config.features.leaderboard;
|
|
7
|
+
const integrations = normalizeTargetIntegrationConfig({
|
|
8
|
+
...input.config.integrations,
|
|
9
|
+
...input.platformTarget?.integrations,
|
|
10
|
+
});
|
|
7
11
|
return {
|
|
8
12
|
version: effectiveTargetConfigVersion({
|
|
9
13
|
targetConfig: input.targetConfigVersion,
|
|
@@ -15,7 +19,7 @@ export function createEffectiveTargetConfig(input) {
|
|
|
15
19
|
release: input.config.release,
|
|
16
20
|
features: input.config.features,
|
|
17
21
|
capabilities: input.config.capabilities,
|
|
18
|
-
integrations
|
|
22
|
+
integrations,
|
|
19
23
|
policy: input.config.policy,
|
|
20
24
|
sources: {
|
|
21
25
|
targetConfig: input.targetConfigVersion,
|
|
@@ -49,6 +53,7 @@ export function createEffectiveTargetConfig(input) {
|
|
|
49
53
|
},
|
|
50
54
|
localization: {
|
|
51
55
|
enabled: input.config.capabilities.localization,
|
|
56
|
+
fallbackLocale: input.config.localization.fallbackLocale,
|
|
52
57
|
},
|
|
53
58
|
};
|
|
54
59
|
}
|
package/dist/index.js
CHANGED
|
@@ -364,7 +364,12 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
364
364
|
expected: "EffectiveLocalizationConfig",
|
|
365
365
|
value: input.localization
|
|
366
366
|
}, _errorFactory));
|
|
367
|
-
const _ao20 = (input, _path, _exceptionable = true) => _ap6(input, _path, true && _exceptionable)
|
|
367
|
+
const _ao20 = (input, _path, _exceptionable = true) => _ap6(input, _path, true && _exceptionable) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale || _a._assertGuard(_exceptionable, {
|
|
368
|
+
method: "typia.createAssert",
|
|
369
|
+
path: _path + ".fallbackLocale",
|
|
370
|
+
expected: "(\"en\" | \"ko\")",
|
|
371
|
+
value: input.fallbackLocale
|
|
372
|
+
}, _errorFactory));
|
|
368
373
|
const _ao3 = (input, _path, _exceptionable = true) => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "web-preview" === input.profile || _a._assertGuard(_exceptionable, {
|
|
369
374
|
method: "typia.createAssert",
|
|
370
375
|
path: _path + ".profile",
|
|
@@ -531,7 +536,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
531
536
|
const _io18 = input => "boolean" === typeof input.native && _ip6(input) && ("available" === input.reason || "capability-unsupported" === input.reason || "target-disabled" === input.reason) && (undefined === input.defaultLeaderboardId || "string" === typeof input.defaultLeaderboardId);
|
|
532
537
|
const _io19 = input => ("local" === input.support || "native" === input.support || "none" === input.support) && _ip6(input);
|
|
533
538
|
const _io2 = input => _ip0(input) && "string" === typeof input.target && ("apps-in-toss" === input.runtime || "capacitor-android" === input.runtime || "capacitor-ios" === input.runtime || "devvit-web" === input.runtime || "microsoft-store-pwa" === input.runtime || "web-preview" === input.runtime) && ("object" === typeof input.release && null !== input.release && _io3(input.release)) && ("object" === typeof input.features && null !== input.features && _io4(input.features)) && ("object" === typeof input.capabilities && null !== input.capabilities && _io5(input.capabilities)) && ("object" === typeof input.integrations && null !== input.integrations && _io6(input.integrations)) && ("object" === typeof input.policy && null !== input.policy && _io7(input.policy)) && ("object" === typeof input.sources && null !== input.sources && _io8(input.sources)) && ("object" === typeof input.monetization && null !== input.monetization && _io9(input.monetization)) && ("object" === typeof input.ads && null !== input.ads && _io13(input.ads)) && ("object" === typeof input.leaderboard && null !== input.leaderboard && _io18(input.leaderboard)) && ("object" === typeof input.storage && null !== input.storage && _io19(input.storage)) && ("object" === typeof input.localization && null !== input.localization && _io20(input.localization));
|
|
534
|
-
const _io20 = input => _ip6(input);
|
|
539
|
+
const _io20 = input => _ip6(input) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale);
|
|
535
540
|
const _io3 = input => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "web-preview" === input.profile;
|
|
536
541
|
const _io4 = input => _ip1(input) && _ip2(input) && _ip3(input) && "boolean" === typeof input.leaderboard && _ip4(input);
|
|
537
542
|
const _io5 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip4(input);
|
|
@@ -636,6 +641,37 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
636
641
|
value: value
|
|
637
642
|
}, _errorFactory);
|
|
638
643
|
});
|
|
644
|
+
const _ao10 = (input, _path, _exceptionable = true) => ("approval-required" === input.identityUpgrade || "available" === input.identityUpgrade || "configuration-required" === input.identityUpgrade || "disabled" === input.identityUpgrade || "unsupported" === input.identityUpgrade || _a._assertGuard(_exceptionable, {
|
|
645
|
+
method: "typia.createAssert",
|
|
646
|
+
path: _path + ".identityUpgrade",
|
|
647
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
648
|
+
value: input.identityUpgrade
|
|
649
|
+
}, _errorFactory)) && ("approval-required" === input.presentation || "available" === input.presentation || "configuration-required" === input.presentation || "disabled" === input.presentation || "unsupported" === input.presentation || _a._assertGuard(_exceptionable, {
|
|
650
|
+
method: "typia.createAssert",
|
|
651
|
+
path: _path + ".presentation",
|
|
652
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
653
|
+
value: input.presentation
|
|
654
|
+
}, _errorFactory)) && ("approval-required" === input.sharing || "available" === input.sharing || "configuration-required" === input.sharing || "disabled" === input.sharing || "unsupported" === input.sharing || _a._assertGuard(_exceptionable, {
|
|
655
|
+
method: "typia.createAssert",
|
|
656
|
+
path: _path + ".sharing",
|
|
657
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
658
|
+
value: input.sharing
|
|
659
|
+
}, _errorFactory)) && ("approval-required" === input.inboundShare || "available" === input.inboundShare || "configuration-required" === input.inboundShare || "disabled" === input.inboundShare || "unsupported" === input.inboundShare || _a._assertGuard(_exceptionable, {
|
|
660
|
+
method: "typia.createAssert",
|
|
661
|
+
path: _path + ".inboundShare",
|
|
662
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
663
|
+
value: input.inboundShare
|
|
664
|
+
}, _errorFactory)) && ("approval-required" === input.notifications || "available" === input.notifications || "configuration-required" === input.notifications || "disabled" === input.notifications || "unsupported" === input.notifications || _a._assertGuard(_exceptionable, {
|
|
665
|
+
method: "typia.createAssert",
|
|
666
|
+
path: _path + ".notifications",
|
|
667
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
668
|
+
value: input.notifications
|
|
669
|
+
}, _errorFactory)) && ("fullscreen" === input.presentationMode || "inline-expanded" === input.presentationMode || _a._assertGuard(_exceptionable, {
|
|
670
|
+
method: "typia.createAssert",
|
|
671
|
+
path: _path + ".presentationMode",
|
|
672
|
+
expected: "(\"fullscreen\" | \"inline-expanded\")",
|
|
673
|
+
value: input.presentationMode
|
|
674
|
+
}, _errorFactory));
|
|
639
675
|
const _ao2 = (input, _path, _exceptionable = true) => ("apps-in-toss" === input.runtime || "capacitor-android" === input.runtime || "capacitor-ios" === input.runtime || "devvit-web" === input.runtime || "microsoft-store-pwa" === input.runtime || "web-preview" === input.runtime || _a._assertGuard(_exceptionable, {
|
|
640
676
|
method: "typia.createAssert",
|
|
641
677
|
path: _path + ".runtime",
|
|
@@ -661,12 +697,22 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
661
697
|
path: _path + ".capabilities",
|
|
662
698
|
expected: "TargetCapabilityConfig",
|
|
663
699
|
value: input.capabilities
|
|
700
|
+
}, _errorFactory)) && (("object" === typeof input.localization && null !== input.localization || _a._assertGuard(_exceptionable, {
|
|
701
|
+
method: "typia.createAssert",
|
|
702
|
+
path: _path + ".localization",
|
|
703
|
+
expected: "TargetLocalizationConfig",
|
|
704
|
+
value: input.localization
|
|
705
|
+
}, _errorFactory)) && _ao5(input.localization, _path + ".localization", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
706
|
+
method: "typia.createAssert",
|
|
707
|
+
path: _path + ".localization",
|
|
708
|
+
expected: "TargetLocalizationConfig",
|
|
709
|
+
value: input.localization
|
|
664
710
|
}, _errorFactory)) && (("object" === typeof input.monetization && null !== input.monetization || _a._assertGuard(_exceptionable, {
|
|
665
711
|
method: "typia.createAssert",
|
|
666
712
|
path: _path + ".monetization",
|
|
667
713
|
expected: "TargetMonetizationConfig",
|
|
668
714
|
value: input.monetization
|
|
669
|
-
}, _errorFactory)) &&
|
|
715
|
+
}, _errorFactory)) && _ao6(input.monetization, _path + ".monetization", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
670
716
|
method: "typia.createAssert",
|
|
671
717
|
path: _path + ".monetization",
|
|
672
718
|
expected: "TargetMonetizationConfig",
|
|
@@ -676,7 +722,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
676
722
|
path: _path + ".leaderboard",
|
|
677
723
|
expected: "TargetLeaderboardConfig",
|
|
678
724
|
value: input.leaderboard
|
|
679
|
-
}, _errorFactory)) &&
|
|
725
|
+
}, _errorFactory)) && _ao7(input.leaderboard, _path + ".leaderboard", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
680
726
|
method: "typia.createAssert",
|
|
681
727
|
path: _path + ".leaderboard",
|
|
682
728
|
expected: "TargetLeaderboardConfig",
|
|
@@ -686,7 +732,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
686
732
|
path: _path + ".release",
|
|
687
733
|
expected: "TargetReleaseConfig",
|
|
688
734
|
value: input.release
|
|
689
|
-
}, _errorFactory)) &&
|
|
735
|
+
}, _errorFactory)) && _ao8(input.release, _path + ".release", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
690
736
|
method: "typia.createAssert",
|
|
691
737
|
path: _path + ".release",
|
|
692
738
|
expected: "TargetReleaseConfig",
|
|
@@ -696,7 +742,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
696
742
|
path: _path + ".policy",
|
|
697
743
|
expected: "TargetPolicyRestrictions",
|
|
698
744
|
value: input.policy
|
|
699
|
-
}, _errorFactory)) &&
|
|
745
|
+
}, _errorFactory)) && _ao9(input.policy, _path + ".policy", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
700
746
|
method: "typia.createAssert",
|
|
701
747
|
path: _path + ".policy",
|
|
702
748
|
expected: "TargetPolicyRestrictions",
|
|
@@ -706,7 +752,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
706
752
|
path: _path + ".integrations",
|
|
707
753
|
expected: "(TargetIntegrationConfig | undefined)",
|
|
708
754
|
value: input.integrations
|
|
709
|
-
}, _errorFactory)) &&
|
|
755
|
+
}, _errorFactory)) && _ao10(input.integrations, _path + ".integrations", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
710
756
|
method: "typia.createAssert",
|
|
711
757
|
path: _path + ".integrations",
|
|
712
758
|
expected: "(TargetIntegrationConfig | undefined)",
|
|
@@ -724,20 +770,26 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
724
770
|
expected: "(\"local\" | \"native\" | \"none\")",
|
|
725
771
|
value: input.storage
|
|
726
772
|
}, _errorFactory)) && _ap3(input, _path, true && _exceptionable);
|
|
727
|
-
const _ao5 = (input, _path, _exceptionable = true) =>
|
|
728
|
-
|
|
773
|
+
const _ao5 = (input, _path, _exceptionable = true) => "en" === input.fallbackLocale || "ko" === input.fallbackLocale || _a._assertGuard(_exceptionable, {
|
|
774
|
+
method: "typia.createAssert",
|
|
775
|
+
path: _path + ".fallbackLocale",
|
|
776
|
+
expected: "(\"en\" | \"ko\")",
|
|
777
|
+
value: input.fallbackLocale
|
|
778
|
+
}, _errorFactory);
|
|
779
|
+
const _ao6 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && _ap1(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable);
|
|
780
|
+
const _ao7 = (input, _path, _exceptionable = true) => "boolean" === typeof input.native || _a._assertGuard(_exceptionable, {
|
|
729
781
|
method: "typia.createAssert",
|
|
730
782
|
path: _path + ".native",
|
|
731
783
|
expected: "boolean",
|
|
732
784
|
value: input.native
|
|
733
785
|
}, _errorFactory);
|
|
734
|
-
const
|
|
786
|
+
const _ao8 = (input, _path, _exceptionable = true) => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "web-preview" === input.profile || _a._assertGuard(_exceptionable, {
|
|
735
787
|
method: "typia.createAssert",
|
|
736
788
|
path: _path + ".profile",
|
|
737
789
|
expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"web-preview\")",
|
|
738
790
|
value: input.profile
|
|
739
791
|
}, _errorFactory);
|
|
740
|
-
const
|
|
792
|
+
const _ao9 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.externalPaymentAllowed || _a._assertGuard(_exceptionable, {
|
|
741
793
|
method: "typia.createAssert",
|
|
742
794
|
path: _path + ".externalPaymentAllowed",
|
|
743
795
|
expected: "boolean",
|
|
@@ -763,37 +815,6 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
763
815
|
expected: "boolean",
|
|
764
816
|
value: input.requiresAitReview
|
|
765
817
|
}, _errorFactory));
|
|
766
|
-
const _ao9 = (input, _path, _exceptionable = true) => ("approval-required" === input.identityUpgrade || "available" === input.identityUpgrade || "configuration-required" === input.identityUpgrade || "disabled" === input.identityUpgrade || "unsupported" === input.identityUpgrade || _a._assertGuard(_exceptionable, {
|
|
767
|
-
method: "typia.createAssert",
|
|
768
|
-
path: _path + ".identityUpgrade",
|
|
769
|
-
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
770
|
-
value: input.identityUpgrade
|
|
771
|
-
}, _errorFactory)) && ("approval-required" === input.presentation || "available" === input.presentation || "configuration-required" === input.presentation || "disabled" === input.presentation || "unsupported" === input.presentation || _a._assertGuard(_exceptionable, {
|
|
772
|
-
method: "typia.createAssert",
|
|
773
|
-
path: _path + ".presentation",
|
|
774
|
-
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
775
|
-
value: input.presentation
|
|
776
|
-
}, _errorFactory)) && ("approval-required" === input.sharing || "available" === input.sharing || "configuration-required" === input.sharing || "disabled" === input.sharing || "unsupported" === input.sharing || _a._assertGuard(_exceptionable, {
|
|
777
|
-
method: "typia.createAssert",
|
|
778
|
-
path: _path + ".sharing",
|
|
779
|
-
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
780
|
-
value: input.sharing
|
|
781
|
-
}, _errorFactory)) && ("approval-required" === input.inboundShare || "available" === input.inboundShare || "configuration-required" === input.inboundShare || "disabled" === input.inboundShare || "unsupported" === input.inboundShare || _a._assertGuard(_exceptionable, {
|
|
782
|
-
method: "typia.createAssert",
|
|
783
|
-
path: _path + ".inboundShare",
|
|
784
|
-
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
785
|
-
value: input.inboundShare
|
|
786
|
-
}, _errorFactory)) && ("approval-required" === input.notifications || "available" === input.notifications || "configuration-required" === input.notifications || "disabled" === input.notifications || "unsupported" === input.notifications || _a._assertGuard(_exceptionable, {
|
|
787
|
-
method: "typia.createAssert",
|
|
788
|
-
path: _path + ".notifications",
|
|
789
|
-
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
790
|
-
value: input.notifications
|
|
791
|
-
}, _errorFactory)) && ("fullscreen" === input.presentationMode || "inline-expanded" === input.presentationMode || _a._assertGuard(_exceptionable, {
|
|
792
|
-
method: "typia.createAssert",
|
|
793
|
-
path: _path + ".presentationMode",
|
|
794
|
-
expected: "(\"fullscreen\" | \"inline-expanded\")",
|
|
795
|
-
value: input.presentationMode
|
|
796
|
-
}, _errorFactory));
|
|
797
818
|
const _io0 = input => "string" === typeof input.version && ("object" === typeof input.targets && null !== input.targets && false === Array.isArray(input.targets) && _io1(input.targets));
|
|
798
819
|
const _io1 = input => Object.keys(input).every(key => {
|
|
799
820
|
const value = input[key];
|
|
@@ -801,14 +822,15 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
801
822
|
return true;
|
|
802
823
|
return "object" === typeof value && null !== value && _io2(value);
|
|
803
824
|
});
|
|
804
|
-
const
|
|
825
|
+
const _io10 = input => ("approval-required" === input.identityUpgrade || "available" === input.identityUpgrade || "configuration-required" === input.identityUpgrade || "disabled" === input.identityUpgrade || "unsupported" === input.identityUpgrade) && ("approval-required" === input.presentation || "available" === input.presentation || "configuration-required" === input.presentation || "disabled" === input.presentation || "unsupported" === input.presentation) && ("approval-required" === input.sharing || "available" === input.sharing || "configuration-required" === input.sharing || "disabled" === input.sharing || "unsupported" === input.sharing) && ("approval-required" === input.inboundShare || "available" === input.inboundShare || "configuration-required" === input.inboundShare || "disabled" === input.inboundShare || "unsupported" === input.inboundShare) && ("approval-required" === input.notifications || "available" === input.notifications || "configuration-required" === input.notifications || "disabled" === input.notifications || "unsupported" === input.notifications) && ("fullscreen" === input.presentationMode || "inline-expanded" === input.presentationMode);
|
|
826
|
+
const _io2 = input => ("apps-in-toss" === input.runtime || "capacitor-android" === input.runtime || "capacitor-ios" === input.runtime || "devvit-web" === input.runtime || "microsoft-store-pwa" === input.runtime || "web-preview" === input.runtime) && ("object" === typeof input.features && null !== input.features && _io3(input.features)) && ("object" === typeof input.capabilities && null !== input.capabilities && _io4(input.capabilities)) && ("object" === typeof input.localization && null !== input.localization && _io5(input.localization)) && ("object" === typeof input.monetization && null !== input.monetization && _io6(input.monetization)) && ("object" === typeof input.leaderboard && null !== input.leaderboard && _io7(input.leaderboard)) && ("object" === typeof input.release && null !== input.release && _io8(input.release)) && ("object" === typeof input.policy && null !== input.policy && _io9(input.policy)) && (undefined === input.integrations || "object" === typeof input.integrations && null !== input.integrations && _io10(input.integrations));
|
|
805
827
|
const _io3 = input => _ip0(input) && _ip1(input) && _ip2(input) && "boolean" === typeof input.leaderboard && _ip3(input);
|
|
806
828
|
const _io4 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip3(input);
|
|
807
|
-
const _io5 = input =>
|
|
808
|
-
const _io6 = input =>
|
|
809
|
-
const _io7 = input => "
|
|
810
|
-
const _io8 = input => "
|
|
811
|
-
const _io9 = input =>
|
|
829
|
+
const _io5 = input => "en" === input.fallbackLocale || "ko" === input.fallbackLocale;
|
|
830
|
+
const _io6 = input => _ip0(input) && _ip1(input) && _ip2(input);
|
|
831
|
+
const _io7 = input => "boolean" === typeof input.native;
|
|
832
|
+
const _io8 = input => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "web-preview" === input.profile;
|
|
833
|
+
const _io9 = input => "boolean" === typeof input.externalPaymentAllowed && "boolean" === typeof input.remoteExecutableCodeAllowed && "boolean" === typeof input.installOtherAppCTAAllowed && "boolean" === typeof input.requiresStoreReview && "boolean" === typeof input.requiresAitReview;
|
|
812
834
|
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
813
835
|
let _errorFactory;
|
|
814
836
|
return (input, errorFactory) => {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MpgdLocale } from '@mpgd/i18n';
|
|
1
2
|
import type { PlatformCapabilities, PlatformGateway } from '@mpgd/platform';
|
|
2
3
|
import type { EffectiveTargetConfig } from './effective.js';
|
|
3
4
|
export type PlatformFeature = 'iap' | 'rewardedAds' | 'interstitialAds' | 'leaderboard' | 'localization';
|
|
@@ -28,6 +29,9 @@ export interface TargetCapabilityConfig {
|
|
|
28
29
|
readonly storage: StorageSupport;
|
|
29
30
|
readonly localization: boolean;
|
|
30
31
|
}
|
|
32
|
+
export interface TargetLocalizationConfig {
|
|
33
|
+
readonly fallbackLocale: MpgdLocale;
|
|
34
|
+
}
|
|
31
35
|
export interface TargetMonetizationConfig {
|
|
32
36
|
readonly iap: boolean;
|
|
33
37
|
readonly rewardedAds: boolean;
|
|
@@ -50,6 +54,7 @@ export interface TargetConfig {
|
|
|
50
54
|
readonly runtime: TargetRuntimeKind;
|
|
51
55
|
readonly features: TargetFeatureConfig;
|
|
52
56
|
readonly capabilities: TargetCapabilityConfig;
|
|
57
|
+
readonly localization: TargetLocalizationConfig;
|
|
53
58
|
readonly monetization: TargetMonetizationConfig;
|
|
54
59
|
readonly leaderboard: TargetLeaderboardConfig;
|
|
55
60
|
readonly release: TargetReleaseConfig;
|
|
@@ -109,6 +114,11 @@ export interface TargetConfiguredGateway extends PlatformGateway {
|
|
|
109
114
|
}
|
|
110
115
|
export declare const platformFeatures: readonly ["iap", "rewardedAds", "interstitialAds", "leaderboard", "localization"];
|
|
111
116
|
export declare const targetIntegrations: readonly ["identityUpgrade", "presentation", "sharing", "inboundShare", "notifications"];
|
|
117
|
+
type CompleteValueList<Union, Values extends readonly Union[]> = Exclude<Union, Values[number]> extends never ? Values : never;
|
|
118
|
+
declare const integrationAvailabilityStateValues: readonly ["available", "disabled", "approval-required", "configuration-required", "unsupported"];
|
|
119
|
+
export declare const integrationAvailabilityStates: CompleteValueList<IntegrationAvailabilityState, typeof integrationAvailabilityStateValues>;
|
|
120
|
+
declare const presentationModeValues: readonly ["fullscreen", "inline-expanded"];
|
|
121
|
+
export declare const presentationModes: CompleteValueList<PresentationMode, typeof presentationModeValues>;
|
|
112
122
|
export declare const defaultTargetIntegrationConfig: {
|
|
113
123
|
readonly identityUpgrade: 'disabled';
|
|
114
124
|
readonly presentation: 'disabled';
|
package/dist/runtime.js
CHANGED
|
@@ -12,6 +12,19 @@ export const targetIntegrations = [
|
|
|
12
12
|
'inboundShare',
|
|
13
13
|
'notifications',
|
|
14
14
|
];
|
|
15
|
+
const integrationAvailabilityStateValues = [
|
|
16
|
+
'available',
|
|
17
|
+
'disabled',
|
|
18
|
+
'approval-required',
|
|
19
|
+
'configuration-required',
|
|
20
|
+
'unsupported',
|
|
21
|
+
];
|
|
22
|
+
export const integrationAvailabilityStates = integrationAvailabilityStateValues;
|
|
23
|
+
const presentationModeValues = [
|
|
24
|
+
'fullscreen',
|
|
25
|
+
'inline-expanded',
|
|
26
|
+
];
|
|
27
|
+
export const presentationModes = presentationModeValues;
|
|
15
28
|
export const defaultTargetIntegrationConfig = {
|
|
16
29
|
identityUpgrade: 'disabled',
|
|
17
30
|
presentation: 'disabled',
|
|
@@ -20,13 +33,8 @@ export const defaultTargetIntegrationConfig = {
|
|
|
20
33
|
notifications: 'unsupported',
|
|
21
34
|
presentationMode: 'fullscreen',
|
|
22
35
|
};
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
'disabled',
|
|
26
|
-
'approval-required',
|
|
27
|
-
'configuration-required',
|
|
28
|
-
'unsupported',
|
|
29
|
-
]);
|
|
36
|
+
const integrationAvailabilityStateSet = new Set(integrationAvailabilityStates);
|
|
37
|
+
const presentationModeSet = new Set(presentationModes);
|
|
30
38
|
export function normalizeTargetIntegrationConfig(config) {
|
|
31
39
|
if (config === undefined) {
|
|
32
40
|
return defaultTargetIntegrationConfig;
|
|
@@ -94,7 +102,7 @@ export function createTargetRuntimeSnapshot(input) {
|
|
|
94
102
|
leaderboard: getFeatureAvailability('leaderboard', input.config, input.capabilities),
|
|
95
103
|
localization: getFeatureAvailability('localization', input.config, input.capabilities),
|
|
96
104
|
};
|
|
97
|
-
const integrationConfig = normalizeTargetIntegrationConfig(input.config.integrations);
|
|
105
|
+
const integrationConfig = normalizeTargetIntegrationConfig(input.effectiveConfig?.integrations ?? input.config.integrations);
|
|
98
106
|
const integrationEntries = targetIntegrations.map((integration) => {
|
|
99
107
|
const availability = createIntegrationAvailability(integration, integrationConfig[integration], input.gateway);
|
|
100
108
|
return [integration, availability];
|
|
@@ -124,7 +132,7 @@ export function createTargetRuntimeSnapshot(input) {
|
|
|
124
132
|
export function withTargetAvailability(gateway, config, options = {}) {
|
|
125
133
|
const configTarget = options.configTarget ?? targetConfigKeyForPlatform(gateway.target);
|
|
126
134
|
const { identity: gatewayIdentity, presentation: gatewayPresentation, sharing: gatewaySharing, notifications: gatewayNotifications, ...gatewayWithoutIntegrations } = gateway;
|
|
127
|
-
const integrations = normalizeTargetIntegrationConfig(config.integrations);
|
|
135
|
+
const integrations = normalizeTargetIntegrationConfig(options.effectiveConfig?.integrations ?? config.integrations);
|
|
128
136
|
const isIntegrationAvailable = (integration) => (createIntegrationAvailability(integration, integrations[integration], gateway).state
|
|
129
137
|
=== 'available');
|
|
130
138
|
const identityUpgradeAvailable = isIntegrationAvailable('identityUpgrade');
|
|
@@ -303,13 +311,13 @@ function createIntegrationAvailability(integration, configuredState, gateway) {
|
|
|
303
311
|
};
|
|
304
312
|
}
|
|
305
313
|
function normalizeIntegrationAvailabilityState(input, fallback) {
|
|
306
|
-
if (input !== undefined &&
|
|
314
|
+
if (input !== undefined && integrationAvailabilityStateSet.has(input)) {
|
|
307
315
|
return input;
|
|
308
316
|
}
|
|
309
317
|
return fallback;
|
|
310
318
|
}
|
|
311
319
|
function normalizePresentationMode(input) {
|
|
312
|
-
if (input
|
|
320
|
+
if (input !== undefined && presentationModeSet.has(input)) {
|
|
313
321
|
return input;
|
|
314
322
|
}
|
|
315
323
|
return defaultTargetIntegrationConfig.presentationMode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/target-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Target-specific platform feature availability and effective config helpers for mpgd.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"typia": "rc",
|
|
40
|
-
"@mpgd/
|
|
41
|
-
"@mpgd/platform": "0.
|
|
40
|
+
"@mpgd/i18n": "0.5.0",
|
|
41
|
+
"@mpgd/platform": "0.5.0",
|
|
42
|
+
"@mpgd/catalog": "0.3.4"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"ttsc": "0.16.9",
|
package/targets.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2026-07-
|
|
2
|
+
"version": "2026-07-12",
|
|
3
3
|
"targets": {
|
|
4
4
|
"web-preview": {
|
|
5
5
|
"runtime": "web-preview",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"storage": "local",
|
|
15
15
|
"localization": true
|
|
16
16
|
},
|
|
17
|
+
"localization": {
|
|
18
|
+
"fallbackLocale": "en"
|
|
19
|
+
},
|
|
17
20
|
"monetization": {
|
|
18
21
|
"iap": false,
|
|
19
22
|
"rewardedAds": false,
|
|
@@ -54,6 +57,9 @@
|
|
|
54
57
|
"storage": "local",
|
|
55
58
|
"localization": true
|
|
56
59
|
},
|
|
60
|
+
"localization": {
|
|
61
|
+
"fallbackLocale": "en"
|
|
62
|
+
},
|
|
57
63
|
"monetization": {
|
|
58
64
|
"iap": false,
|
|
59
65
|
"rewardedAds": false,
|
|
@@ -94,6 +100,9 @@
|
|
|
94
100
|
"storage": "native",
|
|
95
101
|
"localization": true
|
|
96
102
|
},
|
|
103
|
+
"localization": {
|
|
104
|
+
"fallbackLocale": "en"
|
|
105
|
+
},
|
|
97
106
|
"monetization": {
|
|
98
107
|
"iap": true,
|
|
99
108
|
"rewardedAds": true,
|
|
@@ -134,6 +143,9 @@
|
|
|
134
143
|
"storage": "native",
|
|
135
144
|
"localization": true
|
|
136
145
|
},
|
|
146
|
+
"localization": {
|
|
147
|
+
"fallbackLocale": "en"
|
|
148
|
+
},
|
|
137
149
|
"monetization": {
|
|
138
150
|
"iap": true,
|
|
139
151
|
"rewardedAds": true,
|
|
@@ -174,6 +186,9 @@
|
|
|
174
186
|
"storage": "none",
|
|
175
187
|
"localization": true
|
|
176
188
|
},
|
|
189
|
+
"localization": {
|
|
190
|
+
"fallbackLocale": "ko"
|
|
191
|
+
},
|
|
177
192
|
"monetization": {
|
|
178
193
|
"iap": true,
|
|
179
194
|
"rewardedAds": true,
|
|
@@ -214,6 +229,9 @@
|
|
|
214
229
|
"storage": "native",
|
|
215
230
|
"localization": true
|
|
216
231
|
},
|
|
232
|
+
"localization": {
|
|
233
|
+
"fallbackLocale": "en"
|
|
234
|
+
},
|
|
217
235
|
"monetization": {
|
|
218
236
|
"iap": false,
|
|
219
237
|
"rewardedAds": false,
|