@mpgd/catalog 0.4.0 → 0.5.1

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-07-03",
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,5 +1,6 @@
1
+ import { type tags } from 'typia';
1
2
  import type { LogicalAdPlacementId, LogicalProductId, ProductType } from '@mpgd/platform';
2
- export type CatalogTarget = 'android' | 'ios' | 'ait' | 'reddit';
3
+ export type CatalogTarget = 'android' | 'ios' | 'ait' | 'reddit' | 'verse8';
3
4
  export type AdPlacementTarget = Exclude<CatalogTarget, 'reddit'>;
4
5
  export type ProductGrant = {
5
6
  readonly type: 'currency';
@@ -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)) && _ao4(input.platformProductIds, _path + ".platformProductIds", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
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) => (undefined === input.ait || "string" === typeof input.ait || _assertGuard_1._assertGuard(_exceptionable, {
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)",
@@ -106,12 +137,19 @@ export const assertProductCatalog = (() => {
106
137
  path: _path + ".reddit",
107
138
  expected: "(string | undefined)",
108
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
109
145
  }, _errorFactory));
110
146
  const _au0 = (input, _path, _exceptionable = true) => (() => {
111
147
  if ("currency" === input.type)
112
148
  return _ao2(input, _path, true && _exceptionable);
113
149
  else if ("entitlement" === input.type)
114
150
  return _ao3(input, _path, true && _exceptionable);
151
+ else if ("resource" === input.type)
152
+ return _ao4(input, _path, true && _exceptionable);
115
153
  else
116
154
  return _assertGuard_1._assertGuard(_exceptionable, {
117
155
  method: "typia.createAssert",
@@ -121,15 +159,18 @@ export const assertProductCatalog = (() => {
121
159
  }, _errorFactory);
122
160
  })();
123
161
  const _io0 = input => "string" === typeof input.version && (Array.isArray(input.products) && input.products.every(elem => "object" === typeof elem && null !== elem && _io1(elem)));
124
- 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) && _io4(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));
125
163
  const _io2 = input => "currency" === input.type && ("coin" === input.currency || "gem" === input.currency) && "number" === typeof input.amount;
126
164
  const _io3 = input => "entitlement" === input.type && "string" === typeof input.entitlement;
127
- const _io4 = 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);
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);
128
167
  const _iu0 = input => (() => {
129
168
  if ("currency" === input.type)
130
169
  return _io2(input);
131
170
  else if ("entitlement" === input.type)
132
171
  return _io3(input);
172
+ else if ("resource" === input.type)
173
+ return _io4(input);
133
174
  else
134
175
  return false;
135
176
  })();
@@ -278,6 +319,11 @@ export const assertAdPlacements = (() => {
278
319
  path: _path + ".ios",
279
320
  expected: "(string | undefined)",
280
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
281
327
  }, _errorFactory));
282
328
  const _au0 = (input, _path, _exceptionable = true) => (() => {
283
329
  if ("continue" === input.type)
@@ -297,7 +343,7 @@ export const assertAdPlacements = (() => {
297
343
  const _io2 = input => "continue" === input.type && _ip0(input);
298
344
  const _io3 = input => "currency" === input.type && _ip0(input) && ("coin" === input.currency || "gem" === input.currency);
299
345
  const _io4 = input => "number" === typeof input.cooldownSeconds && (undefined === input.maxPerSession || "number" === typeof input.maxPerSession) && (undefined === input.minStageInterval || "number" === typeof input.minStageInterval);
300
- 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);
301
347
  const _iu0 = input => (() => {
302
348
  if ("continue" === input.type)
303
349
  return _io2(input);
@@ -327,7 +373,7 @@ export const assertAdPlacements = (() => {
327
373
  };
328
374
  })();
329
375
  export const assertProductGrant = (() => {
330
- 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>; })";
331
377
  const _ao0 = (input, _path, _exceptionable = true) => ("currency" === input.type || _assertGuard_1._assertGuard(_exceptionable, {
332
378
  method: "typia.createAssert",
333
379
  path: _path + ".type",
@@ -355,11 +401,44 @@ export const assertProductGrant = (() => {
355
401
  expected: "string",
356
402
  value: input.entitlement
357
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));
358
435
  const _au0 = (input, _path, _exceptionable = true) => (() => {
359
436
  if ("currency" === input.type)
360
437
  return _ao0(input, _path, true && _exceptionable);
361
438
  else if ("entitlement" === input.type)
362
439
  return _ao1(input, _path, true && _exceptionable);
440
+ else if ("resource" === input.type)
441
+ return _ao2(input, _path, true && _exceptionable);
363
442
  else
364
443
  return _assertGuard_1._assertGuard(_exceptionable, {
365
444
  method: "typia.createAssert",
@@ -370,11 +449,14 @@ export const assertProductGrant = (() => {
370
449
  })();
371
450
  const _io0 = input => "currency" === input.type && ("coin" === input.currency || "gem" === input.currency) && "number" === typeof input.amount;
372
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));
373
453
  const _iu0 = input => (() => {
374
454
  if ("currency" === input.type)
375
455
  return _io0(input);
376
456
  else if ("entitlement" === input.type)
377
457
  return _io1(input);
458
+ else if ("resource" === input.type)
459
+ return _io2(input);
378
460
  else
379
461
  return false;
380
462
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/catalog",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
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.6.0"
42
+ "@mpgd/platform": "0.8.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-03",
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
  ]