@opexa/portal-sdk 0.59.78 → 0.59.79

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.
@@ -39,5 +39,5 @@ function callIfFn(value, ...args) {
39
39
  }
40
40
 
41
41
  export { callIfFn, gql, statusCodeToOperationError };
42
- //# sourceMappingURL=chunk-ROBGEUSE.js.map
43
- //# sourceMappingURL=chunk-ROBGEUSE.js.map
42
+ //# sourceMappingURL=chunk-WVFSGB7Y.js.map
43
+ //# sourceMappingURL=chunk-WVFSGB7Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/gql.ts","../src/utils/status-code-to-operation-error.ts","../src/utils/call-if-fn.ts"],"names":[],"mappings":";AAAO,SAAS,GAAA,CAAI,YAAkC,MAAA,EAAmB;AACxE,EAAA,IAAI,MAAA,GAAS,EAAA;AAEb,EAAA,KAAA,MAAW,CAAC,KAAA,EAAO,MAAM,CAAA,IAAK,OAAA,CAAQ,SAAQ,EAAG;AAChD,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,EAAA,CAAG,KAAK,CAAA,IAAK,EAAA;AAElC,IAAA,MAAA,GAAS,CAAA,EAAG,MAAM,CAAA,EAAG,MAAM,GAAG,KAAK,CAAA,CAAA;AAAA,EACpC;AAEA,EAAA,OAAO,OAAO,IAAA,EAAK;AACpB;;;ACRO,SAAS,0BAAA,CACf,OACA,OAAA,EAC4B;AAC5B,EAAA,MAAM,CAAA,GAAI,UAAU,KAAK,CAAA,GAAI,UAAU,KAAK,CAAA,GAAI,UAAU,GAAG,CAAA;AAE7D,EAAA,OAAO;AAAA,IACN,MAAM,CAAA,CAAE,IAAA;AAAA,IACR,OAAA,EAAS,WAAW,CAAA,CAAE;AAAA,GACvB;AACD;AAEA,IAAM,SAAA,GAAuD;AAAA,EAC5D,GAAA,EAAK,EAAE,IAAA,EAAM,gBAAA,EAAkB,SAAS,aAAA,EAAc;AAAA,EACtD,GAAA,EAAK,EAAE,IAAA,EAAM,kBAAA,EAAoB,SAAS,cAAA,EAAe;AAAA,EACzD,GAAA,EAAK,EAAE,IAAA,EAAM,eAAA,EAAiB,SAAS,WAAA,EAAY;AAAA,EACnD,GAAA,EAAK,EAAE,IAAA,EAAM,cAAA,EAAgB,SAAS,WAAA,EAAY;AAAA,EAClD,GAAA,EAAK,EAAE,IAAA,EAAM,oBAAA,EAAsB,SAAS,iBAAA,EAAkB;AAAA,EAC9D,GAAA,EAAK,EAAE,IAAA,EAAM,qBAAA,EAAuB,SAAS,mBAAA,EAAoB;AAAA,EACjE,GAAA,EAAK,EAAE,IAAA,EAAM,yBAAA,EAA2B,SAAS,uBAAA;AAClD,CAAA;;;ACtBA,SAAS,WACR,KAAA,EACuC;AACvC,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA;AACzB;AAEO,SAAS,QAAA,CACf,UACG,IAAA,EACF;AACD,EAAA,IAAI,UAAA,CAAyB,KAAK,CAAA,EAAG;AACpC,IAAA,OAAO,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACrB,CAAA,MAAO;AACN,IAAA,OAAO,KAAA;AAAA,EACR;AACD","file":"chunk-WVFSGB7Y.js","sourcesContent":["export function gql(strings: TemplateStringsArray, ...values: unknown[]) {\r\n\tlet result = '';\r\n\r\n\tfor (const [index, string] of strings.entries()) {\r\n\t\tconst value = values.at(index) ?? '';\r\n\r\n\t\tresult = `${result}${string}${value}`;\r\n\t}\r\n\r\n\treturn result.trim();\r\n}\r\n","import type { HttpError, OperationError } from '../types/index.js';\r\n\r\nexport function statusCodeToOperationError(\r\n\tvalue: number,\r\n\tmessage?: string,\r\n): OperationError<HttpError> {\r\n\tconst e = ERROR_MAP[value] ? ERROR_MAP[value] : ERROR_MAP[500];\r\n\r\n\treturn {\r\n\t\tname: e.name,\r\n\t\tmessage: message ?? e.message,\r\n\t};\r\n}\r\n\r\nconst ERROR_MAP: Record<number, OperationError<HttpError>> = {\r\n\t400: { name: 'HttpBadRequest', message: 'Bad Request' },\r\n\t401: { name: 'HttpUnauthorized', message: 'Unauthorized' },\r\n\t403: { name: 'HttpForbidden', message: 'Forbidden' },\r\n\t404: { name: 'HttpNotFound', message: 'Not Found' },\r\n\t408: { name: 'HttpRequestTimeout', message: 'Request Timeout' },\r\n\t429: { name: 'HttpTooManyRequests', message: 'Too Many Requests' },\r\n\t500: { name: 'HttpInternalServerError', message: 'Internal Server Error' },\r\n};\r\n","function isFunction<Return, Args = never>(\r\n\tvalue: unknown | ((...args: Args[]) => Return),\r\n): value is (...args: Args[]) => Return {\r\n\treturn typeof value === 'function';\r\n}\r\n\r\nexport function callIfFn<Return, Args = never>(\r\n\tvalue: Return | ((...args: Args[]) => Return),\r\n\t...args: Args[]\r\n) {\r\n\tif (isFunction<Return, Args>(value)) {\r\n\t\treturn value(...args);\r\n\t} else {\r\n\t\treturn value;\r\n\t}\r\n}\r\n"]}
package/dist/index.cjs CHANGED
@@ -3380,13 +3380,13 @@ var RECENT_GAMES_QUERY = gql`
3380
3380
  }
3381
3381
  `;
3382
3382
  var ADD_FAVORITE_GAME_MUTATION = gql`
3383
- mutation AddFavoriteGame($game: ObjectId!) {
3384
- addFavoriteGame(input: { game: $game })
3383
+ mutation AddFavoriteGame($input: AddFavoriteGameInput!) {
3384
+ addFavoriteGame(input: $input)
3385
3385
  }
3386
3386
  `;
3387
3387
  var REMOVE_FAVORITE_GAME_MUTATION = gql`
3388
- mutation RemoveFavoriteGame($game: ObjectId!) {
3389
- removeFavoriteGame(input: { game: $game })
3388
+ mutation RemoveFavoriteGame($input: RemoveFavoriteGameInput!) {
3389
+ removeFavoriteGame(input: $input)
3390
3390
  }
3391
3391
  `;
3392
3392
  var WALLET_GAMES_QUERY = gql`
@@ -4683,6 +4683,12 @@ var AuthService = class {
4683
4683
  async destroySession(accessToken, version = 1) {
4684
4684
  const headers = new Headers(this.headers);
4685
4685
  headers.append("Authorization", `Bearer ${accessToken}`);
4686
+ if (version === 3 || version === 4) {
4687
+ const fingerprint = await getFingerPrint();
4688
+ if (fingerprint) {
4689
+ headers.append("Fingerprint", fingerprint);
4690
+ }
4691
+ }
4686
4692
  try {
4687
4693
  const res = await fetch(
4688
4694
  `${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,
@@ -11832,10 +11838,10 @@ var Sdk = class {
11832
11838
  };
11833
11839
  }
11834
11840
  async addFavoriteGame(input) {
11835
- return await this.portalService.addFavoriteGame(input);
11841
+ return await this.portalService.addFavoriteGame({ input });
11836
11842
  }
11837
11843
  async removeFavoriteGame(input) {
11838
- return await this.portalService.removeFavoriteGame(input);
11844
+ return await this.portalService.removeFavoriteGame({ input });
11839
11845
  }
11840
11846
  /*
11841
11847
  *=============================================