cozy-sharing 25.3.0 → 25.3.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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.3.1](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.3.0...cozy-sharing@25.3.1) (2025-05-07)
7
+
8
+ ### Bug Fixes
9
+
10
+ - Do not rely on attributes ([a77602c](https://github.com/cozy/cozy-libs/commit/a77602cfbbce6b08296578b12863c631251f99a4))
11
+
6
12
  # [25.3.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@25.2.0...cozy-sharing@25.3.0) (2025-04-28)
7
13
 
8
14
  ### Features
@@ -326,8 +326,15 @@ export const PERM_WITHOUT_DOC = {
326
326
 
327
327
  export const APPS = [
328
328
  {
329
- type: 'io.cozy.apps',
329
+ _type: 'io.cozy.apps',
330
330
  id: 'io.cozy.apps/drive',
331
+ _id: 'io.cozy.apps/drive',
332
+ name: 'Drive',
333
+ name_prefix: 'Cozy',
334
+ editor: 'Cozy',
335
+ type: 'webapp',
336
+ slug: 'drive',
337
+ state: 'ready',
331
338
  attributes: {
332
339
  name: 'Drive',
333
340
  name_prefix: 'Cozy',
@@ -343,8 +350,15 @@ export const APPS = [
343
350
  }
344
351
  },
345
352
  {
346
- type: 'io.cozy.apps',
353
+ _type: 'io.cozy.apps',
347
354
  id: 'io.cozy.apps/photos',
355
+ _id: 'io.cozy.apps/photos',
356
+ name: 'Photos',
357
+ name_prefix: 'Cozy',
358
+ editor: 'Cozy',
359
+ type: 'webapp',
360
+ slug: 'photos',
361
+ state: 'ready',
348
362
  attributes: {
349
363
  name: 'Photos',
350
364
  name_prefix: 'Cozy',
package/dist/state.js CHANGED
@@ -743,7 +743,7 @@ var getAppUrlForDoctype = function getAppUrlForDoctype(state, documentType) {
743
743
 
744
744
  var getAppUrl = function getAppUrl(apps, appName) {
745
745
  var app = apps.find(function (a) {
746
- return a.attributes.slug === appName && a.attributes.state === 'ready';
746
+ return (a === null || a === void 0 ? void 0 : a.slug) === appName && (a === null || a === void 0 ? void 0 : a.state) === 'ready';
747
747
  });
748
748
 
749
749
  if (!app) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-sharing",
3
- "version": "25.3.0",
3
+ "version": "25.3.1",
4
4
  "description": "Provides sharing login for React applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -79,5 +79,5 @@
79
79
  "sideEffects": [
80
80
  "*.css"
81
81
  ],
82
- "gitHead": "0b4c6250306923e1107739de17d8541aba51a425"
82
+ "gitHead": "61ca8961df0f9a50cf58348d90fbfdd67f36b22b"
83
83
  }
package/src/state.js CHANGED
@@ -621,9 +621,7 @@ const getAppUrlForDoctype = (state, documentType) => {
621
621
  }
622
622
 
623
623
  const getAppUrl = (apps, appName) => {
624
- const app = apps.find(
625
- a => a.attributes.slug === appName && a.attributes.state === 'ready'
626
- )
624
+ const app = apps.find(a => a?.slug === appName && a?.state === 'ready')
627
625
  if (!app) {
628
626
  throw new Error(`Sharing link: app ${appName} not installed`)
629
627
  }