@arkadiuminc/sdk 2.2.0 → 2.3.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.
@@ -2,7 +2,8 @@ import { ApiGateway as UserApiGateway } from '@arkadium/eagle-user-client';
2
2
  import { UserGameDataApi } from '@arkadium/eagle-user-client/dist/types/api/v1/user-game-data.api';
3
3
  export declare enum ApiEnv {
4
4
  DEV = "DEV",
5
- PROD = "PROD"
5
+ PROD = "PROD",
6
+ STAGING = "STAGING"
6
7
  }
7
8
  export declare enum PaymentsApiEnv {
8
9
  DEV = "https://arenacloud.cdn.arkadiumhosted.com/eagle-payment-api-dev/",
@@ -16,7 +17,7 @@ export declare class Backend {
16
17
  uiOpenRequest: import("../../utils/observable").Observable<boolean>;
17
18
  authStatus: import("../../utils/observable").Observable<boolean>;
18
19
  addEventListener(event: number, cb: () => void): void;
19
- init(e: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
20
+ init(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
20
21
  getSessionStorage(): import("@arkadium/eagle-user-client/dist/types/session-storage").SessionStorage | undefined;
21
22
  checkAuth(): void;
22
23
  isUserAuthorized(): boolean;
@@ -18,10 +18,12 @@ export declare class ArkadiumGameSdk {
18
18
  private timeoutTester;
19
19
  persistence: PersistenceGame;
20
20
  version: string;
21
+ private currentEnv;
21
22
  private arenaPingSender;
22
23
  private arenaPingListener;
23
24
  constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostGame, lifecycle: GameLifecycleContract, ads: GameAdsContract, auth: Auth, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract, persistence: PersistenceGame);
24
25
  initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
26
+ getEnv(): ApiEnv;
25
27
  updateWinReference(target: any): void;
26
28
  debugMode(enabled: boolean): void;
27
29
  }
@@ -1,17 +1,21 @@
1
- const d = "https://developers.arkadium.com/cdn/sdk/v2/sdk.js", a = "https://developers.arkadium.com/cdn/sdk/dev/v2/sdk.js";
2
- var i = /* @__PURE__ */ ((e) => (e.DEV = "DEV", e.PROD = "PROD", e))(i || {});
1
+ const r = "https://developers.arkadium.com/cdn/sdk/v2/sdk.js", i = "https://developers.arkadium.com/cdn/sdk/dev/v2/sdk.js";
2
+ var a = /* @__PURE__ */ ((e) => (e.DEV = "DEV", e.PROD = "PROD", e.STAGING = "STAGING", e))(a || {});
3
3
  let n, t;
4
- function m(e) {
4
+ function m(e = "PROD") {
5
5
  return t ? Promise.resolve(t) : (n || (n = new Promise((o) => {
6
- const s = document.createElement("script"), r = e === "PROD" ? d : a;
7
- s.src = r, s.onload = () => {
8
- globalThis.__GameApi__.getInstance(e).then((c) => {
9
- t = c, o(t);
6
+ const c = [
7
+ "STAGING",
8
+ "PROD"
9
+ /* PROD */
10
+ ].includes(e) ? r : i, s = document.createElement("script");
11
+ s.src = c, s.onload = () => {
12
+ globalThis.__GameApi__.getInstance().then((d) => {
13
+ t = d, o(t);
10
14
  });
11
15
  }, (document.head || document.body).appendChild(s);
12
16
  })), n);
13
17
  }
14
18
  export {
15
- i as Env,
19
+ a as Env,
16
20
  m as getInstance
17
21
  };
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.ArkadiumSdk={}))})(this,function(e){"use strict";const n="https://developers.arkadium.com/cdn/sdk/v2/sdk.js",c="https://developers.arkadium.com/cdn/sdk/dev/v2/sdk.js";var i=(t=>(t.DEV="DEV",t.PROD="PROD",t))(i||{});let d,s;function r(t){return s?Promise.resolve(s):(d||(d=new Promise(u=>{const o=document.createElement("script"),a=t==="PROD"?n:c;o.src=a,o.onload=()=>{globalThis.__GameApi__.getInstance(t).then(m=>{s=m,u(s)})},(document.head||document.body).appendChild(o)})),d)}e.Env=i,e.getInstance=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.ArkadiumSdk={}))})(this,function(e){"use strict";const n="https://developers.arkadium.com/cdn/sdk/v2/sdk.js",c="https://developers.arkadium.com/cdn/sdk/dev/v2/sdk.js";var i=(t=>(t.DEV="DEV",t.PROD="PROD",t.STAGING="STAGING",t))(i||{});let d,s;function r(t="PROD"){return s?Promise.resolve(s):(d||(d=new Promise(u=>{const a=["STAGING","PROD"].includes(t)?n:c,o=document.createElement("script");o.src=a,o.onload=()=>{globalThis.__GameApi__.getInstance().then(l=>{s=l,u(s)})},(document.head||document.body).appendChild(o)})),d)}e.Env=i,e.getInstance=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -2,7 +2,8 @@ import { ArkadiumGameSdk } from './arkadium-game-sdk';
2
2
  declare type API = ArkadiumGameSdk;
3
3
  export declare enum Env {
4
4
  DEV = "DEV",
5
- PROD = "PROD"
5
+ PROD = "PROD",
6
+ STAGING = "STAGING"
6
7
  }
7
- export declare function getInstance(env: Env): Promise<API>;
8
+ export declare function getInstance(env?: Env): Promise<API>;
8
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",
@@ -37,7 +37,8 @@
37
37
  "semantic-release-prepare": "ts-node tools/semantic-release-prepare",
38
38
  "precommit": "lint-staged",
39
39
  "release": "standard-version --skip.tag",
40
- "ci-release": "standard-version && git push --follow-tags origin $(git branch)"
40
+ "ci-release": "standard-version && git push origin && git push origin $(git tag --sort=creatordate | tail -n 1)",
41
+ "prepare": "husky"
41
42
  },
42
43
  "lint-staged": {
43
44
  "{src,test}/**/*.ts": [
@@ -61,8 +62,8 @@
61
62
  "devDependencies": {
62
63
  "@arkadium/eagle-payments-api-client": "^0.0.35",
63
64
  "@arkadium/eagle-user-client": "^0.0.90",
64
- "@commitlint/cli": "^17.0.3",
65
- "@commitlint/config-conventional": "^17.0.3",
65
+ "@commitlint/cli": "^17.8.1",
66
+ "@commitlint/config-conventional": "^17.8.1",
66
67
  "@types/jest": "^28.1.6",
67
68
  "@types/node": "^18.0.6",
68
69
  "colors": "^1.4.0",
@@ -70,7 +71,7 @@
70
71
  "cross-env": "^7.0.3",
71
72
  "cz-conventional-changelog": "^3.3.0",
72
73
  "happy-dom": "^14.0.0",
73
- "husky": "^8.0.1",
74
+ "husky": "^9.0.11",
74
75
  "lint-staged": "^13.0.3",
75
76
  "lodash.camelcase": "^4.3.0",
76
77
  "prettier": "^2.7.1",
@@ -99,6 +100,7 @@
99
100
  },
100
101
  "standard-version": {
101
102
  "commitUrlFormat": "https://arkadiumarena.visualstudio.com/Tech%20Services/_git/arkadium-sdk/commit/{{hash}}",
102
- "compareUrlFormat": "https://arkadiumarena.visualstudio.com/Tech%20Services/_git/arkadium-sdk/branchCompare?baseVersion=GT{{previousTag}}&targetVersion=GT{{currentTag}}&_a=files"
103
+ "compareUrlFormat": "https://arkadiumarena.visualstudio.com/Tech%20Services/_git/arkadium-sdk/branchCompare?baseVersion=GT{{previousTag}}&targetVersion=GT{{currentTag}}&_a=files",
104
+ "releaseCommitMessageFormat": "chore(release): {{currentTag}} [skip ci]"
103
105
  }
104
106
  }