@mpgd/catalog 0.5.2 → 0.7.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/catalog.json +3 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.js +88 -47
- package/package.json +2 -2
package/catalog.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2026-
|
|
2
|
+
"version": "2026-08-11",
|
|
3
3
|
"products": [
|
|
4
4
|
{
|
|
5
5
|
"id": "COINS_100",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"android": "coins_100",
|
|
14
14
|
"ios": "com.mpgd.game.coins100",
|
|
15
15
|
"ait": "coins_100",
|
|
16
|
+
"microsoft-store": "coins_100",
|
|
16
17
|
"verse8": "coins-100"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"android": "coins_500",
|
|
29
30
|
"ios": "com.mpgd.game.coins500",
|
|
30
31
|
"ait": "coins_500",
|
|
32
|
+
"microsoft-store": "coins_500",
|
|
31
33
|
"verse8": "coins-500"
|
|
32
34
|
}
|
|
33
35
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -39,13 +39,19 @@ export type AdReward = {
|
|
|
39
39
|
readonly amount: number;
|
|
40
40
|
readonly currency: 'coin' | 'gem';
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
interface AdPlacementEntryBase {
|
|
43
43
|
readonly id: LogicalAdPlacementId;
|
|
44
|
-
readonly type: 'rewarded' | 'interstitial';
|
|
45
|
-
readonly reward?: AdReward;
|
|
46
44
|
readonly frequencyCap: FrequencyCap;
|
|
47
45
|
readonly platformPlacementIds: Partial<Record<AdPlacementTarget, string>>;
|
|
48
46
|
}
|
|
47
|
+
export type AdPlacementEntry = (AdPlacementEntryBase & {
|
|
48
|
+
readonly type: 'rewarded';
|
|
49
|
+
readonly reward?: AdReward;
|
|
50
|
+
}) | (AdPlacementEntryBase & {
|
|
51
|
+
readonly type: 'interstitial' | 'banner';
|
|
52
|
+
/** Non-rewarding placements must never describe a game grant. */
|
|
53
|
+
readonly reward?: never;
|
|
54
|
+
});
|
|
49
55
|
export interface AdPlacements {
|
|
50
56
|
readonly version: string;
|
|
51
57
|
readonly placements: readonly AdPlacementEntry[];
|
|
@@ -55,3 +61,4 @@ export declare function assertProductCatalog(input: unknown): ProductCatalog;
|
|
|
55
61
|
export declare function assertAdPlacements(input: unknown): AdPlacements;
|
|
56
62
|
export declare function resolveProductPlatformId(product: ProductCatalogEntry, target: CatalogTarget): string | undefined;
|
|
57
63
|
export declare function resolveAdPlacementPlatformId(placement: AdPlacementEntry, target: AdPlacementTarget): string | undefined;
|
|
64
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -188,14 +188,15 @@ const assertProductCatalogShape = (() => {
|
|
|
188
188
|
})();
|
|
189
189
|
const assertAdPlacementsShape = (() => {
|
|
190
190
|
const _ip0 = input => "number" === typeof input["amount"];
|
|
191
|
-
const _ae0 = "(
|
|
191
|
+
const _ae0 = "(AdPlacementEntryBase & { readonly type: \"banner\" | \"interstitial\"; readonly reward?: never; } | AdPlacementEntryBase & { readonly type: \"rewarded\"; readonly reward?: AdReward; })";
|
|
192
|
+
const _ae1 = "(undefined | { readonly type: \"continue\"; readonly amount: number; } | { readonly type: \"currency\"; readonly amount: number; readonly currency: \"coin\" | \"gem\"; })";
|
|
192
193
|
const _ap0 = (input, _path, _exceptionable = true) => "number" === typeof input["amount"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
193
194
|
method: "typia.createAssert",
|
|
194
195
|
path: _path + ".amount",
|
|
195
196
|
expected: "number",
|
|
196
197
|
value: input["amount"]
|
|
197
198
|
}, _errorFactory);
|
|
198
|
-
const
|
|
199
|
+
const _ae2 = "({ readonly type: \"continue\"; readonly amount: number; } | { readonly type: \"currency\"; readonly amount: number; readonly currency: \"coin\" | \"gem\"; })";
|
|
199
200
|
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || _assertGuard_1._assertGuard(_exceptionable, {
|
|
200
201
|
method: "typia.createAssert",
|
|
201
202
|
path: _path + ".version",
|
|
@@ -209,12 +210,12 @@ const assertAdPlacementsShape = (() => {
|
|
|
209
210
|
}, _errorFactory)) && input.placements.every((elem, _index2) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
210
211
|
method: "typia.createAssert",
|
|
211
212
|
path: _path + ".placements[" + _index2 + "]",
|
|
212
|
-
expected:
|
|
213
|
+
expected: _ae0,
|
|
213
214
|
value: elem
|
|
214
|
-
}, _errorFactory)) &&
|
|
215
|
+
}, _errorFactory)) && _au0(elem, _path + ".placements[" + _index2 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
215
216
|
method: "typia.createAssert",
|
|
216
217
|
path: _path + ".placements[" + _index2 + "]",
|
|
217
|
-
expected:
|
|
218
|
+
expected: _ae0,
|
|
218
219
|
value: elem
|
|
219
220
|
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
220
221
|
method: "typia.createAssert",
|
|
@@ -222,32 +223,33 @@ const assertAdPlacementsShape = (() => {
|
|
|
222
223
|
expected: "ReadonlyArray<AdPlacementEntry>",
|
|
223
224
|
value: input.placements
|
|
224
225
|
}, _errorFactory));
|
|
225
|
-
const _ao1 = (input, _path, _exceptionable = true) => ("
|
|
226
|
-
method: "typia.createAssert",
|
|
227
|
-
path: _path + ".id",
|
|
228
|
-
expected: "string",
|
|
229
|
-
value: input.id
|
|
230
|
-
}, _errorFactory)) && ("interstitial" === input.type || "rewarded" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
226
|
+
const _ao1 = (input, _path, _exceptionable = true) => _ao2(input, _path, true && _exceptionable) && (("rewarded" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
231
227
|
method: "typia.createAssert",
|
|
232
228
|
path: _path + ".type",
|
|
233
|
-
expected: "
|
|
229
|
+
expected: "\"rewarded\"",
|
|
234
230
|
value: input.type
|
|
235
231
|
}, _errorFactory)) && (undefined === input.reward || ("object" === typeof input.reward && null !== input.reward || _assertGuard_1._assertGuard(_exceptionable, {
|
|
236
232
|
method: "typia.createAssert",
|
|
237
233
|
path: _path + ".reward",
|
|
238
|
-
expected:
|
|
234
|
+
expected: _ae1,
|
|
239
235
|
value: input.reward
|
|
240
|
-
}, _errorFactory)) &&
|
|
236
|
+
}, _errorFactory)) && _au1(input.reward, _path + ".reward", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
241
237
|
method: "typia.createAssert",
|
|
242
238
|
path: _path + ".reward",
|
|
243
|
-
expected:
|
|
239
|
+
expected: _ae1,
|
|
244
240
|
value: input.reward
|
|
241
|
+
}, _errorFactory)));
|
|
242
|
+
const _ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
|
|
243
|
+
method: "typia.createAssert",
|
|
244
|
+
path: _path + ".id",
|
|
245
|
+
expected: "string",
|
|
246
|
+
value: input.id
|
|
245
247
|
}, _errorFactory)) && (("object" === typeof input.frequencyCap && null !== input.frequencyCap || _assertGuard_1._assertGuard(_exceptionable, {
|
|
246
248
|
method: "typia.createAssert",
|
|
247
249
|
path: _path + ".frequencyCap",
|
|
248
250
|
expected: "FrequencyCap",
|
|
249
251
|
value: input.frequencyCap
|
|
250
|
-
}, _errorFactory)) &&
|
|
252
|
+
}, _errorFactory)) && _ao3(input.frequencyCap, _path + ".frequencyCap", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
251
253
|
method: "typia.createAssert",
|
|
252
254
|
path: _path + ".frequencyCap",
|
|
253
255
|
expected: "FrequencyCap",
|
|
@@ -257,30 +259,13 @@ const assertAdPlacementsShape = (() => {
|
|
|
257
259
|
path: _path + ".platformPlacementIds",
|
|
258
260
|
expected: "Partial<Record<string, string>>",
|
|
259
261
|
value: input.platformPlacementIds
|
|
260
|
-
}, _errorFactory)) &&
|
|
262
|
+
}, _errorFactory)) && _ao4(input.platformPlacementIds, _path + ".platformPlacementIds", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
261
263
|
method: "typia.createAssert",
|
|
262
264
|
path: _path + ".platformPlacementIds",
|
|
263
265
|
expected: "Partial<Record<string, string>>",
|
|
264
266
|
value: input.platformPlacementIds
|
|
265
267
|
}, _errorFactory));
|
|
266
|
-
const
|
|
267
|
-
method: "typia.createAssert",
|
|
268
|
-
path: _path + ".type",
|
|
269
|
-
expected: "\"continue\"",
|
|
270
|
-
value: input.type
|
|
271
|
-
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable);
|
|
272
|
-
const _ao3 = (input, _path, _exceptionable = true) => ("currency" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
273
|
-
method: "typia.createAssert",
|
|
274
|
-
path: _path + ".type",
|
|
275
|
-
expected: "\"currency\"",
|
|
276
|
-
value: input.type
|
|
277
|
-
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && ("coin" === input.currency || "gem" === input.currency || _assertGuard_1._assertGuard(_exceptionable, {
|
|
278
|
-
method: "typia.createAssert",
|
|
279
|
-
path: _path + ".currency",
|
|
280
|
-
expected: "(\"coin\" | \"gem\")",
|
|
281
|
-
value: input.currency
|
|
282
|
-
}, _errorFactory));
|
|
283
|
-
const _ao4 = (input, _path, _exceptionable = true) => ("number" === typeof input.cooldownSeconds || _assertGuard_1._assertGuard(_exceptionable, {
|
|
268
|
+
const _ao3 = (input, _path, _exceptionable = true) => ("number" === typeof input.cooldownSeconds || _assertGuard_1._assertGuard(_exceptionable, {
|
|
284
269
|
method: "typia.createAssert",
|
|
285
270
|
path: _path + ".cooldownSeconds",
|
|
286
271
|
expected: "number",
|
|
@@ -296,7 +281,7 @@ const assertAdPlacementsShape = (() => {
|
|
|
296
281
|
expected: "(number | undefined)",
|
|
297
282
|
value: input.minStageInterval
|
|
298
283
|
}, _errorFactory));
|
|
299
|
-
const
|
|
284
|
+
const _ao4 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
300
285
|
const value = input[key];
|
|
301
286
|
if (undefined === value)
|
|
302
287
|
return true;
|
|
@@ -307,35 +292,91 @@ const assertAdPlacementsShape = (() => {
|
|
|
307
292
|
value: value
|
|
308
293
|
}, _errorFactory);
|
|
309
294
|
});
|
|
295
|
+
const _ao5 = (input, _path, _exceptionable = true) => ("continue" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
296
|
+
method: "typia.createAssert",
|
|
297
|
+
path: _path + ".type",
|
|
298
|
+
expected: "\"continue\"",
|
|
299
|
+
value: input.type
|
|
300
|
+
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable);
|
|
301
|
+
const _ao6 = (input, _path, _exceptionable = true) => ("currency" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
302
|
+
method: "typia.createAssert",
|
|
303
|
+
path: _path + ".type",
|
|
304
|
+
expected: "\"currency\"",
|
|
305
|
+
value: input.type
|
|
306
|
+
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && ("coin" === input.currency || "gem" === input.currency || _assertGuard_1._assertGuard(_exceptionable, {
|
|
307
|
+
method: "typia.createAssert",
|
|
308
|
+
path: _path + ".currency",
|
|
309
|
+
expected: "(\"coin\" | \"gem\")",
|
|
310
|
+
value: input.currency
|
|
311
|
+
}, _errorFactory));
|
|
312
|
+
const _ao7 = (input, _path, _exceptionable = true) => _ao2(input, _path, true && _exceptionable) && (("banner" === input.type || "interstitial" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
313
|
+
method: "typia.createAssert",
|
|
314
|
+
path: _path + ".type",
|
|
315
|
+
expected: "(\"banner\" | \"interstitial\")",
|
|
316
|
+
value: input.type
|
|
317
|
+
}, _errorFactory)) && ((null !== input.reward || _assertGuard_1._assertGuard(_exceptionable, {
|
|
318
|
+
method: "typia.createAssert",
|
|
319
|
+
path: _path + ".reward",
|
|
320
|
+
expected: "undefined",
|
|
321
|
+
value: input.reward
|
|
322
|
+
}, _errorFactory)) && (undefined === input.reward || _assertGuard_1._assertGuard(_exceptionable, {
|
|
323
|
+
method: "typia.createAssert",
|
|
324
|
+
path: _path + ".reward",
|
|
325
|
+
expected: "undefined",
|
|
326
|
+
value: input.reward
|
|
327
|
+
}, _errorFactory))));
|
|
310
328
|
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
329
|
+
if ("banner" === input.type || "interstitial" === input.type)
|
|
330
|
+
return _ao7(input, _path, true && _exceptionable);
|
|
331
|
+
else if ("rewarded" === input.type)
|
|
332
|
+
return _ao1(input, _path, true && _exceptionable);
|
|
333
|
+
else
|
|
334
|
+
return _assertGuard_1._assertGuard(_exceptionable, {
|
|
335
|
+
method: "typia.createAssert",
|
|
336
|
+
path: _path,
|
|
337
|
+
expected: _ae0,
|
|
338
|
+
value: input
|
|
339
|
+
}, _errorFactory);
|
|
340
|
+
})();
|
|
341
|
+
const _au1 = (input, _path, _exceptionable = true) => (() => {
|
|
311
342
|
if ("continue" === input.type)
|
|
312
|
-
return
|
|
343
|
+
return _ao5(input, _path, true && _exceptionable);
|
|
313
344
|
else if ("currency" === input.type)
|
|
314
|
-
return
|
|
345
|
+
return _ao6(input, _path, true && _exceptionable);
|
|
315
346
|
else
|
|
316
347
|
return _assertGuard_1._assertGuard(_exceptionable, {
|
|
317
348
|
method: "typia.createAssert",
|
|
318
349
|
path: _path,
|
|
319
|
-
expected:
|
|
350
|
+
expected: _ae2,
|
|
320
351
|
value: input
|
|
321
352
|
}, _errorFactory);
|
|
322
353
|
})();
|
|
323
|
-
const _io0 = input => "string" === typeof input.version && (Array.isArray(input.placements) && input.placements.every(elem => "object" === typeof elem && null !== elem &&
|
|
324
|
-
const _io1 = input =>
|
|
325
|
-
const _io2 = input => "
|
|
326
|
-
const _io3 = input => "
|
|
327
|
-
const _io4 = input =>
|
|
328
|
-
const _io5 = input => Object.keys(input).every(key => {
|
|
354
|
+
const _io0 = input => "string" === typeof input.version && (Array.isArray(input.placements) && input.placements.every(elem => "object" === typeof elem && null !== elem && _iu0(elem)));
|
|
355
|
+
const _io1 = input => _io2(input) && ("rewarded" === input.type && (undefined === input.reward || "object" === typeof input.reward && null !== input.reward && _iu1(input.reward)));
|
|
356
|
+
const _io2 = input => "string" === typeof input.id && ("object" === typeof input.frequencyCap && null !== input.frequencyCap && _io3(input.frequencyCap)) && ("object" === typeof input.platformPlacementIds && null !== input.platformPlacementIds && false === Array.isArray(input.platformPlacementIds) && _io4(input.platformPlacementIds));
|
|
357
|
+
const _io3 = input => "number" === typeof input.cooldownSeconds && (undefined === input.maxPerSession || "number" === typeof input.maxPerSession) && (undefined === input.minStageInterval || "number" === typeof input.minStageInterval);
|
|
358
|
+
const _io4 = input => Object.keys(input).every(key => {
|
|
329
359
|
const value = input[key];
|
|
330
360
|
if (undefined === value)
|
|
331
361
|
return true;
|
|
332
362
|
return undefined === value || "string" === typeof value;
|
|
333
363
|
});
|
|
364
|
+
const _io5 = input => "continue" === input.type && _ip0(input);
|
|
365
|
+
const _io6 = input => "currency" === input.type && _ip0(input) && ("coin" === input.currency || "gem" === input.currency);
|
|
366
|
+
const _io7 = input => _io2(input) && (("banner" === input.type || "interstitial" === input.type) && (null !== input.reward && undefined === input.reward));
|
|
334
367
|
const _iu0 = input => (() => {
|
|
368
|
+
if ("banner" === input.type || "interstitial" === input.type)
|
|
369
|
+
return _io7(input);
|
|
370
|
+
else if ("rewarded" === input.type)
|
|
371
|
+
return _io1(input);
|
|
372
|
+
else
|
|
373
|
+
return false;
|
|
374
|
+
})();
|
|
375
|
+
const _iu1 = input => (() => {
|
|
335
376
|
if ("continue" === input.type)
|
|
336
|
-
return
|
|
377
|
+
return _io5(input);
|
|
337
378
|
else if ("currency" === input.type)
|
|
338
|
-
return
|
|
379
|
+
return _io6(input);
|
|
339
380
|
else
|
|
340
381
|
return false;
|
|
341
382
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/catalog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Product catalog and ad placement configuration schemas for mpgd games.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"typia": "13.0.2",
|
|
42
|
-
"@mpgd/platform": "0.
|
|
42
|
+
"@mpgd/platform": "0.10.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"ttsc": "0.18.4",
|