@mpgd/target-config 0.4.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 +4 -1
- package/dist/effective.js +7 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +210 -107
- package/dist/runtime.d.ts +43 -1
- package/dist/runtime.js +131 -1
- package/dist/viewport.d.ts +1 -1
- package/package.json +4 -3
- package/targets.json +67 -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
|
|
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;
|
|
@@ -61,6 +63,7 @@ export interface EffectiveTargetConfig {
|
|
|
61
63
|
readonly release: TargetReleaseConfig;
|
|
62
64
|
readonly features: TargetFeatureConfig;
|
|
63
65
|
readonly capabilities: TargetCapabilityConfig;
|
|
66
|
+
readonly integrations: TargetIntegrationConfig;
|
|
64
67
|
readonly policy: TargetPolicyRestrictions;
|
|
65
68
|
readonly sources: EffectiveTargetConfigSources;
|
|
66
69
|
readonly monetization: EffectiveMonetizationConfig;
|
package/dist/effective.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { normalizeTargetIntegrationConfig, } from './runtime.js';
|
|
1
2
|
export const defaultLeaderboardId = 'default';
|
|
2
3
|
export function createEffectiveTargetConfig(input) {
|
|
3
4
|
const products = input.catalog.products.map((product) => createEffectiveProductConfig(input.target, input.config, product));
|
|
4
5
|
const placements = input.adPlacements.placements.map((placement) => createEffectiveAdPlacementConfig(input.target, input.config, placement));
|
|
5
6
|
const leaderboardEnabled = input.config.features.leaderboard;
|
|
7
|
+
const integrations = normalizeTargetIntegrationConfig({
|
|
8
|
+
...input.config.integrations,
|
|
9
|
+
...input.platformTarget?.integrations,
|
|
10
|
+
});
|
|
6
11
|
return {
|
|
7
12
|
version: effectiveTargetConfigVersion({
|
|
8
13
|
targetConfig: input.targetConfigVersion,
|
|
@@ -14,6 +19,7 @@ export function createEffectiveTargetConfig(input) {
|
|
|
14
19
|
release: input.config.release,
|
|
15
20
|
features: input.config.features,
|
|
16
21
|
capabilities: input.config.capabilities,
|
|
22
|
+
integrations,
|
|
17
23
|
policy: input.config.policy,
|
|
18
24
|
sources: {
|
|
19
25
|
targetConfig: input.targetConfigVersion,
|
|
@@ -47,6 +53,7 @@ export function createEffectiveTargetConfig(input) {
|
|
|
47
53
|
},
|
|
48
54
|
localization: {
|
|
49
55
|
enabled: input.config.capabilities.localization,
|
|
56
|
+
fallbackLocale: input.config.localization.fallbackLocale,
|
|
50
57
|
},
|
|
51
58
|
};
|
|
52
59
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EffectiveTargetConfigMatrix } from './effective';
|
|
2
|
-
import type { TargetConfigMatrix } from './runtime';
|
|
3
|
-
export * from './effective';
|
|
4
|
-
export * from './runtime';
|
|
5
|
-
export * from './viewport';
|
|
1
|
+
import type { EffectiveTargetConfigMatrix } from './effective.js';
|
|
2
|
+
import type { TargetConfigMatrix } from './runtime.js';
|
|
3
|
+
export * from './effective.js';
|
|
4
|
+
export * from './runtime.js';
|
|
5
|
+
export * from './viewport.js';
|
|
6
6
|
export declare const assertEffectiveTargetConfigMatrix: (input: unknown) => EffectiveTargetConfigMatrix;
|
|
7
7
|
export declare const assertTargetConfigMatrix: (input: unknown) => TargetConfigMatrix;
|
package/dist/index.js
CHANGED
|
@@ -2,20 +2,21 @@ import * as _a from "typia/lib/internal/_assertGuard";
|
|
|
2
2
|
import * as _b from "typia/lib/internal/_accessExpressionAsString";
|
|
3
3
|
const __typia_transform__accessExpressionAsString = _b._accessExpressionAsString;
|
|
4
4
|
import typia from 'typia';
|
|
5
|
-
export * from './effective';
|
|
6
|
-
export * from './runtime';
|
|
7
|
-
export * from './viewport';
|
|
5
|
+
export * from './effective.js';
|
|
6
|
+
export * from './runtime.js';
|
|
7
|
+
export * from './viewport.js';
|
|
8
8
|
export const assertEffectiveTargetConfigMatrix = (() => {
|
|
9
9
|
const _ip0 = input => "string" === typeof input["version"];
|
|
10
10
|
const _ip1 = input => "boolean" === typeof input["iap"];
|
|
11
11
|
const _ip2 = input => "boolean" === typeof input["rewardedAds"];
|
|
12
12
|
const _ip3 = input => "boolean" === typeof input["interstitialAds"];
|
|
13
13
|
const _ip4 = input => "boolean" === typeof input["localization"];
|
|
14
|
-
const _ip5 = input => "
|
|
15
|
-
const _ip6 = input => "
|
|
16
|
-
const _ip7 = input => "
|
|
17
|
-
const _ip8 = input => "
|
|
18
|
-
const _ip9 = input => "
|
|
14
|
+
const _ip5 = input => "string" === typeof input["id"];
|
|
15
|
+
const _ip6 = input => "boolean" === typeof input["enabled"];
|
|
16
|
+
const _ip7 = input => "available" === input["reason"] || "capability-unsupported" === input["reason"] || "missing-platform-id" === input["reason"] || "target-disabled" === input["reason"];
|
|
17
|
+
const _ip8 = input => "currency" === input["type"];
|
|
18
|
+
const _ip9 = input => "coin" === input["currency"] || "gem" === input["currency"];
|
|
19
|
+
const _ip10 = input => "number" === typeof input["amount"];
|
|
19
20
|
const _ap0 = (input, _path, _exceptionable = true) => "string" === typeof input["version"] || _a._assertGuard(_exceptionable, {
|
|
20
21
|
method: "typia.createAssert",
|
|
21
22
|
path: _path + ".version",
|
|
@@ -46,32 +47,38 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
46
47
|
expected: "boolean",
|
|
47
48
|
value: input["localization"]
|
|
48
49
|
}, _errorFactory);
|
|
50
|
+
const _ap5 = (input, _path, _exceptionable = true) => "string" === typeof input["id"] || _a._assertGuard(_exceptionable, {
|
|
51
|
+
method: "typia.createAssert",
|
|
52
|
+
path: _path + ".id",
|
|
53
|
+
expected: "string",
|
|
54
|
+
value: input["id"]
|
|
55
|
+
}, _errorFactory);
|
|
49
56
|
const _ae0 = "({ readonly type: \"currency\"; readonly currency: \"coin\" | \"gem\"; readonly amount: number; } | { readonly type: \"entitlement\"; readonly entitlement: string; })";
|
|
50
|
-
const
|
|
57
|
+
const _ap6 = (input, _path, _exceptionable = true) => "boolean" === typeof input["enabled"] || _a._assertGuard(_exceptionable, {
|
|
51
58
|
method: "typia.createAssert",
|
|
52
59
|
path: _path + ".enabled",
|
|
53
60
|
expected: "boolean",
|
|
54
61
|
value: input["enabled"]
|
|
55
62
|
}, _errorFactory);
|
|
56
|
-
const
|
|
63
|
+
const _ap7 = (input, _path, _exceptionable = true) => "available" === input["reason"] || "capability-unsupported" === input["reason"] || "missing-platform-id" === input["reason"] || "target-disabled" === input["reason"] || _a._assertGuard(_exceptionable, {
|
|
57
64
|
method: "typia.createAssert",
|
|
58
65
|
path: _path + ".reason",
|
|
59
66
|
expected: "(\"available\" | \"capability-unsupported\" | \"missing-platform-id\" | \"target-disabled\")",
|
|
60
67
|
value: input["reason"]
|
|
61
68
|
}, _errorFactory);
|
|
62
|
-
const
|
|
69
|
+
const _ap8 = (input, _path, _exceptionable = true) => "currency" === input["type"] || _a._assertGuard(_exceptionable, {
|
|
63
70
|
method: "typia.createAssert",
|
|
64
71
|
path: _path + ".type",
|
|
65
72
|
expected: "\"currency\"",
|
|
66
73
|
value: input["type"]
|
|
67
74
|
}, _errorFactory);
|
|
68
|
-
const
|
|
75
|
+
const _ap9 = (input, _path, _exceptionable = true) => "coin" === input["currency"] || "gem" === input["currency"] || _a._assertGuard(_exceptionable, {
|
|
69
76
|
method: "typia.createAssert",
|
|
70
77
|
path: _path + ".currency",
|
|
71
78
|
expected: "(\"coin\" | \"gem\")",
|
|
72
79
|
value: input["currency"]
|
|
73
80
|
}, _errorFactory);
|
|
74
|
-
const
|
|
81
|
+
const _ap10 = (input, _path, _exceptionable = true) => "number" === typeof input["amount"] || _a._assertGuard(_exceptionable, {
|
|
75
82
|
method: "typia.createAssert",
|
|
76
83
|
path: _path + ".amount",
|
|
77
84
|
expected: "number",
|
|
@@ -106,8 +113,29 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
106
113
|
value: value
|
|
107
114
|
}, _errorFactory);
|
|
108
115
|
});
|
|
109
|
-
const _ao10 = (input, _path, _exceptionable = true) =>
|
|
110
|
-
|
|
116
|
+
const _ao10 = (input, _path, _exceptionable = true) => _ap5(input, _path, true && _exceptionable) && ("consumable" === input.type || "non_consumable" === input.type || "subscription" === input.type || _a._assertGuard(_exceptionable, {
|
|
117
|
+
method: "typia.createAssert",
|
|
118
|
+
path: _path + ".type",
|
|
119
|
+
expected: "(\"consumable\" | \"non_consumable\" | \"subscription\")",
|
|
120
|
+
value: input.type
|
|
121
|
+
}, _errorFactory)) && (("object" === typeof input.grant && null !== input.grant || _a._assertGuard(_exceptionable, {
|
|
122
|
+
method: "typia.createAssert",
|
|
123
|
+
path: _path + ".grant",
|
|
124
|
+
expected: _ae0,
|
|
125
|
+
value: input.grant
|
|
126
|
+
}, _errorFactory)) && _au0(input.grant, _path + ".grant", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
127
|
+
method: "typia.createAssert",
|
|
128
|
+
path: _path + ".grant",
|
|
129
|
+
expected: _ae0,
|
|
130
|
+
value: input.grant
|
|
131
|
+
}, _errorFactory)) && _ap6(input, _path, true && _exceptionable) && _ap7(input, _path, true && _exceptionable) && (undefined === input.platformProductId || "string" === typeof input.platformProductId || _a._assertGuard(_exceptionable, {
|
|
132
|
+
method: "typia.createAssert",
|
|
133
|
+
path: _path + ".platformProductId",
|
|
134
|
+
expected: "(string | undefined)",
|
|
135
|
+
value: input.platformProductId
|
|
136
|
+
}, _errorFactory));
|
|
137
|
+
const _ao11 = (input, _path, _exceptionable = true) => _ap8(input, _path, true && _exceptionable) && _ap9(input, _path, true && _exceptionable) && _ap10(input, _path, true && _exceptionable);
|
|
138
|
+
const _ao12 = (input, _path, _exceptionable = true) => ("entitlement" === input.type || _a._assertGuard(_exceptionable, {
|
|
111
139
|
method: "typia.createAssert",
|
|
112
140
|
path: _path + ".type",
|
|
113
141
|
expected: "\"entitlement\"",
|
|
@@ -118,7 +146,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
118
146
|
expected: "string",
|
|
119
147
|
value: input.entitlement
|
|
120
148
|
}, _errorFactory));
|
|
121
|
-
const
|
|
149
|
+
const _ao13 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ((Array.isArray(input.placements) || _a._assertGuard(_exceptionable, {
|
|
122
150
|
method: "typia.createAssert",
|
|
123
151
|
path: _path + ".placements",
|
|
124
152
|
expected: "ReadonlyArray<EffectiveAdPlacementConfig>",
|
|
@@ -128,7 +156,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
128
156
|
path: _path + ".placements[" + _index4 + "]",
|
|
129
157
|
expected: "EffectiveAdPlacementConfig",
|
|
130
158
|
value: elem
|
|
131
|
-
}, _errorFactory)) &&
|
|
159
|
+
}, _errorFactory)) && _ao14(elem, _path + ".placements[" + _index4 + "]", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
132
160
|
method: "typia.createAssert",
|
|
133
161
|
path: _path + ".placements[" + _index4 + "]",
|
|
134
162
|
expected: "EffectiveAdPlacementConfig",
|
|
@@ -139,12 +167,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
139
167
|
expected: "ReadonlyArray<EffectiveAdPlacementConfig>",
|
|
140
168
|
value: input.placements
|
|
141
169
|
}, _errorFactory));
|
|
142
|
-
const
|
|
143
|
-
method: "typia.createAssert",
|
|
144
|
-
path: _path + ".id",
|
|
145
|
-
expected: "(\"CONTINUE_AFTER_FAIL\" | \"STAGE_END_INTERSTITIAL\")",
|
|
146
|
-
value: input.id
|
|
147
|
-
}, _errorFactory)) && ("interstitial" === input.type || "rewarded" === input.type || _a._assertGuard(_exceptionable, {
|
|
170
|
+
const _ao14 = (input, _path, _exceptionable = true) => _ap5(input, _path, true && _exceptionable) && ("interstitial" === input.type || "rewarded" === input.type || _a._assertGuard(_exceptionable, {
|
|
148
171
|
method: "typia.createAssert",
|
|
149
172
|
path: _path + ".type",
|
|
150
173
|
expected: "(\"interstitial\" | \"rewarded\")",
|
|
@@ -164,25 +187,25 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
164
187
|
path: _path + ".frequencyCap",
|
|
165
188
|
expected: "FrequencyCap",
|
|
166
189
|
value: input.frequencyCap
|
|
167
|
-
}, _errorFactory)) &&
|
|
190
|
+
}, _errorFactory)) && _ao17(input.frequencyCap, _path + ".frequencyCap", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
168
191
|
method: "typia.createAssert",
|
|
169
192
|
path: _path + ".frequencyCap",
|
|
170
193
|
expected: "FrequencyCap",
|
|
171
194
|
value: input.frequencyCap
|
|
172
|
-
}, _errorFactory)) &&
|
|
195
|
+
}, _errorFactory)) && _ap6(input, _path, true && _exceptionable) && _ap7(input, _path, true && _exceptionable) && (undefined === input.platformPlacementId || "string" === typeof input.platformPlacementId || _a._assertGuard(_exceptionable, {
|
|
173
196
|
method: "typia.createAssert",
|
|
174
197
|
path: _path + ".platformPlacementId",
|
|
175
198
|
expected: "(string | undefined)",
|
|
176
199
|
value: input.platformPlacementId
|
|
177
200
|
}, _errorFactory));
|
|
178
|
-
const
|
|
201
|
+
const _ao15 = (input, _path, _exceptionable = true) => ("continue" === input.type || _a._assertGuard(_exceptionable, {
|
|
179
202
|
method: "typia.createAssert",
|
|
180
203
|
path: _path + ".type",
|
|
181
204
|
expected: "\"continue\"",
|
|
182
205
|
value: input.type
|
|
183
|
-
}, _errorFactory)) &&
|
|
184
|
-
const
|
|
185
|
-
const
|
|
206
|
+
}, _errorFactory)) && _ap10(input, _path, true && _exceptionable);
|
|
207
|
+
const _ao16 = (input, _path, _exceptionable = true) => _ap8(input, _path, true && _exceptionable) && _ap10(input, _path, true && _exceptionable) && _ap9(input, _path, true && _exceptionable);
|
|
208
|
+
const _ao17 = (input, _path, _exceptionable = true) => ("number" === typeof input.cooldownSeconds || _a._assertGuard(_exceptionable, {
|
|
186
209
|
method: "typia.createAssert",
|
|
187
210
|
path: _path + ".cooldownSeconds",
|
|
188
211
|
expected: "number",
|
|
@@ -198,12 +221,12 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
198
221
|
expected: "(number | undefined)",
|
|
199
222
|
value: input.minStageInterval
|
|
200
223
|
}, _errorFactory));
|
|
201
|
-
const
|
|
224
|
+
const _ao18 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.native || _a._assertGuard(_exceptionable, {
|
|
202
225
|
method: "typia.createAssert",
|
|
203
226
|
path: _path + ".native",
|
|
204
227
|
expected: "boolean",
|
|
205
228
|
value: input.native
|
|
206
|
-
}, _errorFactory)) &&
|
|
229
|
+
}, _errorFactory)) && _ap6(input, _path, true && _exceptionable) && ("available" === input.reason || "capability-unsupported" === input.reason || "target-disabled" === input.reason || _a._assertGuard(_exceptionable, {
|
|
207
230
|
method: "typia.createAssert",
|
|
208
231
|
path: _path + ".reason",
|
|
209
232
|
expected: "(\"available\" | \"capability-unsupported\" | \"target-disabled\")",
|
|
@@ -214,13 +237,12 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
214
237
|
expected: "(string | undefined)",
|
|
215
238
|
value: input.defaultLeaderboardId
|
|
216
239
|
}, _errorFactory));
|
|
217
|
-
const
|
|
240
|
+
const _ao19 = (input, _path, _exceptionable = true) => ("local" === input.support || "native" === input.support || "none" === input.support || _a._assertGuard(_exceptionable, {
|
|
218
241
|
method: "typia.createAssert",
|
|
219
242
|
path: _path + ".support",
|
|
220
243
|
expected: "(\"local\" | \"native\" | \"none\")",
|
|
221
244
|
value: input.support
|
|
222
|
-
}, _errorFactory)) &&
|
|
223
|
-
const _ao19 = (input, _path, _exceptionable = true) => _ap5(input, _path, true && _exceptionable);
|
|
245
|
+
}, _errorFactory)) && _ap6(input, _path, true && _exceptionable);
|
|
224
246
|
const _ao2 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && ("string" === typeof input.target || _a._assertGuard(_exceptionable, {
|
|
225
247
|
method: "typia.createAssert",
|
|
226
248
|
path: _path + ".target",
|
|
@@ -261,12 +283,22 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
261
283
|
path: _path + ".capabilities",
|
|
262
284
|
expected: "TargetCapabilityConfig",
|
|
263
285
|
value: input.capabilities
|
|
286
|
+
}, _errorFactory)) && (("object" === typeof input.integrations && null !== input.integrations || _a._assertGuard(_exceptionable, {
|
|
287
|
+
method: "typia.createAssert",
|
|
288
|
+
path: _path + ".integrations",
|
|
289
|
+
expected: "TargetIntegrationConfig",
|
|
290
|
+
value: input.integrations
|
|
291
|
+
}, _errorFactory)) && _ao6(input.integrations, _path + ".integrations", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
292
|
+
method: "typia.createAssert",
|
|
293
|
+
path: _path + ".integrations",
|
|
294
|
+
expected: "TargetIntegrationConfig",
|
|
295
|
+
value: input.integrations
|
|
264
296
|
}, _errorFactory)) && (("object" === typeof input.policy && null !== input.policy || _a._assertGuard(_exceptionable, {
|
|
265
297
|
method: "typia.createAssert",
|
|
266
298
|
path: _path + ".policy",
|
|
267
299
|
expected: "TargetPolicyRestrictions",
|
|
268
300
|
value: input.policy
|
|
269
|
-
}, _errorFactory)) &&
|
|
301
|
+
}, _errorFactory)) && _ao7(input.policy, _path + ".policy", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
270
302
|
method: "typia.createAssert",
|
|
271
303
|
path: _path + ".policy",
|
|
272
304
|
expected: "TargetPolicyRestrictions",
|
|
@@ -276,7 +308,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
276
308
|
path: _path + ".sources",
|
|
277
309
|
expected: "EffectiveTargetConfigSources",
|
|
278
310
|
value: input.sources
|
|
279
|
-
}, _errorFactory)) &&
|
|
311
|
+
}, _errorFactory)) && _ao8(input.sources, _path + ".sources", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
280
312
|
method: "typia.createAssert",
|
|
281
313
|
path: _path + ".sources",
|
|
282
314
|
expected: "EffectiveTargetConfigSources",
|
|
@@ -286,7 +318,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
286
318
|
path: _path + ".monetization",
|
|
287
319
|
expected: "EffectiveMonetizationConfig",
|
|
288
320
|
value: input.monetization
|
|
289
|
-
}, _errorFactory)) &&
|
|
321
|
+
}, _errorFactory)) && _ao9(input.monetization, _path + ".monetization", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
290
322
|
method: "typia.createAssert",
|
|
291
323
|
path: _path + ".monetization",
|
|
292
324
|
expected: "EffectiveMonetizationConfig",
|
|
@@ -296,7 +328,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
296
328
|
path: _path + ".ads",
|
|
297
329
|
expected: "EffectiveAdsConfig",
|
|
298
330
|
value: input.ads
|
|
299
|
-
}, _errorFactory)) &&
|
|
331
|
+
}, _errorFactory)) && _ao13(input.ads, _path + ".ads", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
300
332
|
method: "typia.createAssert",
|
|
301
333
|
path: _path + ".ads",
|
|
302
334
|
expected: "EffectiveAdsConfig",
|
|
@@ -306,7 +338,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
306
338
|
path: _path + ".leaderboard",
|
|
307
339
|
expected: "EffectiveLeaderboardConfig",
|
|
308
340
|
value: input.leaderboard
|
|
309
|
-
}, _errorFactory)) &&
|
|
341
|
+
}, _errorFactory)) && _ao18(input.leaderboard, _path + ".leaderboard", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
310
342
|
method: "typia.createAssert",
|
|
311
343
|
path: _path + ".leaderboard",
|
|
312
344
|
expected: "EffectiveLeaderboardConfig",
|
|
@@ -316,7 +348,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
316
348
|
path: _path + ".storage",
|
|
317
349
|
expected: "EffectiveStorageConfig",
|
|
318
350
|
value: input.storage
|
|
319
|
-
}, _errorFactory)) &&
|
|
351
|
+
}, _errorFactory)) && _ao19(input.storage, _path + ".storage", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
320
352
|
method: "typia.createAssert",
|
|
321
353
|
path: _path + ".storage",
|
|
322
354
|
expected: "EffectiveStorageConfig",
|
|
@@ -326,12 +358,18 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
326
358
|
path: _path + ".localization",
|
|
327
359
|
expected: "EffectiveLocalizationConfig",
|
|
328
360
|
value: input.localization
|
|
329
|
-
}, _errorFactory)) &&
|
|
361
|
+
}, _errorFactory)) && _ao20(input.localization, _path + ".localization", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
330
362
|
method: "typia.createAssert",
|
|
331
363
|
path: _path + ".localization",
|
|
332
364
|
expected: "EffectiveLocalizationConfig",
|
|
333
365
|
value: input.localization
|
|
334
366
|
}, _errorFactory));
|
|
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));
|
|
335
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, {
|
|
336
374
|
method: "typia.createAssert",
|
|
337
375
|
path: _path + ".profile",
|
|
@@ -350,7 +388,38 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
350
388
|
expected: "(\"local\" | \"native\" | \"none\")",
|
|
351
389
|
value: input.storage
|
|
352
390
|
}, _errorFactory)) && _ap4(input, _path, true && _exceptionable);
|
|
353
|
-
const _ao6 = (input, _path, _exceptionable = true) => ("
|
|
391
|
+
const _ao6 = (input, _path, _exceptionable = true) => ("approval-required" === input.identityUpgrade || "available" === input.identityUpgrade || "configuration-required" === input.identityUpgrade || "disabled" === input.identityUpgrade || "unsupported" === input.identityUpgrade || _a._assertGuard(_exceptionable, {
|
|
392
|
+
method: "typia.createAssert",
|
|
393
|
+
path: _path + ".identityUpgrade",
|
|
394
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
395
|
+
value: input.identityUpgrade
|
|
396
|
+
}, _errorFactory)) && ("approval-required" === input.presentation || "available" === input.presentation || "configuration-required" === input.presentation || "disabled" === input.presentation || "unsupported" === input.presentation || _a._assertGuard(_exceptionable, {
|
|
397
|
+
method: "typia.createAssert",
|
|
398
|
+
path: _path + ".presentation",
|
|
399
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
400
|
+
value: input.presentation
|
|
401
|
+
}, _errorFactory)) && ("approval-required" === input.sharing || "available" === input.sharing || "configuration-required" === input.sharing || "disabled" === input.sharing || "unsupported" === input.sharing || _a._assertGuard(_exceptionable, {
|
|
402
|
+
method: "typia.createAssert",
|
|
403
|
+
path: _path + ".sharing",
|
|
404
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
405
|
+
value: input.sharing
|
|
406
|
+
}, _errorFactory)) && ("approval-required" === input.inboundShare || "available" === input.inboundShare || "configuration-required" === input.inboundShare || "disabled" === input.inboundShare || "unsupported" === input.inboundShare || _a._assertGuard(_exceptionable, {
|
|
407
|
+
method: "typia.createAssert",
|
|
408
|
+
path: _path + ".inboundShare",
|
|
409
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
410
|
+
value: input.inboundShare
|
|
411
|
+
}, _errorFactory)) && ("approval-required" === input.notifications || "available" === input.notifications || "configuration-required" === input.notifications || "disabled" === input.notifications || "unsupported" === input.notifications || _a._assertGuard(_exceptionable, {
|
|
412
|
+
method: "typia.createAssert",
|
|
413
|
+
path: _path + ".notifications",
|
|
414
|
+
expected: "(\"approval-required\" | \"available\" | \"configuration-required\" | \"disabled\" | \"unsupported\")",
|
|
415
|
+
value: input.notifications
|
|
416
|
+
}, _errorFactory)) && ("fullscreen" === input.presentationMode || "inline-expanded" === input.presentationMode || _a._assertGuard(_exceptionable, {
|
|
417
|
+
method: "typia.createAssert",
|
|
418
|
+
path: _path + ".presentationMode",
|
|
419
|
+
expected: "(\"fullscreen\" | \"inline-expanded\")",
|
|
420
|
+
value: input.presentationMode
|
|
421
|
+
}, _errorFactory));
|
|
422
|
+
const _ao7 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.externalPaymentAllowed || _a._assertGuard(_exceptionable, {
|
|
354
423
|
method: "typia.createAssert",
|
|
355
424
|
path: _path + ".externalPaymentAllowed",
|
|
356
425
|
expected: "boolean",
|
|
@@ -376,7 +445,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
376
445
|
expected: "boolean",
|
|
377
446
|
value: input.requiresAitReview
|
|
378
447
|
}, _errorFactory));
|
|
379
|
-
const
|
|
448
|
+
const _ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input.targetConfig || _a._assertGuard(_exceptionable, {
|
|
380
449
|
method: "typia.createAssert",
|
|
381
450
|
path: _path + ".targetConfig",
|
|
382
451
|
expected: "string",
|
|
@@ -402,7 +471,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
402
471
|
expected: "(string | undefined)",
|
|
403
472
|
value: input.platformAdapter
|
|
404
473
|
}, _errorFactory));
|
|
405
|
-
const
|
|
474
|
+
const _ao9 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && ((Array.isArray(input.products) || _a._assertGuard(_exceptionable, {
|
|
406
475
|
method: "typia.createAssert",
|
|
407
476
|
path: _path + ".products",
|
|
408
477
|
expected: "ReadonlyArray<EffectiveProductConfig>",
|
|
@@ -412,7 +481,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
412
481
|
path: _path + ".products[" + _index3 + "]",
|
|
413
482
|
expected: "EffectiveProductConfig",
|
|
414
483
|
value: elem
|
|
415
|
-
}, _errorFactory)) &&
|
|
484
|
+
}, _errorFactory)) && _ao10(elem, _path + ".products[" + _index3 + "]", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
416
485
|
method: "typia.createAssert",
|
|
417
486
|
path: _path + ".products[" + _index3 + "]",
|
|
418
487
|
expected: "EffectiveProductConfig",
|
|
@@ -423,37 +492,11 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
423
492
|
expected: "ReadonlyArray<EffectiveProductConfig>",
|
|
424
493
|
value: input.products
|
|
425
494
|
}, _errorFactory));
|
|
426
|
-
const _ao9 = (input, _path, _exceptionable = true) => ("COINS_100" === input.id || "COINS_500" === input.id || "REMOVE_ADS" === input.id || _a._assertGuard(_exceptionable, {
|
|
427
|
-
method: "typia.createAssert",
|
|
428
|
-
path: _path + ".id",
|
|
429
|
-
expected: "(\"COINS_100\" | \"COINS_500\" | \"REMOVE_ADS\")",
|
|
430
|
-
value: input.id
|
|
431
|
-
}, _errorFactory)) && ("consumable" === input.type || "non_consumable" === input.type || "subscription" === input.type || _a._assertGuard(_exceptionable, {
|
|
432
|
-
method: "typia.createAssert",
|
|
433
|
-
path: _path + ".type",
|
|
434
|
-
expected: "(\"consumable\" | \"non_consumable\" | \"subscription\")",
|
|
435
|
-
value: input.type
|
|
436
|
-
}, _errorFactory)) && (("object" === typeof input.grant && null !== input.grant || _a._assertGuard(_exceptionable, {
|
|
437
|
-
method: "typia.createAssert",
|
|
438
|
-
path: _path + ".grant",
|
|
439
|
-
expected: _ae0,
|
|
440
|
-
value: input.grant
|
|
441
|
-
}, _errorFactory)) && _au0(input.grant, _path + ".grant", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
442
|
-
method: "typia.createAssert",
|
|
443
|
-
path: _path + ".grant",
|
|
444
|
-
expected: _ae0,
|
|
445
|
-
value: input.grant
|
|
446
|
-
}, _errorFactory)) && _ap5(input, _path, true && _exceptionable) && _ap6(input, _path, true && _exceptionable) && (undefined === input.platformProductId || "string" === typeof input.platformProductId || _a._assertGuard(_exceptionable, {
|
|
447
|
-
method: "typia.createAssert",
|
|
448
|
-
path: _path + ".platformProductId",
|
|
449
|
-
expected: "(string | undefined)",
|
|
450
|
-
value: input.platformProductId
|
|
451
|
-
}, _errorFactory));
|
|
452
495
|
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
453
496
|
if ("currency" === input.type)
|
|
454
|
-
return _ao10(input, _path, true && _exceptionable);
|
|
455
|
-
else if ("entitlement" === input.type)
|
|
456
497
|
return _ao11(input, _path, true && _exceptionable);
|
|
498
|
+
else if ("entitlement" === input.type)
|
|
499
|
+
return _ao12(input, _path, true && _exceptionable);
|
|
457
500
|
else
|
|
458
501
|
return _a._assertGuard(_exceptionable, {
|
|
459
502
|
method: "typia.createAssert",
|
|
@@ -464,9 +507,9 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
464
507
|
})();
|
|
465
508
|
const _au1 = (input, _path, _exceptionable = true) => (() => {
|
|
466
509
|
if ("continue" === input.type)
|
|
467
|
-
return _ao14(input, _path, true && _exceptionable);
|
|
468
|
-
else if ("currency" === input.type)
|
|
469
510
|
return _ao15(input, _path, true && _exceptionable);
|
|
511
|
+
else if ("currency" === input.type)
|
|
512
|
+
return _ao16(input, _path, true && _exceptionable);
|
|
470
513
|
else
|
|
471
514
|
return _a._assertGuard(_exceptionable, {
|
|
472
515
|
method: "typia.createAssert",
|
|
@@ -482,37 +525,38 @@ export const assertEffectiveTargetConfigMatrix = (() => {
|
|
|
482
525
|
return true;
|
|
483
526
|
return "object" === typeof value && null !== value && _io2(value);
|
|
484
527
|
});
|
|
485
|
-
const _io10 = input =>
|
|
486
|
-
const _io11 = input =>
|
|
487
|
-
const _io12 = input =>
|
|
488
|
-
const _io13 = input => (
|
|
489
|
-
const _io14 = input => "
|
|
490
|
-
const _io15 = input =>
|
|
491
|
-
const _io16 = input =>
|
|
492
|
-
const _io17 = input => "
|
|
493
|
-
const _io18 = input => ("
|
|
494
|
-
const _io19 = input =>
|
|
495
|
-
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.policy && null !== input.policy &&
|
|
528
|
+
const _io10 = input => _ip5(input) && ("consumable" === input.type || "non_consumable" === input.type || "subscription" === input.type) && ("object" === typeof input.grant && null !== input.grant && _iu0(input.grant)) && _ip6(input) && _ip7(input) && (undefined === input.platformProductId || "string" === typeof input.platformProductId);
|
|
529
|
+
const _io11 = input => _ip8(input) && _ip9(input) && _ip10(input);
|
|
530
|
+
const _io12 = input => "entitlement" === input.type && "string" === typeof input.entitlement;
|
|
531
|
+
const _io13 = input => _ip2(input) && _ip3(input) && (Array.isArray(input.placements) && input.placements.every(elem => "object" === typeof elem && null !== elem && _io14(elem)));
|
|
532
|
+
const _io14 = input => _ip5(input) && ("interstitial" === input.type || "rewarded" === input.type) && (undefined === input.reward || "object" === typeof input.reward && null !== input.reward && _iu1(input.reward)) && ("object" === typeof input.frequencyCap && null !== input.frequencyCap && _io17(input.frequencyCap)) && _ip6(input) && _ip7(input) && (undefined === input.platformPlacementId || "string" === typeof input.platformPlacementId);
|
|
533
|
+
const _io15 = input => "continue" === input.type && _ip10(input);
|
|
534
|
+
const _io16 = input => _ip8(input) && _ip10(input) && _ip9(input);
|
|
535
|
+
const _io17 = input => "number" === typeof input.cooldownSeconds && (undefined === input.maxPerSession || "number" === typeof input.maxPerSession) && (undefined === input.minStageInterval || "number" === typeof input.minStageInterval);
|
|
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);
|
|
537
|
+
const _io19 = input => ("local" === input.support || "native" === input.support || "none" === input.support) && _ip6(input);
|
|
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));
|
|
539
|
+
const _io20 = input => _ip6(input) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale);
|
|
496
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;
|
|
497
541
|
const _io4 = input => _ip1(input) && _ip2(input) && _ip3(input) && "boolean" === typeof input.leaderboard && _ip4(input);
|
|
498
542
|
const _io5 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip4(input);
|
|
499
|
-
const _io6 = input => "
|
|
500
|
-
const _io7 = input => "
|
|
501
|
-
const _io8 = input =>
|
|
502
|
-
const _io9 = input => (
|
|
543
|
+
const _io6 = 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);
|
|
544
|
+
const _io7 = input => "boolean" === typeof input.externalPaymentAllowed && "boolean" === typeof input.remoteExecutableCodeAllowed && "boolean" === typeof input.installOtherAppCTAAllowed && "boolean" === typeof input.requiresStoreReview && "boolean" === typeof input.requiresAitReview;
|
|
545
|
+
const _io8 = input => "string" === typeof input.targetConfig && "string" === typeof input.productCatalog && "string" === typeof input.adPlacements && (undefined === input.platformTargetKind || "string" === typeof input.platformTargetKind) && (undefined === input.platformAdapter || "string" === typeof input.platformAdapter);
|
|
546
|
+
const _io9 = input => _ip1(input) && (Array.isArray(input.products) && input.products.every(elem => "object" === typeof elem && null !== elem && _io10(elem)));
|
|
503
547
|
const _iu0 = input => (() => {
|
|
504
548
|
if ("currency" === input.type)
|
|
505
|
-
return _io10(input);
|
|
506
|
-
else if ("entitlement" === input.type)
|
|
507
549
|
return _io11(input);
|
|
550
|
+
else if ("entitlement" === input.type)
|
|
551
|
+
return _io12(input);
|
|
508
552
|
else
|
|
509
553
|
return false;
|
|
510
554
|
})();
|
|
511
555
|
const _iu1 = input => (() => {
|
|
512
556
|
if ("continue" === input.type)
|
|
513
|
-
return _io14(input);
|
|
514
|
-
else if ("currency" === input.type)
|
|
515
557
|
return _io15(input);
|
|
558
|
+
else if ("currency" === input.type)
|
|
559
|
+
return _io16(input);
|
|
516
560
|
else
|
|
517
561
|
return false;
|
|
518
562
|
})();
|
|
@@ -597,6 +641,37 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
597
641
|
value: value
|
|
598
642
|
}, _errorFactory);
|
|
599
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));
|
|
600
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, {
|
|
601
676
|
method: "typia.createAssert",
|
|
602
677
|
path: _path + ".runtime",
|
|
@@ -622,12 +697,22 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
622
697
|
path: _path + ".capabilities",
|
|
623
698
|
expected: "TargetCapabilityConfig",
|
|
624
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
|
|
625
710
|
}, _errorFactory)) && (("object" === typeof input.monetization && null !== input.monetization || _a._assertGuard(_exceptionable, {
|
|
626
711
|
method: "typia.createAssert",
|
|
627
712
|
path: _path + ".monetization",
|
|
628
713
|
expected: "TargetMonetizationConfig",
|
|
629
714
|
value: input.monetization
|
|
630
|
-
}, _errorFactory)) &&
|
|
715
|
+
}, _errorFactory)) && _ao6(input.monetization, _path + ".monetization", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
631
716
|
method: "typia.createAssert",
|
|
632
717
|
path: _path + ".monetization",
|
|
633
718
|
expected: "TargetMonetizationConfig",
|
|
@@ -637,7 +722,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
637
722
|
path: _path + ".leaderboard",
|
|
638
723
|
expected: "TargetLeaderboardConfig",
|
|
639
724
|
value: input.leaderboard
|
|
640
|
-
}, _errorFactory)) &&
|
|
725
|
+
}, _errorFactory)) && _ao7(input.leaderboard, _path + ".leaderboard", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
641
726
|
method: "typia.createAssert",
|
|
642
727
|
path: _path + ".leaderboard",
|
|
643
728
|
expected: "TargetLeaderboardConfig",
|
|
@@ -647,7 +732,7 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
647
732
|
path: _path + ".release",
|
|
648
733
|
expected: "TargetReleaseConfig",
|
|
649
734
|
value: input.release
|
|
650
|
-
}, _errorFactory)) &&
|
|
735
|
+
}, _errorFactory)) && _ao8(input.release, _path + ".release", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
651
736
|
method: "typia.createAssert",
|
|
652
737
|
path: _path + ".release",
|
|
653
738
|
expected: "TargetReleaseConfig",
|
|
@@ -657,11 +742,21 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
657
742
|
path: _path + ".policy",
|
|
658
743
|
expected: "TargetPolicyRestrictions",
|
|
659
744
|
value: input.policy
|
|
660
|
-
}, _errorFactory)) &&
|
|
745
|
+
}, _errorFactory)) && _ao9(input.policy, _path + ".policy", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
661
746
|
method: "typia.createAssert",
|
|
662
747
|
path: _path + ".policy",
|
|
663
748
|
expected: "TargetPolicyRestrictions",
|
|
664
749
|
value: input.policy
|
|
750
|
+
}, _errorFactory)) && (undefined === input.integrations || ("object" === typeof input.integrations && null !== input.integrations || _a._assertGuard(_exceptionable, {
|
|
751
|
+
method: "typia.createAssert",
|
|
752
|
+
path: _path + ".integrations",
|
|
753
|
+
expected: "(TargetIntegrationConfig | undefined)",
|
|
754
|
+
value: input.integrations
|
|
755
|
+
}, _errorFactory)) && _ao10(input.integrations, _path + ".integrations", true && _exceptionable) || _a._assertGuard(_exceptionable, {
|
|
756
|
+
method: "typia.createAssert",
|
|
757
|
+
path: _path + ".integrations",
|
|
758
|
+
expected: "(TargetIntegrationConfig | undefined)",
|
|
759
|
+
value: input.integrations
|
|
665
760
|
}, _errorFactory));
|
|
666
761
|
const _ao3 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && _ap1(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable) && ("boolean" === typeof input.leaderboard || _a._assertGuard(_exceptionable, {
|
|
667
762
|
method: "typia.createAssert",
|
|
@@ -675,20 +770,26 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
675
770
|
expected: "(\"local\" | \"native\" | \"none\")",
|
|
676
771
|
value: input.storage
|
|
677
772
|
}, _errorFactory)) && _ap3(input, _path, true && _exceptionable);
|
|
678
|
-
const _ao5 = (input, _path, _exceptionable = true) =>
|
|
679
|
-
|
|
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, {
|
|
680
781
|
method: "typia.createAssert",
|
|
681
782
|
path: _path + ".native",
|
|
682
783
|
expected: "boolean",
|
|
683
784
|
value: input.native
|
|
684
785
|
}, _errorFactory);
|
|
685
|
-
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, {
|
|
686
787
|
method: "typia.createAssert",
|
|
687
788
|
path: _path + ".profile",
|
|
688
789
|
expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"web-preview\")",
|
|
689
790
|
value: input.profile
|
|
690
791
|
}, _errorFactory);
|
|
691
|
-
const
|
|
792
|
+
const _ao9 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.externalPaymentAllowed || _a._assertGuard(_exceptionable, {
|
|
692
793
|
method: "typia.createAssert",
|
|
693
794
|
path: _path + ".externalPaymentAllowed",
|
|
694
795
|
expected: "boolean",
|
|
@@ -721,13 +822,15 @@ export const assertTargetConfigMatrix = (() => {
|
|
|
721
822
|
return true;
|
|
722
823
|
return "object" === typeof value && null !== value && _io2(value);
|
|
723
824
|
});
|
|
724
|
-
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));
|
|
725
827
|
const _io3 = input => _ip0(input) && _ip1(input) && _ip2(input) && "boolean" === typeof input.leaderboard && _ip3(input);
|
|
726
828
|
const _io4 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip3(input);
|
|
727
|
-
const _io5 = input =>
|
|
728
|
-
const _io6 = input =>
|
|
729
|
-
const _io7 = input => "
|
|
730
|
-
const _io8 = 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;
|
|
731
834
|
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
732
835
|
let _errorFactory;
|
|
733
836
|
return (input, errorFactory) => {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import type { MpgdLocale } from '@mpgd/i18n';
|
|
1
2
|
import type { PlatformCapabilities, PlatformGateway } from '@mpgd/platform';
|
|
2
|
-
import type { EffectiveTargetConfig } from './effective';
|
|
3
|
+
import type { EffectiveTargetConfig } from './effective.js';
|
|
3
4
|
export type PlatformFeature = 'iap' | 'rewardedAds' | 'interstitialAds' | 'leaderboard' | 'localization';
|
|
4
5
|
export type AdPlacementType = 'rewarded' | 'interstitial';
|
|
5
6
|
type PlatformConfigTarget = PlatformGateway['target'];
|
|
6
7
|
export type TargetRuntimeKind = 'web-preview' | 'microsoft-store-pwa' | 'capacitor-android' | 'capacitor-ios' | 'apps-in-toss' | 'devvit-web';
|
|
7
8
|
export type ReleaseProfile = 'web-preview' | 'microsoft-store' | 'google-play' | 'app-store' | 'apps-in-toss' | 'devvit';
|
|
8
9
|
export type StorageSupport = 'local' | 'native' | 'none';
|
|
10
|
+
export type TargetIntegration = 'identityUpgrade' | 'presentation' | 'sharing' | 'inboundShare' | 'notifications';
|
|
11
|
+
export type IntegrationAvailabilityState = 'available' | 'disabled' | 'approval-required' | 'configuration-required' | 'unsupported';
|
|
12
|
+
export type PresentationMode = 'fullscreen' | 'inline-expanded';
|
|
13
|
+
export interface TargetIntegrationConfig {
|
|
14
|
+
readonly identityUpgrade: IntegrationAvailabilityState;
|
|
15
|
+
readonly presentation: IntegrationAvailabilityState;
|
|
16
|
+
readonly sharing: IntegrationAvailabilityState;
|
|
17
|
+
readonly inboundShare: IntegrationAvailabilityState;
|
|
18
|
+
readonly notifications: IntegrationAvailabilityState;
|
|
19
|
+
readonly presentationMode: PresentationMode;
|
|
20
|
+
}
|
|
9
21
|
export interface TargetFeatureConfig {
|
|
10
22
|
readonly iap: boolean;
|
|
11
23
|
readonly rewardedAds: boolean;
|
|
@@ -17,6 +29,9 @@ export interface TargetCapabilityConfig {
|
|
|
17
29
|
readonly storage: StorageSupport;
|
|
18
30
|
readonly localization: boolean;
|
|
19
31
|
}
|
|
32
|
+
export interface TargetLocalizationConfig {
|
|
33
|
+
readonly fallbackLocale: MpgdLocale;
|
|
34
|
+
}
|
|
20
35
|
export interface TargetMonetizationConfig {
|
|
21
36
|
readonly iap: boolean;
|
|
22
37
|
readonly rewardedAds: boolean;
|
|
@@ -39,10 +54,12 @@ export interface TargetConfig {
|
|
|
39
54
|
readonly runtime: TargetRuntimeKind;
|
|
40
55
|
readonly features: TargetFeatureConfig;
|
|
41
56
|
readonly capabilities: TargetCapabilityConfig;
|
|
57
|
+
readonly localization: TargetLocalizationConfig;
|
|
42
58
|
readonly monetization: TargetMonetizationConfig;
|
|
43
59
|
readonly leaderboard: TargetLeaderboardConfig;
|
|
44
60
|
readonly release: TargetReleaseConfig;
|
|
45
61
|
readonly policy: TargetPolicyRestrictions;
|
|
62
|
+
readonly integrations?: TargetIntegrationConfig;
|
|
46
63
|
}
|
|
47
64
|
export interface TargetConfigMatrix {
|
|
48
65
|
readonly version: string;
|
|
@@ -66,13 +83,21 @@ export interface AdPlacementAvailability {
|
|
|
66
83
|
readonly enabled: boolean;
|
|
67
84
|
readonly reason: FeatureAvailabilityReason;
|
|
68
85
|
}
|
|
86
|
+
export interface IntegrationAvailability {
|
|
87
|
+
readonly integration: TargetIntegration;
|
|
88
|
+
readonly state: IntegrationAvailabilityState;
|
|
89
|
+
readonly configuredState: IntegrationAvailabilityState;
|
|
90
|
+
readonly adapterSupported: boolean;
|
|
91
|
+
}
|
|
69
92
|
export interface TargetRuntimeSnapshot {
|
|
70
93
|
readonly target: PlatformConfigTarget;
|
|
71
94
|
readonly configTarget: string;
|
|
72
95
|
readonly config: TargetConfig;
|
|
73
96
|
readonly effectiveConfig?: EffectiveTargetConfig;
|
|
97
|
+
readonly presentationMode: PresentationMode;
|
|
74
98
|
readonly capabilities: PlatformCapabilities;
|
|
75
99
|
readonly features: Record<PlatformFeature, FeatureAvailability>;
|
|
100
|
+
readonly integrations: Record<TargetIntegration, IntegrationAvailability>;
|
|
76
101
|
readonly adPlacements: readonly AdPlacementAvailability[];
|
|
77
102
|
}
|
|
78
103
|
export interface TargetAvailabilityOptions {
|
|
@@ -88,11 +113,27 @@ export interface TargetConfiguredGateway extends PlatformGateway {
|
|
|
88
113
|
getTargetRuntime(): Promise<TargetRuntimeSnapshot>;
|
|
89
114
|
}
|
|
90
115
|
export declare const platformFeatures: readonly ["iap", "rewardedAds", "interstitialAds", "leaderboard", "localization"];
|
|
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>;
|
|
122
|
+
export declare const defaultTargetIntegrationConfig: {
|
|
123
|
+
readonly identityUpgrade: 'disabled';
|
|
124
|
+
readonly presentation: 'disabled';
|
|
125
|
+
readonly sharing: 'disabled';
|
|
126
|
+
readonly inboundShare: 'disabled';
|
|
127
|
+
readonly notifications: 'unsupported';
|
|
128
|
+
readonly presentationMode: 'fullscreen';
|
|
129
|
+
};
|
|
130
|
+
export declare function normalizeTargetIntegrationConfig(config: Partial<TargetIntegrationConfig> | undefined): TargetIntegrationConfig;
|
|
91
131
|
export declare function targetConfigKeyForPlatform(target: PlatformConfigTarget): string;
|
|
92
132
|
export declare function getTargetConfig(matrix: TargetConfigMatrix, target: PlatformConfigTarget | string): TargetConfig;
|
|
93
133
|
export declare function isPlatformFeatureEnabled(config: TargetConfig, feature: PlatformFeature): boolean;
|
|
94
134
|
export declare function applyTargetConfigToCapabilities(capabilities: PlatformCapabilities, config: TargetConfig): PlatformCapabilities;
|
|
95
135
|
export declare function getFeatureAvailability(feature: PlatformFeature, config: TargetConfig, capabilities: PlatformCapabilities): FeatureAvailability;
|
|
136
|
+
export declare function getIntegrationAvailability(integration: TargetIntegration, config: TargetConfig, gateway?: PlatformGateway): IntegrationAvailability;
|
|
96
137
|
export declare function createTargetRuntimeSnapshot(input: {
|
|
97
138
|
readonly target: PlatformConfigTarget;
|
|
98
139
|
readonly configTarget?: string;
|
|
@@ -100,6 +141,7 @@ export declare function createTargetRuntimeSnapshot(input: {
|
|
|
100
141
|
readonly effectiveConfig?: EffectiveTargetConfig;
|
|
101
142
|
readonly capabilities: PlatformCapabilities;
|
|
102
143
|
readonly adPlacements?: readonly AdPlacementDefinition[];
|
|
144
|
+
readonly gateway?: PlatformGateway;
|
|
103
145
|
}): TargetRuntimeSnapshot;
|
|
104
146
|
export declare function withTargetAvailability(gateway: PlatformGateway, config: TargetConfig, options?: TargetAvailabilityOptions): TargetConfiguredGateway;
|
|
105
147
|
export declare function isTargetConfiguredGateway(gateway: PlatformGateway): gateway is TargetConfiguredGateway;
|
package/dist/runtime.js
CHANGED
|
@@ -5,6 +5,49 @@ export const platformFeatures = [
|
|
|
5
5
|
'leaderboard',
|
|
6
6
|
'localization',
|
|
7
7
|
];
|
|
8
|
+
export const targetIntegrations = [
|
|
9
|
+
'identityUpgrade',
|
|
10
|
+
'presentation',
|
|
11
|
+
'sharing',
|
|
12
|
+
'inboundShare',
|
|
13
|
+
'notifications',
|
|
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;
|
|
28
|
+
export const defaultTargetIntegrationConfig = {
|
|
29
|
+
identityUpgrade: 'disabled',
|
|
30
|
+
presentation: 'disabled',
|
|
31
|
+
sharing: 'disabled',
|
|
32
|
+
inboundShare: 'disabled',
|
|
33
|
+
notifications: 'unsupported',
|
|
34
|
+
presentationMode: 'fullscreen',
|
|
35
|
+
};
|
|
36
|
+
const integrationAvailabilityStateSet = new Set(integrationAvailabilityStates);
|
|
37
|
+
const presentationModeSet = new Set(presentationModes);
|
|
38
|
+
export function normalizeTargetIntegrationConfig(config) {
|
|
39
|
+
if (config === undefined) {
|
|
40
|
+
return defaultTargetIntegrationConfig;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
identityUpgrade: normalizeIntegrationAvailabilityState(config.identityUpgrade, defaultTargetIntegrationConfig.identityUpgrade),
|
|
44
|
+
presentation: normalizeIntegrationAvailabilityState(config.presentation, defaultTargetIntegrationConfig.presentation),
|
|
45
|
+
sharing: normalizeIntegrationAvailabilityState(config.sharing, defaultTargetIntegrationConfig.sharing),
|
|
46
|
+
inboundShare: normalizeIntegrationAvailabilityState(config.inboundShare, defaultTargetIntegrationConfig.inboundShare),
|
|
47
|
+
notifications: normalizeIntegrationAvailabilityState(config.notifications, defaultTargetIntegrationConfig.notifications),
|
|
48
|
+
presentationMode: normalizePresentationMode(config.presentationMode),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
8
51
|
export function targetConfigKeyForPlatform(target) {
|
|
9
52
|
return target === 'browser' ? 'web-preview' : target;
|
|
10
53
|
}
|
|
@@ -46,6 +89,10 @@ export function getFeatureAvailability(feature, config, capabilities) {
|
|
|
46
89
|
: 'target-disabled',
|
|
47
90
|
};
|
|
48
91
|
}
|
|
92
|
+
export function getIntegrationAvailability(integration, config, gateway) {
|
|
93
|
+
const integrations = normalizeTargetIntegrationConfig(config.integrations);
|
|
94
|
+
return createIntegrationAvailability(integration, integrations[integration], gateway);
|
|
95
|
+
}
|
|
49
96
|
export function createTargetRuntimeSnapshot(input) {
|
|
50
97
|
const configTarget = input.configTarget ?? targetConfigKeyForPlatform(input.target);
|
|
51
98
|
const features = {
|
|
@@ -55,13 +102,21 @@ export function createTargetRuntimeSnapshot(input) {
|
|
|
55
102
|
leaderboard: getFeatureAvailability('leaderboard', input.config, input.capabilities),
|
|
56
103
|
localization: getFeatureAvailability('localization', input.config, input.capabilities),
|
|
57
104
|
};
|
|
105
|
+
const integrationConfig = normalizeTargetIntegrationConfig(input.effectiveConfig?.integrations ?? input.config.integrations);
|
|
106
|
+
const integrationEntries = targetIntegrations.map((integration) => {
|
|
107
|
+
const availability = createIntegrationAvailability(integration, integrationConfig[integration], input.gateway);
|
|
108
|
+
return [integration, availability];
|
|
109
|
+
});
|
|
110
|
+
const integrations = Object.fromEntries(integrationEntries);
|
|
58
111
|
return {
|
|
59
112
|
target: input.target,
|
|
60
113
|
configTarget,
|
|
61
114
|
config: input.config,
|
|
62
115
|
...(input.effectiveConfig === undefined ? {} : { effectiveConfig: input.effectiveConfig }),
|
|
116
|
+
presentationMode: integrationConfig.presentationMode,
|
|
63
117
|
capabilities: input.capabilities,
|
|
64
118
|
features,
|
|
119
|
+
integrations,
|
|
65
120
|
adPlacements: (input.adPlacements ?? []).map((placement) => {
|
|
66
121
|
const feature = placement.type === 'rewarded' ? 'rewardedAds' : 'interstitialAds';
|
|
67
122
|
const availability = features[feature];
|
|
@@ -76,6 +131,36 @@ export function createTargetRuntimeSnapshot(input) {
|
|
|
76
131
|
}
|
|
77
132
|
export function withTargetAvailability(gateway, config, options = {}) {
|
|
78
133
|
const configTarget = options.configTarget ?? targetConfigKeyForPlatform(gateway.target);
|
|
134
|
+
const { identity: gatewayIdentity, presentation: gatewayPresentation, sharing: gatewaySharing, notifications: gatewayNotifications, ...gatewayWithoutIntegrations } = gateway;
|
|
135
|
+
const integrations = normalizeTargetIntegrationConfig(options.effectiveConfig?.integrations ?? config.integrations);
|
|
136
|
+
const isIntegrationAvailable = (integration) => (createIntegrationAvailability(integration, integrations[integration], gateway).state
|
|
137
|
+
=== 'available');
|
|
138
|
+
const identityUpgradeAvailable = isIntegrationAvailable('identityUpgrade');
|
|
139
|
+
const presentationAvailable = isIntegrationAvailable('presentation');
|
|
140
|
+
const sharingAvailable = isIntegrationAvailable('sharing');
|
|
141
|
+
const inboundShareAvailable = isIntegrationAvailable('inboundShare');
|
|
142
|
+
const notificationsAvailable = isIntegrationAvailable('notifications');
|
|
143
|
+
const getIdentitySession = gatewayIdentity.getSession?.bind(gatewayIdentity);
|
|
144
|
+
const requestIdentityUpgrade = gatewayIdentity.requestUpgrade?.bind(gatewayIdentity);
|
|
145
|
+
const shareOutbound = gatewaySharing?.share?.bind(gatewaySharing);
|
|
146
|
+
const readInboundShare = gatewaySharing?.readInboundShare?.bind(gatewaySharing);
|
|
147
|
+
const exposeOutboundShare = sharingAvailable && shareOutbound !== undefined;
|
|
148
|
+
const exposeInboundShare = inboundShareAvailable && readInboundShare !== undefined;
|
|
149
|
+
const identity = {
|
|
150
|
+
getPlayer: gatewayIdentity.getPlayer.bind(gatewayIdentity),
|
|
151
|
+
...(getIdentitySession === undefined ? {} : { getSession: getIdentitySession }),
|
|
152
|
+
...(!identityUpgradeAvailable || requestIdentityUpgrade === undefined
|
|
153
|
+
? {}
|
|
154
|
+
: { requestUpgrade: requestIdentityUpgrade }),
|
|
155
|
+
};
|
|
156
|
+
const presentation = presentationAvailable ? gatewayPresentation : undefined;
|
|
157
|
+
const sharing = !exposeOutboundShare && !exposeInboundShare
|
|
158
|
+
? undefined
|
|
159
|
+
: {
|
|
160
|
+
...(exposeOutboundShare ? { share: shareOutbound } : {}),
|
|
161
|
+
...(exposeInboundShare ? { readInboundShare } : {}),
|
|
162
|
+
};
|
|
163
|
+
const notifications = notificationsAvailable ? gatewayNotifications : undefined;
|
|
79
164
|
const isAdPlacementAllowed = (placementId, expectedType) => {
|
|
80
165
|
const actualType = options.resolveAdPlacementType?.(placementId);
|
|
81
166
|
if (actualType !== undefined && actualType !== expectedType) {
|
|
@@ -96,7 +181,11 @@ export function withTargetAvailability(gateway, config, options = {}) {
|
|
|
96
181
|
return config.features.rewardedAds || config.features.interstitialAds;
|
|
97
182
|
};
|
|
98
183
|
return {
|
|
99
|
-
...
|
|
184
|
+
...gatewayWithoutIntegrations,
|
|
185
|
+
identity,
|
|
186
|
+
...(presentation === undefined ? {} : { presentation }),
|
|
187
|
+
...(sharing === undefined ? {} : { sharing }),
|
|
188
|
+
...(notifications === undefined ? {} : { notifications }),
|
|
100
189
|
configTarget,
|
|
101
190
|
targetConfig: config,
|
|
102
191
|
...(options.effectiveConfig === undefined
|
|
@@ -112,6 +201,7 @@ export function withTargetAvailability(gateway, config, options = {}) {
|
|
|
112
201
|
: { effectiveConfig: options.effectiveConfig }),
|
|
113
202
|
capabilities: applyTargetConfigToCapabilities(await gateway.getCapabilities(), config),
|
|
114
203
|
adPlacements: options.adPlacements ?? [],
|
|
204
|
+
gateway,
|
|
115
205
|
});
|
|
116
206
|
},
|
|
117
207
|
async getCapabilities() {
|
|
@@ -192,3 +282,43 @@ function isFeatureCapabilitySupported(feature, capabilities) {
|
|
|
192
282
|
return capabilities.localizedContent;
|
|
193
283
|
}
|
|
194
284
|
}
|
|
285
|
+
function isIntegrationAdapterSupported(integration, gateway) {
|
|
286
|
+
if (gateway === undefined) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
switch (integration) {
|
|
290
|
+
case 'identityUpgrade':
|
|
291
|
+
return typeof gateway.identity.requestUpgrade === 'function';
|
|
292
|
+
case 'presentation':
|
|
293
|
+
return (typeof gateway.presentation?.getLaunchIntent === 'function'
|
|
294
|
+
&& typeof gateway.presentation?.requestGameSurface === 'function');
|
|
295
|
+
case 'sharing':
|
|
296
|
+
return typeof gateway.sharing?.share === 'function';
|
|
297
|
+
case 'inboundShare':
|
|
298
|
+
return typeof gateway.sharing?.readInboundShare === 'function';
|
|
299
|
+
case 'notifications':
|
|
300
|
+
return (typeof gateway.notifications?.getStatus === 'function'
|
|
301
|
+
&& typeof gateway.notifications?.requestSubscription === 'function');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function createIntegrationAvailability(integration, configuredState, gateway) {
|
|
305
|
+
const adapterSupported = isIntegrationAdapterSupported(integration, gateway);
|
|
306
|
+
return {
|
|
307
|
+
integration,
|
|
308
|
+
state: adapterSupported ? configuredState : 'unsupported',
|
|
309
|
+
configuredState,
|
|
310
|
+
adapterSupported,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function normalizeIntegrationAvailabilityState(input, fallback) {
|
|
314
|
+
if (input !== undefined && integrationAvailabilityStateSet.has(input)) {
|
|
315
|
+
return input;
|
|
316
|
+
}
|
|
317
|
+
return fallback;
|
|
318
|
+
}
|
|
319
|
+
function normalizePresentationMode(input) {
|
|
320
|
+
if (input !== undefined && presentationModeSet.has(input)) {
|
|
321
|
+
return input;
|
|
322
|
+
}
|
|
323
|
+
return defaultTargetIntegrationConfig.presentationMode;
|
|
324
|
+
}
|
package/dist/viewport.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TargetConfig, TargetRuntimeKind } from './runtime';
|
|
1
|
+
import type { TargetConfig, TargetRuntimeKind } from './runtime.js';
|
|
2
2
|
export type TargetViewportOrientation = 'portrait' | 'landscape';
|
|
3
3
|
export type TargetViewportOrientationPolicyMode = 'responsive' | 'prefer-landscape' | 'prefer-portrait' | 'lock-landscape' | 'lock-portrait';
|
|
4
4
|
export type TargetViewportOrientationMismatchBehavior = 'continue' | 'letterbox' | 'show-rotate-prompt';
|
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,
|
|
@@ -25,6 +28,14 @@
|
|
|
25
28
|
"release": {
|
|
26
29
|
"profile": "web-preview"
|
|
27
30
|
},
|
|
31
|
+
"integrations": {
|
|
32
|
+
"identityUpgrade": "disabled",
|
|
33
|
+
"presentation": "available",
|
|
34
|
+
"sharing": "available",
|
|
35
|
+
"inboundShare": "available",
|
|
36
|
+
"notifications": "unsupported",
|
|
37
|
+
"presentationMode": "fullscreen"
|
|
38
|
+
},
|
|
28
39
|
"policy": {
|
|
29
40
|
"externalPaymentAllowed": false,
|
|
30
41
|
"remoteExecutableCodeAllowed": false,
|
|
@@ -46,6 +57,9 @@
|
|
|
46
57
|
"storage": "local",
|
|
47
58
|
"localization": true
|
|
48
59
|
},
|
|
60
|
+
"localization": {
|
|
61
|
+
"fallbackLocale": "en"
|
|
62
|
+
},
|
|
49
63
|
"monetization": {
|
|
50
64
|
"iap": false,
|
|
51
65
|
"rewardedAds": false,
|
|
@@ -57,6 +71,14 @@
|
|
|
57
71
|
"release": {
|
|
58
72
|
"profile": "microsoft-store"
|
|
59
73
|
},
|
|
74
|
+
"integrations": {
|
|
75
|
+
"identityUpgrade": "disabled",
|
|
76
|
+
"presentation": "available",
|
|
77
|
+
"sharing": "available",
|
|
78
|
+
"inboundShare": "available",
|
|
79
|
+
"notifications": "unsupported",
|
|
80
|
+
"presentationMode": "fullscreen"
|
|
81
|
+
},
|
|
60
82
|
"policy": {
|
|
61
83
|
"externalPaymentAllowed": false,
|
|
62
84
|
"remoteExecutableCodeAllowed": false,
|
|
@@ -78,6 +100,9 @@
|
|
|
78
100
|
"storage": "native",
|
|
79
101
|
"localization": true
|
|
80
102
|
},
|
|
103
|
+
"localization": {
|
|
104
|
+
"fallbackLocale": "en"
|
|
105
|
+
},
|
|
81
106
|
"monetization": {
|
|
82
107
|
"iap": true,
|
|
83
108
|
"rewardedAds": true,
|
|
@@ -89,6 +114,14 @@
|
|
|
89
114
|
"release": {
|
|
90
115
|
"profile": "google-play"
|
|
91
116
|
},
|
|
117
|
+
"integrations": {
|
|
118
|
+
"identityUpgrade": "configuration-required",
|
|
119
|
+
"presentation": "available",
|
|
120
|
+
"sharing": "configuration-required",
|
|
121
|
+
"inboundShare": "configuration-required",
|
|
122
|
+
"notifications": "configuration-required",
|
|
123
|
+
"presentationMode": "fullscreen"
|
|
124
|
+
},
|
|
92
125
|
"policy": {
|
|
93
126
|
"externalPaymentAllowed": false,
|
|
94
127
|
"remoteExecutableCodeAllowed": false,
|
|
@@ -110,6 +143,9 @@
|
|
|
110
143
|
"storage": "native",
|
|
111
144
|
"localization": true
|
|
112
145
|
},
|
|
146
|
+
"localization": {
|
|
147
|
+
"fallbackLocale": "en"
|
|
148
|
+
},
|
|
113
149
|
"monetization": {
|
|
114
150
|
"iap": true,
|
|
115
151
|
"rewardedAds": true,
|
|
@@ -121,6 +157,14 @@
|
|
|
121
157
|
"release": {
|
|
122
158
|
"profile": "app-store"
|
|
123
159
|
},
|
|
160
|
+
"integrations": {
|
|
161
|
+
"identityUpgrade": "configuration-required",
|
|
162
|
+
"presentation": "available",
|
|
163
|
+
"sharing": "configuration-required",
|
|
164
|
+
"inboundShare": "configuration-required",
|
|
165
|
+
"notifications": "configuration-required",
|
|
166
|
+
"presentationMode": "fullscreen"
|
|
167
|
+
},
|
|
124
168
|
"policy": {
|
|
125
169
|
"externalPaymentAllowed": false,
|
|
126
170
|
"remoteExecutableCodeAllowed": false,
|
|
@@ -142,6 +186,9 @@
|
|
|
142
186
|
"storage": "none",
|
|
143
187
|
"localization": true
|
|
144
188
|
},
|
|
189
|
+
"localization": {
|
|
190
|
+
"fallbackLocale": "ko"
|
|
191
|
+
},
|
|
145
192
|
"monetization": {
|
|
146
193
|
"iap": true,
|
|
147
194
|
"rewardedAds": true,
|
|
@@ -153,6 +200,14 @@
|
|
|
153
200
|
"release": {
|
|
154
201
|
"profile": "apps-in-toss"
|
|
155
202
|
},
|
|
203
|
+
"integrations": {
|
|
204
|
+
"identityUpgrade": "configuration-required",
|
|
205
|
+
"presentation": "available",
|
|
206
|
+
"sharing": "available",
|
|
207
|
+
"inboundShare": "available",
|
|
208
|
+
"notifications": "configuration-required",
|
|
209
|
+
"presentationMode": "fullscreen"
|
|
210
|
+
},
|
|
156
211
|
"policy": {
|
|
157
212
|
"externalPaymentAllowed": false,
|
|
158
213
|
"remoteExecutableCodeAllowed": false,
|
|
@@ -174,6 +229,9 @@
|
|
|
174
229
|
"storage": "native",
|
|
175
230
|
"localization": true
|
|
176
231
|
},
|
|
232
|
+
"localization": {
|
|
233
|
+
"fallbackLocale": "en"
|
|
234
|
+
},
|
|
177
235
|
"monetization": {
|
|
178
236
|
"iap": false,
|
|
179
237
|
"rewardedAds": false,
|
|
@@ -185,6 +243,14 @@
|
|
|
185
243
|
"release": {
|
|
186
244
|
"profile": "devvit"
|
|
187
245
|
},
|
|
246
|
+
"integrations": {
|
|
247
|
+
"identityUpgrade": "configuration-required",
|
|
248
|
+
"presentation": "configuration-required",
|
|
249
|
+
"sharing": "configuration-required",
|
|
250
|
+
"inboundShare": "configuration-required",
|
|
251
|
+
"notifications": "approval-required",
|
|
252
|
+
"presentationMode": "inline-expanded"
|
|
253
|
+
},
|
|
188
254
|
"policy": {
|
|
189
255
|
"externalPaymentAllowed": false,
|
|
190
256
|
"remoteExecutableCodeAllowed": false,
|