@mpgd/target-config 0.6.1 → 0.8.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.js CHANGED
@@ -89,7 +89,7 @@ export function getEffectiveAdPlacementConfig(config, placementId) {
89
89
  }
90
90
  function createEffectiveProductConfig(target, config, product) {
91
91
  const platformProductId = productPlatformId(product, target);
92
- const reason = effectiveItemReason(config.features.iap, platformProductId);
92
+ const reason = effectiveProductReason(target, config.features.iap, product, platformProductId);
93
93
  return {
94
94
  id: product.id,
95
95
  type: product.type,
@@ -99,6 +99,15 @@ function createEffectiveProductConfig(target, config, product) {
99
99
  ...(platformProductId === undefined ? {} : { platformProductId }),
100
100
  };
101
101
  }
102
+ function effectiveProductReason(target, targetEnabled, product, platformProductId) {
103
+ if (!targetEnabled) {
104
+ return 'target-disabled';
105
+ }
106
+ if (target === 'verse8' && product.grant.type === 'resource') {
107
+ return 'capability-unsupported';
108
+ }
109
+ return effectiveItemReason(targetEnabled, platformProductId);
110
+ }
102
111
  function createEffectiveAdPlacementConfig(target, config, placement) {
103
112
  const featureEnabled = isRewardedPlacement(placement)
104
113
  ? config.features.rewardedAds
@@ -125,13 +134,13 @@ function effectiveTargetConfigVersion(input) {
125
134
  return `${input.targetConfig}+catalog.${input.productCatalog}+ads.${input.adPlacements}`;
126
135
  }
127
136
  function productPlatformId(product, target) {
128
- if (!isStoreBackedTarget(target)) {
137
+ if (!isProductStoreTarget(target)) {
129
138
  return undefined;
130
139
  }
131
140
  return normalizePlatformId(product.platformProductIds[target]);
132
141
  }
133
142
  function adPlacementPlatformId(placement, target) {
134
- if (!isStoreBackedTarget(target)) {
143
+ if (!isAdStoreTarget(target)) {
135
144
  return undefined;
136
145
  }
137
146
  return normalizePlatformId(placement.platformPlacementIds[target]);
@@ -143,8 +152,15 @@ function normalizePlatformId(platformId) {
143
152
  const trimmed = platformId.trim();
144
153
  return trimmed.length === 0 ? undefined : trimmed;
145
154
  }
146
- function isStoreBackedTarget(target) {
147
- return target === 'android' || target === 'ios' || target === 'ait';
155
+ function isProductStoreTarget(target) {
156
+ return target === 'android'
157
+ || target === 'ios'
158
+ || target === 'ait'
159
+ || target === 'reddit'
160
+ || target === 'verse8';
161
+ }
162
+ function isAdStoreTarget(target) {
163
+ return target === 'android' || target === 'ios' || target === 'ait' || target === 'verse8';
148
164
  }
149
165
  function isRewardedPlacement(placement) {
150
166
  return placement.type === 'rewarded';
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
53
53
  expected: "string",
54
54
  value: input["id"]
55
55
  }, _errorFactory);
56
- const _ae0 = "({ readonly type: \"currency\"; readonly currency: \"coin\" | \"gem\"; readonly amount: number; } | { readonly type: \"entitlement\"; readonly entitlement: string; })";
56
+ const _ae0 = "({ readonly type: \"currency\"; readonly currency: \"coin\" | \"gem\"; readonly amount: number; } | { readonly type: \"entitlement\"; readonly entitlement: string; } | { readonly type: \"resource\"; readonly resource: string & MinLength<1>; readonly amount: number & ExclusiveMinimum<0> & Maximum<1.7976931348623157e+308>; })";
57
57
  const _ap6 = (input, _path, _exceptionable = true) => "boolean" === typeof input["enabled"] || _assertGuard_1._assertGuard(_exceptionable, {
58
58
  method: "typia.createAssert",
59
59
  path: _path + ".enabled",
@@ -146,7 +146,38 @@ export const assertEffectiveTargetConfigMatrix = (() => {
146
146
  expected: "string",
147
147
  value: input.entitlement
148
148
  }, _errorFactory));
149
- const _ao13 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ((Array.isArray(input.placements) || _assertGuard_1._assertGuard(_exceptionable, {
149
+ const _ao13 = (input, _path, _exceptionable = true) => ("resource" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
150
+ method: "typia.createAssert",
151
+ path: _path + ".type",
152
+ expected: "\"resource\"",
153
+ value: input.type
154
+ }, _errorFactory)) && ("string" === typeof input.resource && (1 <= input.resource.length || _assertGuard_1._assertGuard(_exceptionable, {
155
+ method: "typia.createAssert",
156
+ path: _path + ".resource",
157
+ expected: "string & MinLength<1>",
158
+ value: input.resource
159
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
160
+ method: "typia.createAssert",
161
+ path: _path + ".resource",
162
+ expected: "(string & MinLength<1>)",
163
+ value: input.resource
164
+ }, _errorFactory)) && ("number" === typeof input.amount && (0 < input.amount || _assertGuard_1._assertGuard(_exceptionable, {
165
+ method: "typia.createAssert",
166
+ path: _path + ".amount",
167
+ expected: "number & ExclusiveMinimum<0>",
168
+ value: input.amount
169
+ }, _errorFactory)) && (input.amount <= 1.7976931348623157e+308 || _assertGuard_1._assertGuard(_exceptionable, {
170
+ method: "typia.createAssert",
171
+ path: _path + ".amount",
172
+ expected: "number & Maximum<1.7976931348623157e+308>",
173
+ value: input.amount
174
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
175
+ method: "typia.createAssert",
176
+ path: _path + ".amount",
177
+ expected: "(number & ExclusiveMinimum<0> & Maximum<1.7976931348623157e+308>)",
178
+ value: input.amount
179
+ }, _errorFactory));
180
+ const _ao14 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ((Array.isArray(input.placements) || _assertGuard_1._assertGuard(_exceptionable, {
150
181
  method: "typia.createAssert",
151
182
  path: _path + ".placements",
152
183
  expected: "ReadonlyArray<EffectiveAdPlacementConfig>",
@@ -156,7 +187,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
156
187
  path: _path + ".placements[" + _index4 + "]",
157
188
  expected: "EffectiveAdPlacementConfig",
158
189
  value: elem
159
- }, _errorFactory)) && _ao14(elem, _path + ".placements[" + _index4 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
190
+ }, _errorFactory)) && _ao15(elem, _path + ".placements[" + _index4 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
160
191
  method: "typia.createAssert",
161
192
  path: _path + ".placements[" + _index4 + "]",
162
193
  expected: "EffectiveAdPlacementConfig",
@@ -167,7 +198,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
167
198
  expected: "ReadonlyArray<EffectiveAdPlacementConfig>",
168
199
  value: input.placements
169
200
  }, _errorFactory));
170
- const _ao14 = (input, _path, _exceptionable = true) => _ap5(input, _path, true && _exceptionable) && ("interstitial" === input.type || "rewarded" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
201
+ const _ao15 = (input, _path, _exceptionable = true) => _ap5(input, _path, true && _exceptionable) && ("interstitial" === input.type || "rewarded" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
171
202
  method: "typia.createAssert",
172
203
  path: _path + ".type",
173
204
  expected: "(\"interstitial\" | \"rewarded\")",
@@ -187,7 +218,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
187
218
  path: _path + ".frequencyCap",
188
219
  expected: "FrequencyCap",
189
220
  value: input.frequencyCap
190
- }, _errorFactory)) && _ao17(input.frequencyCap, _path + ".frequencyCap", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
221
+ }, _errorFactory)) && _ao18(input.frequencyCap, _path + ".frequencyCap", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
191
222
  method: "typia.createAssert",
192
223
  path: _path + ".frequencyCap",
193
224
  expected: "FrequencyCap",
@@ -198,14 +229,14 @@ export const assertEffectiveTargetConfigMatrix = (() => {
198
229
  expected: "(string | undefined)",
199
230
  value: input.platformPlacementId
200
231
  }, _errorFactory));
201
- const _ao15 = (input, _path, _exceptionable = true) => ("continue" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
232
+ const _ao16 = (input, _path, _exceptionable = true) => ("continue" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
202
233
  method: "typia.createAssert",
203
234
  path: _path + ".type",
204
235
  expected: "\"continue\"",
205
236
  value: input.type
206
237
  }, _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 || _assertGuard_1._assertGuard(_exceptionable, {
238
+ const _ao17 = (input, _path, _exceptionable = true) => _ap8(input, _path, true && _exceptionable) && _ap10(input, _path, true && _exceptionable) && _ap9(input, _path, true && _exceptionable);
239
+ const _ao18 = (input, _path, _exceptionable = true) => ("number" === typeof input.cooldownSeconds || _assertGuard_1._assertGuard(_exceptionable, {
209
240
  method: "typia.createAssert",
210
241
  path: _path + ".cooldownSeconds",
211
242
  expected: "number",
@@ -221,7 +252,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
221
252
  expected: "(number | undefined)",
222
253
  value: input.minStageInterval
223
254
  }, _errorFactory));
224
- const _ao18 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.native || _assertGuard_1._assertGuard(_exceptionable, {
255
+ const _ao19 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.native || _assertGuard_1._assertGuard(_exceptionable, {
225
256
  method: "typia.createAssert",
226
257
  path: _path + ".native",
227
258
  expected: "boolean",
@@ -237,21 +268,15 @@ export const assertEffectiveTargetConfigMatrix = (() => {
237
268
  expected: "(string | undefined)",
238
269
  value: input.defaultLeaderboardId
239
270
  }, _errorFactory));
240
- const _ao19 = (input, _path, _exceptionable = true) => ("local" === input.support || "native" === input.support || "none" === input.support || _assertGuard_1._assertGuard(_exceptionable, {
241
- method: "typia.createAssert",
242
- path: _path + ".support",
243
- expected: "(\"local\" | \"native\" | \"none\")",
244
- value: input.support
245
- }, _errorFactory)) && _ap6(input, _path, true && _exceptionable);
246
271
  const _ao2 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && ("string" === typeof input.target || _assertGuard_1._assertGuard(_exceptionable, {
247
272
  method: "typia.createAssert",
248
273
  path: _path + ".target",
249
274
  expected: "string",
250
275
  value: input.target
251
- }, _errorFactory)) && ("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 || _assertGuard_1._assertGuard(_exceptionable, {
276
+ }, _errorFactory)) && ("apps-in-toss" === input.runtime || "capacitor-android" === input.runtime || "capacitor-ios" === input.runtime || "devvit-web" === input.runtime || "microsoft-store-pwa" === input.runtime || "verse8-web" === input.runtime || "web-preview" === input.runtime || _assertGuard_1._assertGuard(_exceptionable, {
252
277
  method: "typia.createAssert",
253
278
  path: _path + ".runtime",
254
- expected: "(\"apps-in-toss\" | \"capacitor-android\" | \"capacitor-ios\" | \"devvit-web\" | \"microsoft-store-pwa\" | \"web-preview\")",
279
+ expected: "(\"apps-in-toss\" | \"capacitor-android\" | \"capacitor-ios\" | \"devvit-web\" | \"microsoft-store-pwa\" | \"verse8-web\" | \"web-preview\")",
255
280
  value: input.runtime
256
281
  }, _errorFactory)) && (("object" === typeof input.release && null !== input.release || _assertGuard_1._assertGuard(_exceptionable, {
257
282
  method: "typia.createAssert",
@@ -328,7 +353,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
328
353
  path: _path + ".ads",
329
354
  expected: "EffectiveAdsConfig",
330
355
  value: input.ads
331
- }, _errorFactory)) && _ao13(input.ads, _path + ".ads", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
356
+ }, _errorFactory)) && _ao14(input.ads, _path + ".ads", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
332
357
  method: "typia.createAssert",
333
358
  path: _path + ".ads",
334
359
  expected: "EffectiveAdsConfig",
@@ -338,7 +363,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
338
363
  path: _path + ".leaderboard",
339
364
  expected: "EffectiveLeaderboardConfig",
340
365
  value: input.leaderboard
341
- }, _errorFactory)) && _ao18(input.leaderboard, _path + ".leaderboard", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
366
+ }, _errorFactory)) && _ao19(input.leaderboard, _path + ".leaderboard", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
342
367
  method: "typia.createAssert",
343
368
  path: _path + ".leaderboard",
344
369
  expected: "EffectiveLeaderboardConfig",
@@ -348,7 +373,7 @@ export const assertEffectiveTargetConfigMatrix = (() => {
348
373
  path: _path + ".storage",
349
374
  expected: "EffectiveStorageConfig",
350
375
  value: input.storage
351
- }, _errorFactory)) && _ao19(input.storage, _path + ".storage", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
376
+ }, _errorFactory)) && _ao20(input.storage, _path + ".storage", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
352
377
  method: "typia.createAssert",
353
378
  path: _path + ".storage",
354
379
  expected: "EffectiveStorageConfig",
@@ -358,22 +383,28 @@ export const assertEffectiveTargetConfigMatrix = (() => {
358
383
  path: _path + ".localization",
359
384
  expected: "EffectiveLocalizationConfig",
360
385
  value: input.localization
361
- }, _errorFactory)) && _ao20(input.localization, _path + ".localization", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
386
+ }, _errorFactory)) && _ao21(input.localization, _path + ".localization", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
362
387
  method: "typia.createAssert",
363
388
  path: _path + ".localization",
364
389
  expected: "EffectiveLocalizationConfig",
365
390
  value: input.localization
366
391
  }, _errorFactory));
367
- const _ao20 = (input, _path, _exceptionable = true) => _ap6(input, _path, true && _exceptionable) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale || _assertGuard_1._assertGuard(_exceptionable, {
392
+ const _ao20 = (input, _path, _exceptionable = true) => ("local" === input.support || "native" === input.support || "none" === input.support || _assertGuard_1._assertGuard(_exceptionable, {
393
+ method: "typia.createAssert",
394
+ path: _path + ".support",
395
+ expected: "(\"local\" | \"native\" | \"none\")",
396
+ value: input.support
397
+ }, _errorFactory)) && _ap6(input, _path, true && _exceptionable);
398
+ const _ao21 = (input, _path, _exceptionable = true) => _ap6(input, _path, true && _exceptionable) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale || _assertGuard_1._assertGuard(_exceptionable, {
368
399
  method: "typia.createAssert",
369
400
  path: _path + ".fallbackLocale",
370
401
  expected: "(\"en\" | \"ko\")",
371
402
  value: input.fallbackLocale
372
403
  }, _errorFactory));
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 || _assertGuard_1._assertGuard(_exceptionable, {
404
+ 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 || "verse8" === input.profile || "web-preview" === input.profile || _assertGuard_1._assertGuard(_exceptionable, {
374
405
  method: "typia.createAssert",
375
406
  path: _path + ".profile",
376
- expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"web-preview\")",
407
+ expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"verse8\" | \"web-preview\")",
377
408
  value: input.profile
378
409
  }, _errorFactory);
379
410
  const _ao4 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ("boolean" === typeof input.leaderboard || _assertGuard_1._assertGuard(_exceptionable, {
@@ -497,6 +528,8 @@ export const assertEffectiveTargetConfigMatrix = (() => {
497
528
  return _ao11(input, _path, true && _exceptionable);
498
529
  else if ("entitlement" === input.type)
499
530
  return _ao12(input, _path, true && _exceptionable);
531
+ else if ("resource" === input.type)
532
+ return _ao13(input, _path, true && _exceptionable);
500
533
  else
501
534
  return _assertGuard_1._assertGuard(_exceptionable, {
502
535
  method: "typia.createAssert",
@@ -507,9 +540,9 @@ export const assertEffectiveTargetConfigMatrix = (() => {
507
540
  })();
508
541
  const _au1 = (input, _path, _exceptionable = true) => (() => {
509
542
  if ("continue" === input.type)
510
- return _ao15(input, _path, true && _exceptionable);
511
- else if ("currency" === input.type)
512
543
  return _ao16(input, _path, true && _exceptionable);
544
+ else if ("currency" === input.type)
545
+ return _ao17(input, _path, true && _exceptionable);
513
546
  else
514
547
  return _assertGuard_1._assertGuard(_exceptionable, {
515
548
  method: "typia.createAssert",
@@ -528,16 +561,17 @@ export const assertEffectiveTargetConfigMatrix = (() => {
528
561
  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
562
  const _io11 = input => _ip8(input) && _ip9(input) && _ip10(input);
530
563
  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);
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;
564
+ const _io13 = input => "resource" === input.type && ("string" === typeof input.resource && 1 <= input.resource.length) && ("number" === typeof input.amount && (0 < input.amount && input.amount <= 1.7976931348623157e+308));
565
+ const _io14 = input => _ip2(input) && _ip3(input) && (Array.isArray(input.placements) && input.placements.every(elem => "object" === typeof elem && null !== elem && _io15(elem)));
566
+ const _io15 = 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 && _io18(input.frequencyCap)) && _ip6(input) && _ip7(input) && (undefined === input.platformPlacementId || "string" === typeof input.platformPlacementId);
567
+ const _io16 = input => "continue" === input.type && _ip10(input);
568
+ const _io17 = input => _ip8(input) && _ip10(input) && _ip9(input);
569
+ const _io18 = input => "number" === typeof input.cooldownSeconds && (undefined === input.maxPerSession || "number" === typeof input.maxPerSession) && (undefined === input.minStageInterval || "number" === typeof input.minStageInterval);
570
+ const _io19 = 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);
571
+ 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 || "verse8-web" === 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 && _io14(input.ads)) && ("object" === typeof input.leaderboard && null !== input.leaderboard && _io19(input.leaderboard)) && ("object" === typeof input.storage && null !== input.storage && _io20(input.storage)) && ("object" === typeof input.localization && null !== input.localization && _io21(input.localization));
572
+ const _io20 = input => ("local" === input.support || "native" === input.support || "none" === input.support) && _ip6(input);
573
+ const _io21 = input => _ip6(input) && ("en" === input.fallbackLocale || "ko" === input.fallbackLocale);
574
+ const _io3 = input => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "verse8" === input.profile || "web-preview" === input.profile;
541
575
  const _io4 = input => _ip1(input) && _ip2(input) && _ip3(input) && "boolean" === typeof input.leaderboard && _ip4(input);
542
576
  const _io5 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip4(input);
543
577
  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);
@@ -549,14 +583,16 @@ export const assertEffectiveTargetConfigMatrix = (() => {
549
583
  return _io11(input);
550
584
  else if ("entitlement" === input.type)
551
585
  return _io12(input);
586
+ else if ("resource" === input.type)
587
+ return _io13(input);
552
588
  else
553
589
  return false;
554
590
  })();
555
591
  const _iu1 = input => (() => {
556
592
  if ("continue" === input.type)
557
- return _io15(input);
558
- else if ("currency" === input.type)
559
593
  return _io16(input);
594
+ else if ("currency" === input.type)
595
+ return _io17(input);
560
596
  else
561
597
  return false;
562
598
  })();
@@ -672,10 +708,10 @@ export const assertTargetConfigMatrix = (() => {
672
708
  expected: "(\"fullscreen\" | \"inline-expanded\")",
673
709
  value: input.presentationMode
674
710
  }, _errorFactory));
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 || _assertGuard_1._assertGuard(_exceptionable, {
711
+ 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 || "verse8-web" === input.runtime || "web-preview" === input.runtime || _assertGuard_1._assertGuard(_exceptionable, {
676
712
  method: "typia.createAssert",
677
713
  path: _path + ".runtime",
678
- expected: "(\"apps-in-toss\" | \"capacitor-android\" | \"capacitor-ios\" | \"devvit-web\" | \"microsoft-store-pwa\" | \"web-preview\")",
714
+ expected: "(\"apps-in-toss\" | \"capacitor-android\" | \"capacitor-ios\" | \"devvit-web\" | \"microsoft-store-pwa\" | \"verse8-web\" | \"web-preview\")",
679
715
  value: input.runtime
680
716
  }, _errorFactory)) && (("object" === typeof input.features && null !== input.features || _assertGuard_1._assertGuard(_exceptionable, {
681
717
  method: "typia.createAssert",
@@ -783,10 +819,10 @@ export const assertTargetConfigMatrix = (() => {
783
819
  expected: "boolean",
784
820
  value: input.native
785
821
  }, _errorFactory);
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 || _assertGuard_1._assertGuard(_exceptionable, {
822
+ 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 || "verse8" === input.profile || "web-preview" === input.profile || _assertGuard_1._assertGuard(_exceptionable, {
787
823
  method: "typia.createAssert",
788
824
  path: _path + ".profile",
789
- expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"web-preview\")",
825
+ expected: "(\"app-store\" | \"apps-in-toss\" | \"devvit\" | \"google-play\" | \"microsoft-store\" | \"verse8\" | \"web-preview\")",
790
826
  value: input.profile
791
827
  }, _errorFactory);
792
828
  const _ao9 = (input, _path, _exceptionable = true) => ("boolean" === typeof input.externalPaymentAllowed || _assertGuard_1._assertGuard(_exceptionable, {
@@ -823,13 +859,13 @@ export const assertTargetConfigMatrix = (() => {
823
859
  return "object" === typeof value && null !== value && _io2(value);
824
860
  });
825
861
  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));
862
+ 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 || "verse8-web" === 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));
827
863
  const _io3 = input => _ip0(input) && _ip1(input) && _ip2(input) && "boolean" === typeof input.leaderboard && _ip3(input);
828
864
  const _io4 = input => ("local" === input.storage || "native" === input.storage || "none" === input.storage) && _ip3(input);
829
865
  const _io5 = input => "en" === input.fallbackLocale || "ko" === input.fallbackLocale;
830
866
  const _io6 = input => _ip0(input) && _ip1(input) && _ip2(input);
831
867
  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;
868
+ const _io8 = input => "app-store" === input.profile || "apps-in-toss" === input.profile || "devvit" === input.profile || "google-play" === input.profile || "microsoft-store" === input.profile || "verse8" === input.profile || "web-preview" === input.profile;
833
869
  const _io9 = input => "boolean" === typeof input.externalPaymentAllowed && "boolean" === typeof input.remoteExecutableCodeAllowed && "boolean" === typeof input.installOtherAppCTAAllowed && "boolean" === typeof input.requiresStoreReview && "boolean" === typeof input.requiresAitReview;
834
870
  const __is = input => "object" === typeof input && null !== input && _io0(input);
835
871
  let _errorFactory;
package/dist/runtime.d.ts CHANGED
@@ -4,8 +4,8 @@ import type { EffectiveTargetConfig } from './effective.js';
4
4
  export type PlatformFeature = 'iap' | 'rewardedAds' | 'interstitialAds' | 'leaderboard' | 'localization';
5
5
  export type AdPlacementType = 'rewarded' | 'interstitial';
6
6
  type PlatformConfigTarget = PlatformGateway['target'];
7
- export type TargetRuntimeKind = 'web-preview' | 'microsoft-store-pwa' | 'capacitor-android' | 'capacitor-ios' | 'apps-in-toss' | 'devvit-web';
8
- export type ReleaseProfile = 'web-preview' | 'microsoft-store' | 'google-play' | 'app-store' | 'apps-in-toss' | 'devvit';
7
+ export type TargetRuntimeKind = 'web-preview' | 'microsoft-store-pwa' | 'capacitor-android' | 'capacitor-ios' | 'apps-in-toss' | 'devvit-web' | 'verse8-web';
8
+ export type ReleaseProfile = 'web-preview' | 'microsoft-store' | 'google-play' | 'app-store' | 'apps-in-toss' | 'devvit' | 'verse8';
9
9
  export type StorageSupport = 'local' | 'native' | 'none';
10
10
  export type TargetIntegration = 'identityUpgrade' | 'presentation' | 'sharing' | 'inboundShare' | 'notifications';
11
11
  export type IntegrationAvailabilityState = 'available' | 'disabled' | 'approval-required' | 'configuration-required' | 'unsupported';
package/dist/runtime.js CHANGED
@@ -130,6 +130,7 @@ export function createTargetRuntimeSnapshot(input) {
130
130
  };
131
131
  }
132
132
  export function withTargetAvailability(gateway, config, options = {}) {
133
+ const getGatewayCapabilities = () => (gateway.getCapabilities());
133
134
  const configTarget = options.configTarget ?? targetConfigKeyForPlatform(gateway.target);
134
135
  const { identity: gatewayIdentity, presentation: gatewayPresentation, sharing: gatewaySharing, notifications: gatewayNotifications, ...gatewayWithoutIntegrations } = gateway;
135
136
  const integrations = normalizeTargetIntegrationConfig(options.effectiveConfig?.integrations ?? config.integrations);
@@ -161,6 +162,7 @@ export function withTargetAvailability(gateway, config, options = {}) {
161
162
  ...(exposeInboundShare ? { readInboundShare } : {}),
162
163
  };
163
164
  const notifications = notificationsAvailable ? gatewayNotifications : undefined;
165
+ const isIapAvailable = async () => (config.features.iap && (await getGatewayCapabilities()).nativeIap);
164
166
  const isAdPlacementAllowed = (placementId, expectedType) => {
165
167
  const actualType = options.resolveAdPlacementType?.(placementId);
166
168
  if (actualType !== undefined && actualType !== expectedType) {
@@ -199,35 +201,39 @@ export function withTargetAvailability(gateway, config, options = {}) {
199
201
  ...(options.effectiveConfig === undefined
200
202
  ? {}
201
203
  : { effectiveConfig: options.effectiveConfig }),
202
- capabilities: applyTargetConfigToCapabilities(await gateway.getCapabilities(), config),
204
+ capabilities: applyTargetConfigToCapabilities(await getGatewayCapabilities(), config),
203
205
  adPlacements: options.adPlacements ?? [],
204
206
  gateway,
205
207
  });
206
208
  },
207
209
  async getCapabilities() {
208
- return applyTargetConfigToCapabilities(await gateway.getCapabilities(), config);
210
+ return applyTargetConfigToCapabilities(await getGatewayCapabilities(), config);
209
211
  },
210
- commerce: config.features.iap
211
- ? gateway.commerce
212
- : {
213
- async getProducts() {
214
- return [];
215
- },
216
- async purchase() {
212
+ commerce: {
213
+ async getProducts() {
214
+ return await isIapAvailable() ? gateway.commerce.getProducts() : [];
215
+ },
216
+ async purchase(input) {
217
+ if (!await isIapAvailable()) {
217
218
  return {
218
219
  status: 'cancelled',
219
220
  entitlementIds: [],
220
221
  };
221
- },
222
- async restore() {
222
+ }
223
+ return gateway.commerce.purchase(input);
224
+ },
225
+ async restore() {
226
+ if (!await isIapAvailable() || gateway.commerce.restore === undefined) {
223
227
  return {
224
228
  restoredEntitlements: [],
225
229
  };
226
- },
227
- async getEntitlements() {
228
- return [];
229
- },
230
+ }
231
+ return gateway.commerce.restore();
230
232
  },
233
+ async getEntitlements() {
234
+ return await isIapAvailable() ? gateway.commerce.getEntitlements() : [];
235
+ },
236
+ },
231
237
  ads: {
232
238
  async preload(input) {
233
239
  if (canPreloadAdPlacement(input.placementId)) {
package/dist/viewport.js CHANGED
@@ -40,6 +40,7 @@ export function targetViewportShellForRuntime(runtime) {
40
40
  case 'apps-in-toss':
41
41
  return 'mobile-webview';
42
42
  case 'devvit-web':
43
+ case 'verse8-web':
43
44
  return 'embedded-webview';
44
45
  case 'web-preview':
45
46
  case 'microsoft-store-pwa':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/target-config",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Target-specific platform feature availability and effective config helpers for mpgd.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,9 +37,9 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "typia": "13.0.2",
40
- "@mpgd/catalog": "0.3.5",
41
- "@mpgd/i18n": "0.5.1",
42
- "@mpgd/platform": "0.5.1"
40
+ "@mpgd/catalog": "0.5.0",
41
+ "@mpgd/i18n": "0.5.3",
42
+ "@mpgd/platform": "0.7.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "ttsc": "0.18.4",
package/targets.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-07-12",
2
+ "version": "2026-07-16.2",
3
3
  "targets": {
4
4
  "web-preview": {
5
5
  "runtime": "web-preview",
@@ -87,6 +87,49 @@
87
87
  "requiresAitReview": false
88
88
  }
89
89
  },
90
+ "verse8": {
91
+ "runtime": "verse8-web",
92
+ "features": {
93
+ "iap": true,
94
+ "rewardedAds": true,
95
+ "interstitialAds": true,
96
+ "leaderboard": false,
97
+ "localization": true
98
+ },
99
+ "capabilities": {
100
+ "storage": "local",
101
+ "localization": true
102
+ },
103
+ "localization": {
104
+ "fallbackLocale": "en"
105
+ },
106
+ "monetization": {
107
+ "iap": true,
108
+ "rewardedAds": true,
109
+ "interstitialAds": true
110
+ },
111
+ "leaderboard": {
112
+ "native": false
113
+ },
114
+ "release": {
115
+ "profile": "verse8"
116
+ },
117
+ "integrations": {
118
+ "identityUpgrade": "unsupported",
119
+ "presentation": "available",
120
+ "sharing": "unsupported",
121
+ "inboundShare": "unsupported",
122
+ "notifications": "unsupported",
123
+ "presentationMode": "fullscreen"
124
+ },
125
+ "policy": {
126
+ "externalPaymentAllowed": false,
127
+ "remoteExecutableCodeAllowed": false,
128
+ "installOtherAppCTAAllowed": false,
129
+ "requiresStoreReview": false,
130
+ "requiresAitReview": false
131
+ }
132
+ },
90
133
  "android": {
91
134
  "runtime": "capacitor-android",
92
135
  "features": {
@@ -219,10 +262,10 @@
219
262
  "reddit": {
220
263
  "runtime": "devvit-web",
221
264
  "features": {
222
- "iap": false,
265
+ "iap": true,
223
266
  "rewardedAds": false,
224
267
  "interstitialAds": false,
225
- "leaderboard": true,
268
+ "leaderboard": false,
226
269
  "localization": true
227
270
  },
228
271
  "capabilities": {
@@ -233,12 +276,12 @@
233
276
  "fallbackLocale": "en"
234
277
  },
235
278
  "monetization": {
236
- "iap": false,
279
+ "iap": true,
237
280
  "rewardedAds": false,
238
281
  "interstitialAds": false
239
282
  },
240
283
  "leaderboard": {
241
- "native": true
284
+ "native": false
242
285
  },
243
286
  "release": {
244
287
  "profile": "devvit"