@mpgd/catalog 0.3.5 → 0.5.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 +7 -4
- package/dist/index.d.ts +7 -2
- package/dist/index.js +96 -9
- package/package.json +3 -2
- package/placements.json +5 -3
package/catalog.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2026-07-
|
|
2
|
+
"version": "2026-07-16",
|
|
3
3
|
"products": [
|
|
4
4
|
{
|
|
5
5
|
"id": "COINS_100",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"platformProductIds": {
|
|
13
13
|
"android": "coins_100",
|
|
14
14
|
"ios": "com.mpgd.game.coins100",
|
|
15
|
-
"ait": "coins_100"
|
|
15
|
+
"ait": "coins_100",
|
|
16
|
+
"verse8": "coins-100"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
{
|
|
@@ -26,7 +27,8 @@
|
|
|
26
27
|
"platformProductIds": {
|
|
27
28
|
"android": "coins_500",
|
|
28
29
|
"ios": "com.mpgd.game.coins500",
|
|
29
|
-
"ait": "coins_500"
|
|
30
|
+
"ait": "coins_500",
|
|
31
|
+
"verse8": "coins-500"
|
|
30
32
|
}
|
|
31
33
|
},
|
|
32
34
|
{
|
|
@@ -39,7 +41,8 @@
|
|
|
39
41
|
"platformProductIds": {
|
|
40
42
|
"android": "remove_ads",
|
|
41
43
|
"ios": "com.mpgd.game.remove_ads",
|
|
42
|
-
"ait": "remove_ads"
|
|
44
|
+
"ait": "remove_ads",
|
|
45
|
+
"verse8": "remove-ads"
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
]
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type tags } from 'typia';
|
|
1
2
|
import type { LogicalAdPlacementId, LogicalProductId, ProductType } from '@mpgd/platform';
|
|
2
|
-
export type CatalogTarget = 'android' | 'ios' | 'ait';
|
|
3
|
-
export type AdPlacementTarget = CatalogTarget
|
|
3
|
+
export type CatalogTarget = 'android' | 'ios' | 'ait' | 'reddit' | 'verse8';
|
|
4
|
+
export type AdPlacementTarget = Exclude<CatalogTarget, 'reddit'>;
|
|
4
5
|
export type ProductGrant = {
|
|
5
6
|
readonly type: 'currency';
|
|
6
7
|
readonly currency: 'coin' | 'gem';
|
|
@@ -8,6 +9,10 @@ export type ProductGrant = {
|
|
|
8
9
|
} | {
|
|
9
10
|
readonly type: 'entitlement';
|
|
10
11
|
readonly entitlement: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly type: 'resource';
|
|
14
|
+
readonly resource: string & tags.MinLength<1>;
|
|
15
|
+
readonly amount: number & tags.ExclusiveMinimum<0> & tags.Maximum<1.7976931348623157e308>;
|
|
11
16
|
};
|
|
12
17
|
export interface ProductCatalogEntry {
|
|
13
18
|
readonly id: LogicalProductId;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _assertGuard_1 from "typia/lib/internal/_assertGuard";
|
|
2
2
|
import typia from 'typia';
|
|
3
3
|
export const assertProductCatalog = (() => {
|
|
4
|
-
const _ae0 = "({ readonly type: \"currency\"; readonly currency: \"coin\" | \"gem\"; readonly amount: number; } | { readonly type: \"entitlement\"; readonly entitlement: string; })";
|
|
4
|
+
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>; })";
|
|
5
5
|
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || _assertGuard_1._assertGuard(_exceptionable, {
|
|
6
6
|
method: "typia.createAssert",
|
|
7
7
|
path: _path + ".version",
|
|
@@ -53,7 +53,7 @@ export const assertProductCatalog = (() => {
|
|
|
53
53
|
path: _path + ".platformProductIds",
|
|
54
54
|
expected: "Partial<Record<CatalogTarget, string>>",
|
|
55
55
|
value: input.platformProductIds
|
|
56
|
-
}, _errorFactory)) &&
|
|
56
|
+
}, _errorFactory)) && _ao5(input.platformProductIds, _path + ".platformProductIds", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
57
57
|
method: "typia.createAssert",
|
|
58
58
|
path: _path + ".platformProductIds",
|
|
59
59
|
expected: "Partial<Record<CatalogTarget, string>>",
|
|
@@ -86,7 +86,38 @@ export const assertProductCatalog = (() => {
|
|
|
86
86
|
expected: "string",
|
|
87
87
|
value: input.entitlement
|
|
88
88
|
}, _errorFactory));
|
|
89
|
-
const _ao4 = (input, _path, _exceptionable = true) => (
|
|
89
|
+
const _ao4 = (input, _path, _exceptionable = true) => ("resource" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
90
|
+
method: "typia.createAssert",
|
|
91
|
+
path: _path + ".type",
|
|
92
|
+
expected: "\"resource\"",
|
|
93
|
+
value: input.type
|
|
94
|
+
}, _errorFactory)) && ("string" === typeof input.resource && (1 <= input.resource.length || _assertGuard_1._assertGuard(_exceptionable, {
|
|
95
|
+
method: "typia.createAssert",
|
|
96
|
+
path: _path + ".resource",
|
|
97
|
+
expected: "string & MinLength<1>",
|
|
98
|
+
value: input.resource
|
|
99
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
100
|
+
method: "typia.createAssert",
|
|
101
|
+
path: _path + ".resource",
|
|
102
|
+
expected: "(string & MinLength<1>)",
|
|
103
|
+
value: input.resource
|
|
104
|
+
}, _errorFactory)) && ("number" === typeof input.amount && (0 < input.amount || _assertGuard_1._assertGuard(_exceptionable, {
|
|
105
|
+
method: "typia.createAssert",
|
|
106
|
+
path: _path + ".amount",
|
|
107
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
108
|
+
value: input.amount
|
|
109
|
+
}, _errorFactory)) && (input.amount <= 1.7976931348623157e+308 || _assertGuard_1._assertGuard(_exceptionable, {
|
|
110
|
+
method: "typia.createAssert",
|
|
111
|
+
path: _path + ".amount",
|
|
112
|
+
expected: "number & Maximum<1.7976931348623157e+308>",
|
|
113
|
+
value: input.amount
|
|
114
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
115
|
+
method: "typia.createAssert",
|
|
116
|
+
path: _path + ".amount",
|
|
117
|
+
expected: "(number & ExclusiveMinimum<0> & Maximum<1.7976931348623157e+308>)",
|
|
118
|
+
value: input.amount
|
|
119
|
+
}, _errorFactory));
|
|
120
|
+
const _ao5 = (input, _path, _exceptionable = true) => (undefined === input.ait || "string" === typeof input.ait || _assertGuard_1._assertGuard(_exceptionable, {
|
|
90
121
|
method: "typia.createAssert",
|
|
91
122
|
path: _path + ".ait",
|
|
92
123
|
expected: "(string | undefined)",
|
|
@@ -101,12 +132,24 @@ export const assertProductCatalog = (() => {
|
|
|
101
132
|
path: _path + ".ios",
|
|
102
133
|
expected: "(string | undefined)",
|
|
103
134
|
value: input.ios
|
|
135
|
+
}, _errorFactory)) && (undefined === input.reddit || "string" === typeof input.reddit || _assertGuard_1._assertGuard(_exceptionable, {
|
|
136
|
+
method: "typia.createAssert",
|
|
137
|
+
path: _path + ".reddit",
|
|
138
|
+
expected: "(string | undefined)",
|
|
139
|
+
value: input.reddit
|
|
140
|
+
}, _errorFactory)) && (undefined === input.verse8 || "string" === typeof input.verse8 || _assertGuard_1._assertGuard(_exceptionable, {
|
|
141
|
+
method: "typia.createAssert",
|
|
142
|
+
path: _path + ".verse8",
|
|
143
|
+
expected: "(string | undefined)",
|
|
144
|
+
value: input.verse8
|
|
104
145
|
}, _errorFactory));
|
|
105
146
|
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
106
147
|
if ("currency" === input.type)
|
|
107
148
|
return _ao2(input, _path, true && _exceptionable);
|
|
108
149
|
else if ("entitlement" === input.type)
|
|
109
150
|
return _ao3(input, _path, true && _exceptionable);
|
|
151
|
+
else if ("resource" === input.type)
|
|
152
|
+
return _ao4(input, _path, true && _exceptionable);
|
|
110
153
|
else
|
|
111
154
|
return _assertGuard_1._assertGuard(_exceptionable, {
|
|
112
155
|
method: "typia.createAssert",
|
|
@@ -116,15 +159,18 @@ export const assertProductCatalog = (() => {
|
|
|
116
159
|
}, _errorFactory);
|
|
117
160
|
})();
|
|
118
161
|
const _io0 = input => "string" === typeof input.version && (Array.isArray(input.products) && input.products.every(elem => "object" === typeof elem && null !== elem && _io1(elem)));
|
|
119
|
-
const _io1 = input => "string" === typeof input.id && ("consumable" === input.type || "non_consumable" === input.type || "subscription" === input.type) && ("object" === typeof input.grant && null !== input.grant && _iu0(input.grant)) && ("object" === typeof input.platformProductIds && null !== input.platformProductIds && false === Array.isArray(input.platformProductIds) &&
|
|
162
|
+
const _io1 = input => "string" === typeof input.id && ("consumable" === input.type || "non_consumable" === input.type || "subscription" === input.type) && ("object" === typeof input.grant && null !== input.grant && _iu0(input.grant)) && ("object" === typeof input.platformProductIds && null !== input.platformProductIds && false === Array.isArray(input.platformProductIds) && _io5(input.platformProductIds));
|
|
120
163
|
const _io2 = input => "currency" === input.type && ("coin" === input.currency || "gem" === input.currency) && "number" === typeof input.amount;
|
|
121
164
|
const _io3 = input => "entitlement" === input.type && "string" === typeof input.entitlement;
|
|
122
|
-
const _io4 = input =>
|
|
165
|
+
const _io4 = input => "resource" === input.type && ("string" === typeof input.resource && 1 <= input.resource.length) && ("number" === typeof input.amount && (0 < input.amount && input.amount <= 1.7976931348623157e+308));
|
|
166
|
+
const _io5 = input => (undefined === input.ait || "string" === typeof input.ait) && (undefined === input.android || "string" === typeof input.android) && (undefined === input.ios || "string" === typeof input.ios) && (undefined === input.reddit || "string" === typeof input.reddit) && (undefined === input.verse8 || "string" === typeof input.verse8);
|
|
123
167
|
const _iu0 = input => (() => {
|
|
124
168
|
if ("currency" === input.type)
|
|
125
169
|
return _io2(input);
|
|
126
170
|
else if ("entitlement" === input.type)
|
|
127
171
|
return _io3(input);
|
|
172
|
+
else if ("resource" === input.type)
|
|
173
|
+
return _io4(input);
|
|
128
174
|
else
|
|
129
175
|
return false;
|
|
130
176
|
})();
|
|
@@ -217,12 +263,12 @@ export const assertAdPlacements = (() => {
|
|
|
217
263
|
}, _errorFactory)) && (("object" === typeof input.platformPlacementIds && null !== input.platformPlacementIds && false === Array.isArray(input.platformPlacementIds) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
218
264
|
method: "typia.createAssert",
|
|
219
265
|
path: _path + ".platformPlacementIds",
|
|
220
|
-
expected: "Partial<Record<
|
|
266
|
+
expected: "Partial<Record<AdPlacementTarget, string>>",
|
|
221
267
|
value: input.platformPlacementIds
|
|
222
268
|
}, _errorFactory)) && _ao5(input.platformPlacementIds, _path + ".platformPlacementIds", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
223
269
|
method: "typia.createAssert",
|
|
224
270
|
path: _path + ".platformPlacementIds",
|
|
225
|
-
expected: "Partial<Record<
|
|
271
|
+
expected: "Partial<Record<AdPlacementTarget, string>>",
|
|
226
272
|
value: input.platformPlacementIds
|
|
227
273
|
}, _errorFactory));
|
|
228
274
|
const _ao2 = (input, _path, _exceptionable = true) => ("continue" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
@@ -273,6 +319,11 @@ export const assertAdPlacements = (() => {
|
|
|
273
319
|
path: _path + ".ios",
|
|
274
320
|
expected: "(string | undefined)",
|
|
275
321
|
value: input.ios
|
|
322
|
+
}, _errorFactory)) && (undefined === input.verse8 || "string" === typeof input.verse8 || _assertGuard_1._assertGuard(_exceptionable, {
|
|
323
|
+
method: "typia.createAssert",
|
|
324
|
+
path: _path + ".verse8",
|
|
325
|
+
expected: "(string | undefined)",
|
|
326
|
+
value: input.verse8
|
|
276
327
|
}, _errorFactory));
|
|
277
328
|
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
278
329
|
if ("continue" === input.type)
|
|
@@ -292,7 +343,7 @@ export const assertAdPlacements = (() => {
|
|
|
292
343
|
const _io2 = input => "continue" === input.type && _ip0(input);
|
|
293
344
|
const _io3 = input => "currency" === input.type && _ip0(input) && ("coin" === input.currency || "gem" === input.currency);
|
|
294
345
|
const _io4 = input => "number" === typeof input.cooldownSeconds && (undefined === input.maxPerSession || "number" === typeof input.maxPerSession) && (undefined === input.minStageInterval || "number" === typeof input.minStageInterval);
|
|
295
|
-
const _io5 = input => (undefined === input.ait || "string" === typeof input.ait) && (undefined === input.android || "string" === typeof input.android) && (undefined === input.ios || "string" === typeof input.ios);
|
|
346
|
+
const _io5 = input => (undefined === input.ait || "string" === typeof input.ait) && (undefined === input.android || "string" === typeof input.android) && (undefined === input.ios || "string" === typeof input.ios) && (undefined === input.verse8 || "string" === typeof input.verse8);
|
|
296
347
|
const _iu0 = input => (() => {
|
|
297
348
|
if ("continue" === input.type)
|
|
298
349
|
return _io2(input);
|
|
@@ -322,7 +373,7 @@ export const assertAdPlacements = (() => {
|
|
|
322
373
|
};
|
|
323
374
|
})();
|
|
324
375
|
export const assertProductGrant = (() => {
|
|
325
|
-
const _ae0 = "({ readonly type: \"currency\"; readonly currency: \"coin\" | \"gem\"; readonly amount: number; } | { readonly type: \"entitlement\"; readonly entitlement: string; })";
|
|
376
|
+
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>; })";
|
|
326
377
|
const _ao0 = (input, _path, _exceptionable = true) => ("currency" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
327
378
|
method: "typia.createAssert",
|
|
328
379
|
path: _path + ".type",
|
|
@@ -350,11 +401,44 @@ export const assertProductGrant = (() => {
|
|
|
350
401
|
expected: "string",
|
|
351
402
|
value: input.entitlement
|
|
352
403
|
}, _errorFactory));
|
|
404
|
+
const _ao2 = (input, _path, _exceptionable = true) => ("resource" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
|
|
405
|
+
method: "typia.createAssert",
|
|
406
|
+
path: _path + ".type",
|
|
407
|
+
expected: "\"resource\"",
|
|
408
|
+
value: input.type
|
|
409
|
+
}, _errorFactory)) && ("string" === typeof input.resource && (1 <= input.resource.length || _assertGuard_1._assertGuard(_exceptionable, {
|
|
410
|
+
method: "typia.createAssert",
|
|
411
|
+
path: _path + ".resource",
|
|
412
|
+
expected: "string & MinLength<1>",
|
|
413
|
+
value: input.resource
|
|
414
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
415
|
+
method: "typia.createAssert",
|
|
416
|
+
path: _path + ".resource",
|
|
417
|
+
expected: "(string & MinLength<1>)",
|
|
418
|
+
value: input.resource
|
|
419
|
+
}, _errorFactory)) && ("number" === typeof input.amount && (0 < input.amount || _assertGuard_1._assertGuard(_exceptionable, {
|
|
420
|
+
method: "typia.createAssert",
|
|
421
|
+
path: _path + ".amount",
|
|
422
|
+
expected: "number & ExclusiveMinimum<0>",
|
|
423
|
+
value: input.amount
|
|
424
|
+
}, _errorFactory)) && (input.amount <= 1.7976931348623157e+308 || _assertGuard_1._assertGuard(_exceptionable, {
|
|
425
|
+
method: "typia.createAssert",
|
|
426
|
+
path: _path + ".amount",
|
|
427
|
+
expected: "number & Maximum<1.7976931348623157e+308>",
|
|
428
|
+
value: input.amount
|
|
429
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
430
|
+
method: "typia.createAssert",
|
|
431
|
+
path: _path + ".amount",
|
|
432
|
+
expected: "(number & ExclusiveMinimum<0> & Maximum<1.7976931348623157e+308>)",
|
|
433
|
+
value: input.amount
|
|
434
|
+
}, _errorFactory));
|
|
353
435
|
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
354
436
|
if ("currency" === input.type)
|
|
355
437
|
return _ao0(input, _path, true && _exceptionable);
|
|
356
438
|
else if ("entitlement" === input.type)
|
|
357
439
|
return _ao1(input, _path, true && _exceptionable);
|
|
440
|
+
else if ("resource" === input.type)
|
|
441
|
+
return _ao2(input, _path, true && _exceptionable);
|
|
358
442
|
else
|
|
359
443
|
return _assertGuard_1._assertGuard(_exceptionable, {
|
|
360
444
|
method: "typia.createAssert",
|
|
@@ -365,11 +449,14 @@ export const assertProductGrant = (() => {
|
|
|
365
449
|
})();
|
|
366
450
|
const _io0 = input => "currency" === input.type && ("coin" === input.currency || "gem" === input.currency) && "number" === typeof input.amount;
|
|
367
451
|
const _io1 = input => "entitlement" === input.type && "string" === typeof input.entitlement;
|
|
452
|
+
const _io2 = input => "resource" === input.type && ("string" === typeof input.resource && 1 <= input.resource.length) && ("number" === typeof input.amount && (0 < input.amount && input.amount <= 1.7976931348623157e+308));
|
|
368
453
|
const _iu0 = input => (() => {
|
|
369
454
|
if ("currency" === input.type)
|
|
370
455
|
return _io0(input);
|
|
371
456
|
else if ("entitlement" === input.type)
|
|
372
457
|
return _io1(input);
|
|
458
|
+
else if ("resource" === input.type)
|
|
459
|
+
return _io2(input);
|
|
373
460
|
else
|
|
374
461
|
return false;
|
|
375
462
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/catalog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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.7.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"ttsc": "0.18.4",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"check": "ttsc --noEmit",
|
|
55
|
+
"test": "cd ../.. && node tools/run-ttsx.mjs packages/catalog/src/index.test.ts",
|
|
55
56
|
"lint": "ttsc --noEmit",
|
|
56
57
|
"format": "ttsc format",
|
|
57
58
|
"fix": "ttsc fix"
|
package/placements.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2026-07-
|
|
2
|
+
"version": "2026-07-16",
|
|
3
3
|
"placements": [
|
|
4
4
|
{
|
|
5
5
|
"id": "CONTINUE_AFTER_FAIL",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"platformPlacementIds": {
|
|
16
16
|
"android": "ca-app-pub-xxx/reward_continue",
|
|
17
17
|
"ios": "ca-app-pub-yyy/reward_continue",
|
|
18
|
-
"ait": "ait_reward_continue"
|
|
18
|
+
"ait": "ait_reward_continue",
|
|
19
|
+
"verse8": "rewarded_continue"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
{
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
"platformPlacementIds": {
|
|
29
30
|
"android": "ca-app-pub-xxx/inter_stage_end",
|
|
30
31
|
"ios": "ca-app-pub-yyy/inter_stage_end",
|
|
31
|
-
"ait": "ait_inter_stage_end"
|
|
32
|
+
"ait": "ait_inter_stage_end",
|
|
33
|
+
"verse8": "stage_end_interstitial"
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
]
|