cozy-client 37.0.0 → 37.1.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.
@@ -2507,6 +2507,16 @@ var CozyClient = /*#__PURE__*/function () {
2507
2507
  uri: this.options.uri
2508
2508
  });
2509
2509
  }
2510
+ /**
2511
+ *
2512
+ * @param {AppMetadata} newAppMetadata AppMetadata to update
2513
+ */
2514
+
2515
+ }, {
2516
+ key: "setAppMetadata",
2517
+ value: function setAppMetadata(newAppMetadata) {
2518
+ this.appMetadata = _objectSpread(_objectSpread({}, this.appMetadata), newAppMetadata);
2519
+ }
2510
2520
  }], [{
2511
2521
  key: "fromOldClient",
2512
2522
  value: function fromOldClient(oldClient, options) {
@@ -2669,7 +2679,7 @@ var CozyClient = /*#__PURE__*/function () {
2669
2679
  CozyClient.hooks = CozyClient.hooks || {};
2670
2680
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2671
2681
 
2672
- CozyClient.version = "37.0.0";
2682
+ CozyClient.version = "37.1.0";
2673
2683
 
2674
2684
  _microee.default.mixin(CozyClient);
2675
2685
 
@@ -698,7 +698,13 @@ describe('CozyClient', () => {
698
698
  afterEach(() => {
699
699
  requestHandler.mockReset()
700
700
  })
701
-
701
+ describe('setAppMetadata', () => {
702
+ it('should update the appMetadata', () => {
703
+ client.setAppMetadata({ slug: 'test' })
704
+ expect(client.appMetadata.slug).toEqual('test')
705
+ expect(client.appMetadata.sourceAccount).toEqual(SOURCE_ACCOUNT_ID)
706
+ })
707
+ })
702
708
  describe('all', () => {
703
709
  it('should return a QueryDefinition', () => {
704
710
  expect(Q('io.cozy.todos')).toEqual({ doctype: 'io.cozy.todos' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "37.0.0",
3
+ "version": "37.1.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -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": "8b77eee1c29144f87de42bc3b0d46127430a6510"
76
+ "gitHead": "fd111e1f673a3b82d9d2899f07590582ca5326a4"
77
77
  }
@@ -708,6 +708,11 @@ declare class CozyClient {
708
708
  */
709
709
  setOnError(onError?: Function): void;
710
710
  toJSON(): SnapshotClient;
711
+ /**
712
+ *
713
+ * @param {AppMetadata} newAppMetadata AppMetadata to update
714
+ */
715
+ setAppMetadata(newAppMetadata: AppMetadata): void;
711
716
  }
712
717
  declare namespace CozyClient {
713
718
  export const hooks: {};