@kalamba/sdk 0.6.0 → 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/dist/wrapper.d.ts CHANGED
@@ -58,7 +58,7 @@ declare abstract class CasinoPlugin {
58
58
  declare type ContractPlayPayload = {
59
59
  [key: string]: any;
60
60
  bet: Bet | null;
61
- forceOutcome?: unknown;
61
+ forcedOutcomes?: unknown;
62
62
  };
63
63
 
64
64
  declare type DeepPartial<T> = T extends object ? {
@@ -81,12 +81,6 @@ declare type DomainToMessagePayloadMap = {
81
81
  telemetry: TelemetryOnlyMessagePayloadMap;
82
82
  };
83
83
 
84
- declare type Error_2 = {
85
- message: string;
86
- messageKey: string;
87
- type: 'CLOSE' | 'RELOAD' | 'CONTINUE';
88
- };
89
-
90
84
  declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
91
85
 
92
86
  declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix> {
@@ -131,27 +125,6 @@ declare type MessageMap = DomainAllowedPayloadMap<'sdk'> & DomainAllowedPayloadM
131
125
 
132
126
  declare type MessagePayload<M extends Message> = MessageMap[M];
133
127
 
134
- declare type OpenGameError = {
135
- type: 'timeout';
136
- } | {
137
- type: 'error';
138
- data: {
139
- code: keyof typeof OpenGameErrorCode;
140
- };
141
- };
142
-
143
- declare const OpenGameErrorCode: {
144
- readonly CONNECTION_ERROR: "CONNECTION_ERROR";
145
- readonly ALREADY_LOGGED_IN: "ALREADY_LOGGED_IN";
146
- readonly DENIED: "DENIED";
147
- readonly NOT_FOUND: "NOT_FOUND";
148
- readonly BONUS_RESTRICTION: "BONUS_RESTRICTION";
149
- readonly ERROR: "ERROR";
150
- readonly GAME_UNAVAILABLE: "GAME_UNAVAILABLE";
151
- readonly RECONNECT_DATA_MISMATCH: "RECONNECT_DATA_MISMATCH";
152
- readonly TOO_MANY_OPEN_GAMES: "TOO_MANY_OPEN_GAMES";
153
- };
154
-
155
128
  declare type OpenGameRequest = {
156
129
  gameName: string;
157
130
  /** version of game client */
@@ -200,25 +173,6 @@ declare type OpenGameResponse = {
200
173
  data: unknown;
201
174
  };
202
175
 
203
- declare type PlayError = {
204
- type: 'timeout';
205
- } | {
206
- type: 'error';
207
- data: {
208
- code: keyof typeof PlayErrorCode;
209
- };
210
- };
211
-
212
- declare const PlayErrorCode: {
213
- readonly ERROR: "ERROR";
214
- readonly GAMING_LIMITS_REACHED: "GAMING_LIMITS_REACHED";
215
- readonly INVALID_CURRENCY: "INVALID_CURRENCY";
216
- readonly INVALID_SESSION: "INVALID_SESSION";
217
- readonly OUT_OF_MONEY: "OUT_OF_MONEY";
218
- readonly UNFINISHED_ROUND_IN_PROGRESS: "UNFINISHED_ROUND_IN_PROGRESS";
219
- readonly WALLET_ERROR: "WALLET_ERROR";
220
- };
221
-
222
176
  declare type PlayRequest = {
223
177
  contract: ContractPlayPayload;
224
178
  extra?: unknown;
@@ -279,10 +233,56 @@ declare type RealityCheckConfig = {
279
233
  showSumWins: boolean;
280
234
  };
281
235
 
236
+ declare type RgsError = {
237
+ type: 'timeout';
238
+ } | {
239
+ type: 'error';
240
+ data: RgsErrorData;
241
+ };
242
+
243
+ declare const RgsErrorCode: {
244
+ readonly CONNECTION_ERROR: "CONNECTION_ERROR";
245
+ readonly INVALID_BET_CURRENCY: "INVALID_BET_CURRENCY";
246
+ readonly INVALID_BET: "INVALID_BET";
247
+ readonly INVALID_CAGE_CODE: "INVALID_CAGE_CODE";
248
+ readonly INVALID_CLIENT_TYPE: "INVALID_CLIENT_TYPE";
249
+ readonly INVALID_MESSAGE_FORMAT: "INVALID_MESSAGE_FORMAT";
250
+ readonly INVALID_SESSION: "INVALID_SESSION";
251
+ readonly TOO_HIGH_BET_FREQUENCY: "TOO_HIGH_BET_FREQUENCY";
252
+ readonly TOO_HIGH_ACTION_FREQUENCY: "TOO_HIGH_ACTION_FREQUENCY";
253
+ readonly USER_LOCK_INVALID_PARAMS: "USER_LOCK_INVALID_PARAMS";
254
+ readonly USER_ALREADY_LOCKED: "USER_ALREADY_LOCKED";
255
+ readonly GAME_SERVER_ERROR: "GAME_SERVER_ERROR";
256
+ readonly SESSION_MANAGEMENT_ERROR: "SESSION_MANAGEMENT_ERROR";
257
+ readonly MESSAGE_SENDER_ERROR: "MESSAGE_SENDER_ERROR";
258
+ readonly FREE_ROUNDS_PROCESSING_ERROR: "FREE_ROUNDS_PROCESSING_ERROR";
259
+ readonly WEB_SESSION_NOT_OPEN: "WEB_SESSION_NOT_OPEN";
260
+ readonly GAMING_LIMITS_REACHED: "GAMING_LIMITS_REACHED";
261
+ readonly OUT_OF_MONEY: "OUT_OF_MONEY";
262
+ readonly UNFINISHED_ROUND_IN_PROGRESS: "UNFINISHED_ROUND_IN_PROGRESS";
263
+ readonly ACCESS_DENIED: "ACCESS_DENIED";
264
+ readonly CREDENTIALS_NOT_FOUND: "CREDENTIALS_NOT_FOUND";
265
+ readonly ALREADY_LOGGED_IN: "ALREADY_LOGGED_IN";
266
+ readonly GAME_UNAVAILABLE: "GAME_UNAVAILABLE";
267
+ readonly BONUS_RESTRICTION: "BONUS_RESTRICTION";
268
+ readonly TOO_MANY_OPEN_GAMES: "TOO_MANY_OPEN_GAMES";
269
+ readonly GAME_FROZEN: "GAME_FROZEN";
270
+ readonly WALLET_PROCESSING_ERROR: "WALLET_PROCESSING_ERROR";
271
+ readonly FORCED_OUTCOMES_NOT_ALLOWED: "FORCED_OUTCOMES_NOT_ALLOWED";
272
+ readonly MISSING_GAME_STATE: "MISSING_GAME_STATE";
273
+ readonly DATA_ACCESS_ERROR: "DATA_ACCESS_ERROR";
274
+ readonly UNKNOWN: "UNKNOWN";
275
+ };
276
+
277
+ declare type RgsErrorData = {
278
+ code: keyof typeof RgsErrorCode;
279
+ details?: unknown;
280
+ };
281
+
282
282
  declare type RgsOnlyMessagePayloadMap = {
283
- openGameError: OpenGameError;
283
+ openGameError: RgsError;
284
284
  openGameResponse: OpenGameResponse;
285
- playError: PlayError;
285
+ playError: RgsError;
286
286
  playResponse: PlayResponse;
287
287
  realityCheck: {
288
288
  duration: number;
@@ -367,6 +367,15 @@ export declare abstract class SdkConfigManager {
367
367
  abstract getConfig(): Promise<SdkConfig['ui']>;
368
368
  }
369
369
 
370
+ declare type SdkError = {
371
+ messageCode: string;
372
+ type: 'CLOSE' | 'RELOAD' | 'CONTINUE';
373
+ } & ({
374
+ message: string;
375
+ } | {
376
+ messageKey: string;
377
+ });
378
+
370
379
  declare type SdkOnlyMessagePayloadMap = {
371
380
  autoplay: {
372
381
  action: 'start' | 'stop' | 'pause' | 'resume';
@@ -384,7 +393,7 @@ declare type SdkOnlyMessagePayloadMap = {
384
393
  }[];
385
394
  };
386
395
  close: never;
387
- error: Error_2;
396
+ error: SdkError;
388
397
  fullscreen: {
389
398
  lock?: OrientationLockType;
390
399
  };
@@ -403,6 +412,18 @@ declare type SdkOnlyMessagePayloadMap = {
403
412
  ready: boolean;
404
413
  };
405
414
  playStart: ContractPlayPayload;
415
+ /**
416
+ * ```typescript
417
+ * {
418
+ * en: {
419
+ * 'generic_error': 'Something went wrong',
420
+ * },
421
+ * pl: {
422
+ * 'generic_error': 'Coś poszło nie tak',
423
+ * }
424
+ * }
425
+ * ```
426
+ */
406
427
  translations: Record<string, Record<string, string>>;
407
428
  settings: Settings;
408
429
  'telemetry.click': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalamba/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,5 +0,0 @@
1
- /**
2
- * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
4
- */
5
- "use strict";var R=Object.defineProperty;var _=(N,E,r)=>E in N?R(N,E,{enumerable:!0,configurable:!0,writable:!0,value:r}):N[E]=r;var O=(N,E,r)=>(_(N,typeof E!="symbol"?E+"":E,r),r);const I={CONNECTION_ERROR:"CONNECTION_ERROR",ALREADY_LOGGED_IN:"ALREADY_LOGGED_IN",DENIED:"DENIED",NOT_FOUND:"NOT_FOUND",BONUS_RESTRICTION:"BONUS_RESTRICTION",ERROR:"ERROR",GAME_UNAVAILABLE:"GAME_UNAVAILABLE",RECONNECT_DATA_MISMATCH:"RECONNECT_DATA_MISMATCH",TOO_MANY_OPEN_GAMES:"TOO_MANY_OPEN_GAMES"},A={ERROR:"ERROR",GAMING_LIMITS_REACHED:"GAMING_LIMITS_REACHED",INVALID_CURRENCY:"INVALID_CURRENCY",INVALID_SESSION:"INVALID_SESSION",OUT_OF_MONEY:"OUT_OF_MONEY",UNFINISHED_ROUND_IN_PROGRESS:"UNFINISHED_ROUND_IN_PROGRESS",WALLET_ERROR:"WALLET_ERROR"};class o extends Error{constructor(r){super();O(this,"data");this.name="OpenGameError",this.data=r}}class e extends Error{constructor(r){super();O(this,"data");this.name="PlayError",this.data=r}}class t extends Error{constructor(){super(),this.name="TimeoutError"}}exports.OpenGameError=o;exports.OpenGameErrorCode=I;exports.PlayError=e;exports.PlayErrorCode=A;exports.TimeoutError=t;
@@ -1,52 +0,0 @@
1
- /**
2
- * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
4
- */
5
- var r = Object.defineProperty;
6
- var _ = (O, E, N) => E in O ? r(O, E, { enumerable: !0, configurable: !0, writable: !0, value: N }) : O[E] = N;
7
- var R = (O, E, N) => (_(O, typeof E != "symbol" ? E + "" : E, N), N);
8
- const A = {
9
- CONNECTION_ERROR: "CONNECTION_ERROR",
10
- ALREADY_LOGGED_IN: "ALREADY_LOGGED_IN",
11
- DENIED: "DENIED",
12
- NOT_FOUND: "NOT_FOUND",
13
- BONUS_RESTRICTION: "BONUS_RESTRICTION",
14
- ERROR: "ERROR",
15
- GAME_UNAVAILABLE: "GAME_UNAVAILABLE",
16
- RECONNECT_DATA_MISMATCH: "RECONNECT_DATA_MISMATCH",
17
- TOO_MANY_OPEN_GAMES: "TOO_MANY_OPEN_GAMES"
18
- }, s = {
19
- ERROR: "ERROR",
20
- GAMING_LIMITS_REACHED: "GAMING_LIMITS_REACHED",
21
- INVALID_CURRENCY: "INVALID_CURRENCY",
22
- INVALID_SESSION: "INVALID_SESSION",
23
- OUT_OF_MONEY: "OUT_OF_MONEY",
24
- UNFINISHED_ROUND_IN_PROGRESS: "UNFINISHED_ROUND_IN_PROGRESS",
25
- WALLET_ERROR: "WALLET_ERROR"
26
- };
27
- class a extends Error {
28
- constructor(N) {
29
- super();
30
- R(this, "data");
31
- this.name = "OpenGameError", this.data = N;
32
- }
33
- }
34
- class T extends Error {
35
- constructor(N) {
36
- super();
37
- R(this, "data");
38
- this.name = "PlayError", this.data = N;
39
- }
40
- }
41
- class o extends Error {
42
- constructor() {
43
- super(), this.name = "TimeoutError";
44
- }
45
- }
46
- export {
47
- a as O,
48
- T as P,
49
- o as T,
50
- A as a,
51
- s as b
52
- };