cozy-client 37.0.0 → 37.1.1
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/dist/CozyClient.js
CHANGED
|
@@ -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.
|
|
2682
|
+
CozyClient.version = "37.1.1";
|
|
2673
2683
|
|
|
2674
2684
|
_microee.default.mixin(CozyClient);
|
|
2675
2685
|
|
package/dist/CozyClient.spec.js
CHANGED
|
@@ -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' })
|
|
@@ -80,7 +80,7 @@ var generateWebLink = function generateWebLink(_ref) {
|
|
|
80
80
|
url.host = subDomainType === 'nested' ? "".concat(slug, ".").concat(url.host) : url.host.split('.').map(function (x, i) {
|
|
81
81
|
return i === 0 ? x + '-' + slug : x;
|
|
82
82
|
}).join('.');
|
|
83
|
-
url.pathname = pathname;
|
|
83
|
+
url.pathname = ensureFirstSlash(pathname);
|
|
84
84
|
url.hash = ensureFirstSlash(hash);
|
|
85
85
|
|
|
86
86
|
var _iterator = _createForOfIteratorHelper(searchParams),
|
|
@@ -40,6 +40,18 @@ describe('generateWebLink', () => {
|
|
|
40
40
|
})
|
|
41
41
|
).toEqual(`https://drive.alice.cozy.tools/public/#/files/432432`)
|
|
42
42
|
})
|
|
43
|
+
|
|
44
|
+
it('should handle undefined pathname', () => {
|
|
45
|
+
expect(
|
|
46
|
+
generateWebLink({
|
|
47
|
+
cozyUrl: 'https://alice.cozy.tools',
|
|
48
|
+
pathname: undefined,
|
|
49
|
+
hash: 'files/432432',
|
|
50
|
+
slug: 'drive',
|
|
51
|
+
subDomainType: 'nested'
|
|
52
|
+
})
|
|
53
|
+
).toEqual(`https://drive.alice.cozy.tools/#/files/432432`)
|
|
54
|
+
})
|
|
43
55
|
})
|
|
44
56
|
|
|
45
57
|
describe('deconstructWebLink', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.1.1",
|
|
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": "
|
|
76
|
+
"gitHead": "2d76220d11587bf0326a26a5996b453a935e8154"
|
|
77
77
|
}
|
package/types/CozyClient.d.ts
CHANGED
|
@@ -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: {};
|