File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: CC0-1.0
44 */
55import { expect , test } from 'vitest'
6- import { Type } from '.'
6+ import { ShareType } from '.'
77
88test ( 'ShareType' , ( ) => {
9- for ( const type of Object . values ( Type ) ) {
9+ for ( const type of Object . values ( ShareType ) ) {
1010 if ( typeof type === 'string' ) {
1111 // This should be the key of the enum, so we should be able to get the value
1212 // eslint-disable-next-line @typescript-eslint/no-explicit-any
13- expect ( ( Type as any ) [ type ] ) . toBeTypeOf ( 'number' )
13+ expect ( ( ShareType as any ) [ type ] ) . toBeTypeOf ( 'number' )
1414 } else {
1515 expect ( type ) . toBeTypeOf ( 'number' )
16- expect ( Type [ type ] ) . toBeTypeOf ( 'string' )
16+ expect ( ShareType [ type ] ) . toBeTypeOf ( 'string' )
1717 }
1818 }
1919} )
Original file line number Diff line number Diff line change 1+ /**
2+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
3+ * SPDX-License-Identifier: GPL-3.0-or-later
4+ */
5+
6+ /** @deprecated will be removed with the next version use `ShareType` instead */
17export enum Type {
28 SHARE_TYPE_USER = 0 ,
39 SHARE_TYPE_GROUP = 1 ,
@@ -14,3 +20,23 @@ export enum Type {
1420 */
1521 SHARE_TYPE_FEDERATED_GROUP = 14 ,
1622}
23+
24+ export enum ShareType {
25+ User = 0 ,
26+ Grup = 1 ,
27+ Link = 3 ,
28+ Email = 4 ,
29+ Remote = 6 ,
30+ /**
31+ * Was called `Circle` before Nextcloud 29
32+ */
33+ Team = 7 ,
34+ Guest = 8 ,
35+ RemoteGroup = 9 ,
36+ Room = 10 ,
37+ Deck = 12 ,
38+ /**
39+ * @since 26.0.0
40+ */
41+ FederatedGroup = 14 ,
42+ }
You can’t perform that action at this time.
0 commit comments