cozy-client 45.11.0 → 45.13.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.
@@ -1006,6 +1006,7 @@ var CozyClient = /*#__PURE__*/function () {
1006
1006
  var _this$appMetadata = this.appMetadata,
1007
1007
  slug = _this$appMetadata.slug,
1008
1008
  sourceAccount = _this$appMetadata.sourceAccount,
1009
+ sourceAccountIdentifier = _this$appMetadata.sourceAccountIdentifier,
1009
1010
  version = _this$appMetadata.version;
1010
1011
  var now = new Date().toISOString();
1011
1012
  var cozyMetadata = (0, _get.default)(document, 'cozyMetadata', {});
@@ -1016,6 +1017,7 @@ var CozyClient = /*#__PURE__*/function () {
1016
1017
  doctypeVersion: doctypeVersion,
1017
1018
  createdByApp: slug,
1018
1019
  sourceAccount: sourceAccount,
1020
+ sourceAccountIdentifier: sourceAccountIdentifier,
1019
1021
  createdAt: now,
1020
1022
  createdByAppVersion: version,
1021
1023
  updatedAt: now,
@@ -2703,7 +2705,7 @@ var CozyClient = /*#__PURE__*/function () {
2703
2705
  CozyClient.hooks = CozyClient.hooks || {};
2704
2706
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2705
2707
 
2706
- CozyClient.version = "45.11.0";
2708
+ CozyClient.version = "45.13.0";
2707
2709
 
2708
2710
  _microee.default.mixin(CozyClient);
2709
2711
 
@@ -11,6 +11,7 @@ import {
11
11
  APP_NAME,
12
12
  APP_VERSION,
13
13
  SOURCE_ACCOUNT_ID,
14
+ SOURCE_ACCOUNT_IDENTIFIER,
14
15
  FILE_1
15
16
  } from './__tests__/fixtures'
16
17
  import { withIgnoreConsoleWarn } from './__tests__/console'
@@ -708,6 +709,7 @@ describe('CozyClient', () => {
708
709
  appMetadata: {
709
710
  slug: APP_NAME,
710
711
  sourceAccount: SOURCE_ACCOUNT_ID,
712
+ sourceAccountIdentifier: SOURCE_ACCOUNT_IDENTIFIER,
711
713
  version: APP_VERSION
712
714
  }
713
715
  })
@@ -1079,7 +1081,8 @@ describe('CozyClient', () => {
1079
1081
  version: APP_VERSION
1080
1082
  }
1081
1083
  ],
1082
- sourceAccount: SOURCE_ACCOUNT_ID
1084
+ sourceAccount: SOURCE_ACCOUNT_ID,
1085
+ sourceAccountIdentifier: SOURCE_ACCOUNT_IDENTIFIER
1083
1086
  }
1084
1087
  }
1085
1088
  })
@@ -1099,6 +1102,7 @@ describe('CozyClient', () => {
1099
1102
  doctypeVersion: DOCTYPE_VERSION,
1100
1103
  createdByApp: APP_NAME,
1101
1104
  sourceAccount: SOURCE_ACCOUNT_ID,
1105
+ sourceAccountIdentifier: SOURCE_ACCOUNT_IDENTIFIER,
1102
1106
  createdByAppVersion: APP_VERSION,
1103
1107
  updatedByApps: [
1104
1108
  {
@@ -1128,6 +1132,7 @@ describe('CozyClient', () => {
1128
1132
  doctypeVersion: 42,
1129
1133
  createdByApp: 'My great app',
1130
1134
  sourceAccount: SOURCE_ACCOUNT_ID,
1135
+ sourceAccountIdentifier: SOURCE_ACCOUNT_IDENTIFIER,
1131
1136
  createdByAppVersion: APP_VERSION,
1132
1137
  updatedByApps: [
1133
1138
  {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SCHEMA = exports.SOURCE_ACCOUNT_ID = exports.DOCTYPE_VERSION = exports.APP_VERSION = exports.APP_NAME = exports.FILE_2 = exports.FILE_1 = exports.TODO_WITH_AUTHOR = exports.AUTHORS = exports.TODO_WITH_RELATION = exports.TODOS = exports.TODO_4 = exports.TODO_3 = exports.TODO_2 = exports.TODO_1 = void 0;
6
+ exports.SCHEMA = exports.SOURCE_ACCOUNT_IDENTIFIER = exports.SOURCE_ACCOUNT_ID = exports.DOCTYPE_VERSION = exports.APP_VERSION = exports.APP_NAME = exports.FILE_2 = exports.FILE_1 = exports.TODO_WITH_AUTHOR = exports.AUTHORS = exports.TODO_WITH_RELATION = exports.TODOS = exports.TODO_4 = exports.TODO_3 = exports.TODO_2 = exports.TODO_1 = void 0;
7
7
  var TODO_1 = {
8
8
  _id: 'todo_1',
9
9
  _rev: '4-43bdf4f7123f4d748645ba9536a46daa',
@@ -111,6 +111,8 @@ var DOCTYPE_VERSION = 1;
111
111
  exports.DOCTYPE_VERSION = DOCTYPE_VERSION;
112
112
  var SOURCE_ACCOUNT_ID = '123-456-abc';
113
113
  exports.SOURCE_ACCOUNT_ID = SOURCE_ACCOUNT_ID;
114
+ var SOURCE_ACCOUNT_IDENTIFIER = 'testSourceAccountIdentifier';
115
+ exports.SOURCE_ACCOUNT_IDENTIFIER = SOURCE_ACCOUNT_IDENTIFIER;
114
116
  var SCHEMA = {
115
117
  todos: {
116
118
  doctype: 'io.cozy.todos',
package/dist/types.js CHANGED
@@ -451,6 +451,10 @@ var _dsl = require("./queries/dsl");
451
451
 
452
452
  /**
453
453
  * @typedef {object} AppMetadata
454
+ * @property {string} [slug] - slug of the application/konnector which created this data
455
+ * @property {string} [version] - version of the application/konnector which created this data
456
+ * @property {string} [sourceAccount] - id of the account associated to the konnector which created this data
457
+ * @property {string} [sourceAccountIdentifier] - source account identifier account associated to the konnector which created this data
454
458
  */
455
459
 
456
460
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "45.11.0",
3
+ "version": "45.13.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": "^45.2.0",
21
+ "cozy-stack-client": "^45.13.0",
22
22
  "date-fns": "2.29.3",
23
23
  "json-stable-stringify": "^1.0.1",
24
24
  "lodash": "^4.17.13",
@@ -75,5 +75,5 @@
75
75
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
76
76
  },
77
77
  "sideEffects": false,
78
- "gitHead": "79b5ecaf281762089293158d3a700ee5ef1bcf0f"
78
+ "gitHead": "3fd90b7e7678ddf492c2eef469a4589bb31437b1"
79
79
  }
@@ -145,7 +145,7 @@ declare class CozyClient {
145
145
  * Cozy-Client will automatically call `this.login()` if provided with a token and an uri
146
146
  */
147
147
  constructor(rawOptions?: ClientOptions);
148
- appMetadata: any;
148
+ appMetadata: import("./types").AppMetadata;
149
149
  loginPromise: Promise<void>;
150
150
  options: {
151
151
  client?: object;
@@ -119,6 +119,7 @@ export const APP_NAME: "cozy-client-test";
119
119
  export const APP_VERSION: 2;
120
120
  export const DOCTYPE_VERSION: 1;
121
121
  export const SOURCE_ACCOUNT_ID: "123-456-abc";
122
+ export const SOURCE_ACCOUNT_IDENTIFIER: "testSourceAccountIdentifier";
122
123
  export namespace SCHEMA {
123
124
  export namespace todos {
124
125
  const doctype_2: string;
package/types/types.d.ts CHANGED
@@ -813,7 +813,24 @@ export type FilePlugin = {
813
813
  export type InAppBrowser = {
814
814
  open: Function;
815
815
  };
816
- export type AppMetadata = any;
816
+ export type AppMetadata = {
817
+ /**
818
+ * - slug of the application/konnector which created this data
819
+ */
820
+ slug?: string;
821
+ /**
822
+ * - version of the application/konnector which created this data
823
+ */
824
+ version?: string;
825
+ /**
826
+ * - id of the account associated to the konnector which created this data
827
+ */
828
+ sourceAccount?: string;
829
+ /**
830
+ * - source account identifier account associated to the konnector which created this data
831
+ */
832
+ sourceAccountIdentifier?: string;
833
+ };
817
834
  export type ClientCapabilities = {
818
835
  /**
819
836
  * - Whether OIDC login is possible with this Cozy