cozy-client 27.3.2 → 27.6.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.
package/types/types.d.ts CHANGED
@@ -64,24 +64,47 @@ export type QueryOptions = {
64
64
  * - Does not seem to be used
65
65
  */
66
66
  update?: string;
67
+ /**
68
+ * - Callback when the query is errored
69
+ */
70
+ onError?: Function;
67
71
  };
68
72
  export type FetchMoreAble = {
69
73
  fetchMore: Function;
70
74
  };
71
75
  export type UseQueryReturnValue = QueryState & FetchMoreAble;
72
76
  /**
73
- * A reference to a document (special case of a relationship used between photos and albums)
77
+ * A reference to a document
78
+ */
79
+ export type ReferencedByRelationship = {
80
+ parent?: RelationshipParent;
81
+ referenced_by?: ReferencedBy;
82
+ };
83
+ export type RelationshipParent = {
84
+ links: {
85
+ related: string;
86
+ };
87
+ data?: Reference;
88
+ };
89
+ export type ReferencedBy = {
90
+ links: {
91
+ self: string;
92
+ };
93
+ data: Reference[] | null;
94
+ };
95
+ /**
96
+ * A reference to a document
74
97
  * https://docs.cozy.io/en/cozy-doctypes/docs/io.cozy.files/#references
75
98
  */
76
99
  export type Reference = {
77
100
  /**
78
101
  * - id of the document
79
102
  */
80
- _id: string;
103
+ id: string;
81
104
  /**
82
105
  * - doctype of the document
83
106
  */
84
- _type: string;
107
+ type: string;
85
108
  };
86
109
  export type ReferenceMap = {
87
110
  [x: string]: Reference[];
@@ -118,7 +141,11 @@ export type CozyClientDocument = {
118
141
  /**
119
142
  * - Relationships of the document
120
143
  */
121
- relationships?: object;
144
+ relationships?: ReferencedByRelationship;
145
+ /**
146
+ * - referenced by of another document
147
+ */
148
+ referenced_by?: Reference[];
122
149
  };
123
150
  /**
124
151
  * - An io.cozy.files document