cozy-client 33.1.2 → 33.2.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.
@@ -2572,16 +2572,15 @@ var CozyClient = /*#__PURE__*/function () {
2572
2572
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2573
2573
  var env = envArg || (typeof process !== 'undefined' ? process.env : {});
2574
2574
  var COZY_URL = env.COZY_URL,
2575
- COZY_CREDENTIALS = env.COZY_CREDENTIALS,
2576
- NODE_ENV = env.NODE_ENV;
2575
+ COZY_CREDENTIALS = env.COZY_CREDENTIALS;
2577
2576
 
2578
2577
  if (!COZY_URL || !COZY_CREDENTIALS) {
2579
2578
  throw new Error('Env used to instantiate CozyClient must have COZY_URL and COZY_CREDENTIALS');
2580
2579
  }
2581
2580
 
2582
- if (NODE_ENV === 'development') {
2581
+ try {
2583
2582
  options.oauth = JSON.parse(COZY_CREDENTIALS);
2584
- } else {
2583
+ } catch (err) {
2585
2584
  options.token = COZY_CREDENTIALS.trim();
2586
2585
  }
2587
2586
 
@@ -2645,7 +2644,7 @@ var CozyClient = /*#__PURE__*/function () {
2645
2644
  CozyClient.hooks = CozyClient.hooks || {};
2646
2645
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2647
2646
 
2648
- CozyClient.version = "33.1.2";
2647
+ CozyClient.version = "33.2.0";
2649
2648
 
2650
2649
  _microee.default.mixin(CozyClient);
2651
2650
 
@@ -121,8 +121,7 @@ describe('CozyClient initialization', () => {
121
121
  }
122
122
  client = CozyClient.fromEnv({
123
123
  COZY_URL: url,
124
- COZY_CREDENTIALS: JSON.stringify(creds),
125
- NODE_ENV: 'development'
124
+ COZY_CREDENTIALS: JSON.stringify(creds)
126
125
  })
127
126
  expect(client.stackClient.uri).toBe(url)
128
127
  expect(client.stackClient.token.accessToken).toBe(token)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "33.1.2",
3
+ "version": "33.2.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "@types/jest": "^26.0.20",
19
19
  "@types/lodash": "^4.14.170",
20
20
  "btoa": "^1.2.1",
21
- "cozy-stack-client": "^33.1.2",
21
+ "cozy-stack-client": "^33.2.0",
22
22
  "json-stable-stringify": "^1.0.1",
23
23
  "lodash": "^4.17.13",
24
24
  "microee": "^0.0.6",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "f681dd45241daca68dcc6dca0160ce6db9360958"
76
+ "gitHead": "c885c3dc10144c8e809a4ee4b97c1339638aef9b"
77
77
  }