@smartico/public-api 0.0.260 → 0.0.262
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/MiniGames/SAWBuyInType.d.ts +6 -2
- package/dist/MiniGames/SAWPrizeType.d.ts +3 -1
- package/dist/MiniGames/SAWUtils.d.ts +5 -1
- package/dist/SmarticoLib/index.d.ts +5 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +21 -4
- package/dist/index.modern.mjs.map +1 -1
- package/docs/enums/MiniGamePrizeTypeName.md +6 -0
- package/docs/enums/SAWBuyInTypeName.md +12 -0
- package/package.json +1 -1
- package/src/MiniGames/SAWBuyInType.ts +6 -0
- package/src/MiniGames/SAWPrizeType.ts +3 -0
- package/src/MiniGames/SAWUtils.ts +12 -3
- package/src/SmarticoLib/index.ts +4 -0
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
export declare enum SAWBuyInType {
|
|
3
3
|
Free = 1,
|
|
4
4
|
Points = 2,
|
|
5
|
-
Spins = 3
|
|
5
|
+
Spins = 3,
|
|
6
|
+
Gems = 4,
|
|
7
|
+
Diamonds = 5
|
|
6
8
|
}
|
|
7
9
|
export declare enum SAWBuyInTypeName {
|
|
8
10
|
Free = "free",
|
|
9
11
|
Points = "points",
|
|
10
12
|
Spins = "spins",
|
|
11
|
-
Unknown = "unknown"
|
|
13
|
+
Unknown = "unknown",
|
|
14
|
+
Gems = "gems",
|
|
15
|
+
Diamonds = "diamonds"
|
|
12
16
|
}
|
|
13
17
|
/** @hidden */
|
|
14
18
|
export declare const SAWBuyInTypeNamed: (type: SAWBuyInType) => SAWBuyInTypeName;
|
|
@@ -8,7 +8,8 @@ export declare enum SAWPrizeType {
|
|
|
8
8
|
JACKPOT = 6,
|
|
9
9
|
CHANGE_LEVEL = 7,
|
|
10
10
|
MISSION = 8,
|
|
11
|
-
RAFFLE_TICKET = 9
|
|
11
|
+
RAFFLE_TICKET = 9,
|
|
12
|
+
GEMS_AND_DIAMONDS = 10
|
|
12
13
|
}
|
|
13
14
|
export declare enum MiniGamePrizeTypeName {
|
|
14
15
|
NO_PRIZE = "no-prize",
|
|
@@ -20,6 +21,7 @@ export declare enum MiniGamePrizeTypeName {
|
|
|
20
21
|
CHANGE_LEVEL = "change-level",
|
|
21
22
|
MISSION = "mission",
|
|
22
23
|
RAFFLE_TICKET = "raffle-ticket",
|
|
24
|
+
GEMS_AND_DIAMONDS = "gems-and-diamonds",
|
|
23
25
|
UNKNOWN = "unknown"
|
|
24
26
|
}
|
|
25
27
|
/** @hidden */
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { SAWTemplate } from './SAWTemplate';
|
|
2
2
|
declare class SAWUtils {
|
|
3
|
-
static canPlay: (t: SAWTemplate,
|
|
3
|
+
static canPlay: (t: SAWTemplate, user: {
|
|
4
|
+
ach_points_balance: number;
|
|
5
|
+
ach_gems_balance: number;
|
|
6
|
+
ach_diamonds_balance: number;
|
|
7
|
+
}) => boolean;
|
|
4
8
|
}
|
|
5
9
|
export { SAWUtils };
|
|
@@ -296,12 +296,16 @@ export interface GetStoreHistoryResponse extends ProtocolResponse {
|
|
|
296
296
|
declare enum SAWBuyInType {
|
|
297
297
|
Free = 1,
|
|
298
298
|
Points = 2,
|
|
299
|
-
Spins = 3
|
|
299
|
+
Spins = 3,
|
|
300
|
+
Gems = 4,
|
|
301
|
+
Diamonds = 5
|
|
300
302
|
}
|
|
301
303
|
declare enum SAWBuyInTypeName {
|
|
302
304
|
Free = "free",
|
|
303
305
|
Points = "points",
|
|
304
306
|
Spins = "spins",
|
|
307
|
+
Gems = "gems",
|
|
308
|
+
Diamonds = "diamonds",
|
|
305
309
|
Unknown = "unknown"
|
|
306
310
|
}
|
|
307
311
|
declare enum SAWGameType {
|
package/dist/index.js
CHANGED
|
@@ -272,6 +272,8 @@ exports.SAWBuyInType = void 0;
|
|
|
272
272
|
SAWBuyInType[SAWBuyInType["Free"] = 1] = "Free";
|
|
273
273
|
SAWBuyInType[SAWBuyInType["Points"] = 2] = "Points";
|
|
274
274
|
SAWBuyInType[SAWBuyInType["Spins"] = 3] = "Spins";
|
|
275
|
+
SAWBuyInType[SAWBuyInType["Gems"] = 4] = "Gems";
|
|
276
|
+
SAWBuyInType[SAWBuyInType["Diamonds"] = 5] = "Diamonds";
|
|
275
277
|
})(exports.SAWBuyInType || (exports.SAWBuyInType = {}));
|
|
276
278
|
exports.SAWBuyInTypeName = void 0;
|
|
277
279
|
(function (SAWBuyInTypeName) {
|
|
@@ -279,15 +281,17 @@ exports.SAWBuyInTypeName = void 0;
|
|
|
279
281
|
SAWBuyInTypeName["Points"] = "points";
|
|
280
282
|
SAWBuyInTypeName["Spins"] = "spins";
|
|
281
283
|
SAWBuyInTypeName["Unknown"] = "unknown";
|
|
284
|
+
SAWBuyInTypeName["Gems"] = "gems";
|
|
285
|
+
SAWBuyInTypeName["Diamonds"] = "diamonds";
|
|
282
286
|
})(exports.SAWBuyInTypeName || (exports.SAWBuyInTypeName = {}));
|
|
283
287
|
/** @hidden */
|
|
284
288
|
var SAWBuyInTypeNamed = function SAWBuyInTypeNamed(type) {
|
|
285
289
|
var _SAWBuyInType$Free$SA;
|
|
286
|
-
return (_SAWBuyInType$Free$SA = {}, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Free] = exports.SAWBuyInTypeName.Free, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Points] = exports.SAWBuyInTypeName.Points, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Spins] = exports.SAWBuyInTypeName.Spins, _SAWBuyInType$Free$SA)[type] || exports.SAWBuyInTypeName.Unknown;
|
|
290
|
+
return (_SAWBuyInType$Free$SA = {}, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Free] = exports.SAWBuyInTypeName.Free, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Points] = exports.SAWBuyInTypeName.Points, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Spins] = exports.SAWBuyInTypeName.Spins, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Gems] = exports.SAWBuyInTypeName.Gems, _SAWBuyInType$Free$SA[exports.SAWBuyInType.Diamonds] = exports.SAWBuyInTypeName.Diamonds, _SAWBuyInType$Free$SA)[type] || exports.SAWBuyInTypeName.Unknown;
|
|
287
291
|
};
|
|
288
292
|
|
|
289
293
|
var SAWUtils = function SAWUtils() {};
|
|
290
|
-
SAWUtils.canPlay = function (t,
|
|
294
|
+
SAWUtils.canPlay = function (t, user) {
|
|
291
295
|
if (t === null || t === undefined) {
|
|
292
296
|
return false;
|
|
293
297
|
}
|
|
@@ -301,8 +305,16 @@ SAWUtils.canPlay = function (t, pointsBalance) {
|
|
|
301
305
|
return t.spin_count !== null && t.spin_count > 0;
|
|
302
306
|
}
|
|
303
307
|
case exports.SAWBuyInType.Points:
|
|
308
|
+
case exports.SAWBuyInType.Gems:
|
|
309
|
+
case exports.SAWBuyInType.Diamonds:
|
|
304
310
|
{
|
|
305
|
-
|
|
311
|
+
var balance = user.ach_points_balance;
|
|
312
|
+
if (t.saw_buyin_type_id === exports.SAWBuyInType.Gems) {
|
|
313
|
+
balance = user.ach_gems_balance;
|
|
314
|
+
} else if (t.saw_buyin_type_id === exports.SAWBuyInType.Diamonds) {
|
|
315
|
+
balance = user.ach_diamonds_balance;
|
|
316
|
+
}
|
|
317
|
+
return t.buyin_cost_points <= balance;
|
|
306
318
|
}
|
|
307
319
|
default:
|
|
308
320
|
{
|
|
@@ -382,6 +394,7 @@ exports.SAWPrizeType = void 0;
|
|
|
382
394
|
SAWPrizeType[SAWPrizeType["CHANGE_LEVEL"] = 7] = "CHANGE_LEVEL";
|
|
383
395
|
SAWPrizeType[SAWPrizeType["MISSION"] = 8] = "MISSION";
|
|
384
396
|
SAWPrizeType[SAWPrizeType["RAFFLE_TICKET"] = 9] = "RAFFLE_TICKET";
|
|
397
|
+
SAWPrizeType[SAWPrizeType["GEMS_AND_DIAMONDS"] = 10] = "GEMS_AND_DIAMONDS";
|
|
385
398
|
})(exports.SAWPrizeType || (exports.SAWPrizeType = {}));
|
|
386
399
|
exports.MiniGamePrizeTypeName = void 0;
|
|
387
400
|
(function (MiniGamePrizeTypeName) {
|
|
@@ -394,12 +407,13 @@ exports.MiniGamePrizeTypeName = void 0;
|
|
|
394
407
|
MiniGamePrizeTypeName["CHANGE_LEVEL"] = "change-level";
|
|
395
408
|
MiniGamePrizeTypeName["MISSION"] = "mission";
|
|
396
409
|
MiniGamePrizeTypeName["RAFFLE_TICKET"] = "raffle-ticket";
|
|
410
|
+
MiniGamePrizeTypeName["GEMS_AND_DIAMONDS"] = "gems-and-diamonds";
|
|
397
411
|
MiniGamePrizeTypeName["UNKNOWN"] = "unknown";
|
|
398
412
|
})(exports.MiniGamePrizeTypeName || (exports.MiniGamePrizeTypeName = {}));
|
|
399
413
|
/** @hidden */
|
|
400
414
|
var MiniGamePrizeTypeNamed = function MiniGamePrizeTypeNamed(type) {
|
|
401
415
|
var _SAWPrizeType$NO_PRIZ;
|
|
402
|
-
return (_SAWPrizeType$NO_PRIZ = {}, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.NO_PRIZE] = exports.MiniGamePrizeTypeName.NO_PRIZE, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.POINTS] = exports.MiniGamePrizeTypeName.POINTS, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.BONUS] = exports.MiniGamePrizeTypeName.BONUS, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.MANUAL] = exports.MiniGamePrizeTypeName.MANUAL, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.SPIN] = exports.MiniGamePrizeTypeName.SPIN, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.JACKPOT] = exports.MiniGamePrizeTypeName.JACKPOT, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.CHANGE_LEVEL] = exports.MiniGamePrizeTypeName.CHANGE_LEVEL, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.MISSION] = exports.MiniGamePrizeTypeName.MISSION, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.RAFFLE_TICKET] = exports.MiniGamePrizeTypeName.RAFFLE_TICKET, _SAWPrizeType$NO_PRIZ)[type] || exports.MiniGamePrizeTypeName.UNKNOWN;
|
|
416
|
+
return (_SAWPrizeType$NO_PRIZ = {}, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.NO_PRIZE] = exports.MiniGamePrizeTypeName.NO_PRIZE, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.POINTS] = exports.MiniGamePrizeTypeName.POINTS, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.BONUS] = exports.MiniGamePrizeTypeName.BONUS, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.MANUAL] = exports.MiniGamePrizeTypeName.MANUAL, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.SPIN] = exports.MiniGamePrizeTypeName.SPIN, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.JACKPOT] = exports.MiniGamePrizeTypeName.JACKPOT, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.CHANGE_LEVEL] = exports.MiniGamePrizeTypeName.CHANGE_LEVEL, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.MISSION] = exports.MiniGamePrizeTypeName.MISSION, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.RAFFLE_TICKET] = exports.MiniGamePrizeTypeName.RAFFLE_TICKET, _SAWPrizeType$NO_PRIZ[exports.SAWPrizeType.GEMS_AND_DIAMONDS] = exports.MiniGamePrizeTypeName.GEMS_AND_DIAMONDS, _SAWPrizeType$NO_PRIZ)[type] || exports.MiniGamePrizeTypeName.UNKNOWN;
|
|
403
417
|
};
|
|
404
418
|
|
|
405
419
|
var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|