mezon-sdk 2.7.4 → 2.7.6

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/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ transform: {
3
+ '^.+\\.ts?$': 'ts-jest',
4
+ },
5
+ testEnvironment: 'node',
6
+ testRegex: './src/.*\\.(test|spec)?\\.(ts|ts)$',
7
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
8
+ roots: ['<rootDir>/src'],
9
+ };
package/nodemon.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "watch": ["src"],
3
+ "ext": ".ts,.js",
4
+ "ignore": [],
5
+ "exec": "npx ts-node ./src/index.ts"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-sdk",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs",
6
6
  "docs": "typedoc index.ts --gaID UA-89839802-1 --out ../../docs"
package/utils.ts CHANGED
@@ -4,14 +4,6 @@ export function buildFetchOptions(method: string, options: any, bodyJson: string
4
4
  const fetchOptions = {...{ method: method }, ...options};
5
5
  fetchOptions.headers = {...options.headers};
6
6
 
7
- const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
8
-
9
- // in Cocos Creator, XMLHttpRequest.withCredentials is not writable, so make the fetch
10
- // polyfill avoid writing to it.
11
- if (!descriptor?.set) {
12
- fetchOptions.credentials = 'cocos-ignore'; // string value is arbitrary, cannot be 'omit' or 'include
13
- }
14
-
15
7
  if(!Object.keys(fetchOptions.headers).includes("Accept")) {
16
8
  fetchOptions.headers["Accept"] = "application/json";
17
9
  }