@nymphjs/tilmeld-setup 1.0.0-beta.7 → 1.0.0-beta.8

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
+ # [1.0.0-beta.8](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2023-01-09)
7
+
8
+ ### Features
9
+
10
+ - make entities in nymph client instance specific too ([1029f06](https://github.com/sciactive/nymphjs/commit/1029f061a1ad193e4a8a2dab0186b9a4b517f646))
11
+
6
12
  # [1.0.0-beta.7](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2023-01-05)
7
13
 
8
14
  **Note:** Version bump only for package @nymphjs/tilmeld-setup
@@ -135,8 +135,11 @@
135
135
 
136
136
  <script lang="ts">
137
137
  import { onMount, SvelteComponent } from 'svelte';
138
- import type { ClientConfig, CurrentUserData } from '@nymphjs/tilmeld-client';
139
- import { User } from '@nymphjs/tilmeld-client';
138
+ import type {
139
+ User as UserClass,
140
+ ClientConfig,
141
+ CurrentUserData,
142
+ } from '@nymphjs/tilmeld-client';
140
143
  import { Login, Account } from '@nymphjs/tilmeld-components';
141
144
  import { mdiGithub, mdiMastodon, mdiTwitter } from '@mdi/js';
142
145
  import TopAppBar, { Row, Section, Title } from '@smui/top-app-bar';
@@ -146,6 +149,7 @@
146
149
  import Menu from '@smui/menu';
147
150
  import { Icon, Svg } from '@smui/common';
148
151
 
152
+ import { User } from './nymph';
149
153
  import Intro from './Intro.svelte';
150
154
  import Users from './Users.svelte';
151
155
  import Groups from './Groups.svelte';
@@ -159,7 +163,7 @@
159
163
  let accountMenu: any;
160
164
  let active: typeof SvelteComponentDev = Intro;
161
165
  let clientConfig: ClientConfig;
162
- let user: (User & CurrentUserData) | undefined = undefined;
166
+ let user: (UserClass & CurrentUserData) | undefined = undefined;
163
167
  let userAvatar: string = DEFAULT_AVATAR;
164
168
  let tilmeldAdmin: boolean | undefined = undefined;
165
169
  let accountOpen = false;
@@ -207,7 +211,7 @@
207
211
  },
208
212
  ];
209
213
 
210
- const onLogin = (currentUser: User & CurrentUserData) => {
214
+ const onLogin = (currentUser: UserClass & CurrentUserData) => {
211
215
  user = currentUser;
212
216
  };
213
217
  const onLogout = () => {
@@ -332,7 +332,10 @@
332
332
  ClientConfig,
333
333
  CurrentUserData,
334
334
  } from '@nymphjs/tilmeld-client';
335
- import { Group, User } from '@nymphjs/tilmeld-client';
335
+ import type {
336
+ Group as GroupClass,
337
+ User as UserClass,
338
+ } from '@nymphjs/tilmeld-client';
336
339
  import queryParser from '@nymphjs/query-parser';
337
340
  import {
338
341
  mdiArrowLeft,
@@ -356,14 +359,14 @@
356
359
  import Button from '@smui/button';
357
360
  import { Icon, Label, Svg } from '@smui/common';
358
361
 
359
- import nymph from '../nymph';
362
+ import { nymph, Group, User } from './nymph';
360
363
 
361
364
  const dispatch = createEventDispatcher();
362
365
 
363
- export let entity: Group & AdminGroupData;
366
+ export let entity: GroupClass & AdminGroupData;
364
367
 
365
368
  let clientConfig: ClientConfig | undefined = undefined;
366
- let user: (User & CurrentUserData) | undefined = undefined;
369
+ let user: (UserClass & CurrentUserData) | undefined = undefined;
367
370
  let activeTab: 'General' | 'Parent' | 'Abilities' = 'General';
368
371
  let parentSearch = '';
369
372
  let ability = '';
@@ -424,7 +427,7 @@
424
427
  }
425
428
 
426
429
  let parentsSearching = false;
427
- let parents: (Group & AdminGroupData)[] | undefined = undefined;
430
+ let parents: (GroupClass & AdminGroupData)[] | undefined = undefined;
428
431
  async function searchParents() {
429
432
  parentsSearching = true;
430
433
  failureMessage = undefined;
@@ -96,7 +96,10 @@
96
96
  ClientConfig,
97
97
  CurrentUserData,
98
98
  } from '@nymphjs/tilmeld-client';
99
- import { Group, User } from '@nymphjs/tilmeld-client';
99
+ import type {
100
+ Group as GroupClass,
101
+ User as UserClass,
102
+ } from '@nymphjs/tilmeld-client';
100
103
  import { mdiMagnify, mdiArrowRight, mdiPlus } from '@mdi/js';
101
104
  import CircularProgress from '@smui/circular-progress';
102
105
  import Paper from '@smui/paper';
@@ -105,16 +108,15 @@
105
108
  import Fab from '@smui/fab';
106
109
  import { Icon, Svg } from '@smui/common';
107
110
 
108
- import nymph from '../nymph';
109
-
111
+ import { nymph, Group, User } from './nymph';
110
112
  import GroupEdit from './GroupEdit.svelte';
111
113
 
112
114
  let clientConfig: ClientConfig | undefined = undefined;
113
- let user: (User & CurrentUserData) | undefined = undefined;
115
+ let user: (UserClass & CurrentUserData) | undefined = undefined;
114
116
  let entitySearch = '';
115
117
  let failureMessage: string | undefined = undefined;
116
118
 
117
- let entity: (Group & AdminGroupData) | undefined = undefined;
119
+ let entity: (GroupClass & AdminGroupData) | undefined = undefined;
118
120
 
119
121
  onMount(async () => {
120
122
  user = (await User.current()) ?? undefined;
@@ -124,7 +126,7 @@
124
126
  });
125
127
 
126
128
  let entitiesSearching = false;
127
- let entities: (Group & AdminGroupData)[] | undefined = undefined;
129
+ let entities: (GroupClass & AdminGroupData)[] | undefined = undefined;
128
130
  async function searchEntities() {
129
131
  entitiesSearching = true;
130
132
  failureMessage = undefined;
@@ -568,7 +568,10 @@
568
568
  ClientConfig,
569
569
  CurrentUserData,
570
570
  } from '@nymphjs/tilmeld-client';
571
- import { Group, User } from '@nymphjs/tilmeld-client';
571
+ import type {
572
+ Group as GroupClass,
573
+ User as UserClass,
574
+ } from '@nymphjs/tilmeld-client';
572
575
  import queryParser from '@nymphjs/query-parser';
573
576
  import {
574
577
  mdiArrowLeft,
@@ -592,12 +595,14 @@
592
595
  import Button from '@smui/button';
593
596
  import { Icon, Label, Svg } from '@smui/common';
594
597
 
598
+ import { User, Group } from './nymph';
599
+
595
600
  const dispatch = createEventDispatcher();
596
601
 
597
- export let entity: User & AdminUserData;
602
+ export let entity: UserClass & AdminUserData;
598
603
 
599
604
  let clientConfig: ClientConfig | undefined = undefined;
600
- let user: (User & CurrentUserData) | undefined = undefined;
605
+ let user: (UserClass & CurrentUserData) | undefined = undefined;
601
606
  let sysAdmin = false;
602
607
  let activeTab: 'General' | 'Groups' | 'Abilities' | 'Security' = 'General';
603
608
  let primaryGroupSearch = '';
@@ -690,7 +695,7 @@
690
695
  }
691
696
 
692
697
  let primaryGroupsSearching = false;
693
- let primaryGroups: (Group & AdminGroupData)[] | undefined = undefined;
698
+ let primaryGroups: (GroupClass & AdminGroupData)[] | undefined = undefined;
694
699
  async function searchPrimaryGroups() {
695
700
  primaryGroupsSearching = true;
696
701
  failureMessage = undefined;
@@ -729,7 +734,7 @@
729
734
  }
730
735
 
731
736
  let secondaryGroupsSearching = false;
732
- let secondaryGroups: (Group & AdminGroupData)[] | undefined = undefined;
737
+ let secondaryGroups: (GroupClass & AdminGroupData)[] | undefined = undefined;
733
738
  async function searchSecondaryGroups() {
734
739
  secondaryGroupsSearching = true;
735
740
  failureMessage = undefined;
@@ -96,7 +96,10 @@
96
96
  ClientConfig,
97
97
  CurrentUserData,
98
98
  } from '@nymphjs/tilmeld-client';
99
- import { Group, User } from '@nymphjs/tilmeld-client';
99
+ import type {
100
+ Group as GroupClass,
101
+ User as UserClass,
102
+ } from '@nymphjs/tilmeld-client';
100
103
  import { mdiMagnify, mdiArrowRight, mdiPlus } from '@mdi/js';
101
104
  import CircularProgress from '@smui/circular-progress';
102
105
  import Paper from '@smui/paper';
@@ -105,16 +108,15 @@
105
108
  import Fab from '@smui/fab';
106
109
  import { Icon, Svg } from '@smui/common';
107
110
 
108
- import nymph from '../nymph';
109
-
111
+ import { nymph, User, Group } from './nymph';
110
112
  import UserEdit from './UserEdit.svelte';
111
113
 
112
114
  let clientConfig: ClientConfig | undefined = undefined;
113
- let user: (User & CurrentUserData) | undefined = undefined;
115
+ let user: (UserClass & CurrentUserData) | undefined = undefined;
114
116
  let entitySearch = '';
115
117
  let failureMessage: string | undefined = undefined;
116
118
 
117
- let entity: (User & AdminUserData) | undefined = undefined;
119
+ let entity: (UserClass & AdminUserData) | undefined = undefined;
118
120
 
119
121
  onMount(async () => {
120
122
  user = (await User.current()) ?? undefined;
@@ -124,7 +126,7 @@
124
126
  });
125
127
 
126
128
  let entitiesSearching = false;
127
- let entities: (User & AdminUserData)[] | undefined = undefined;
129
+ let entities: (UserClass & AdminUserData)[] | undefined = undefined;
128
130
  async function searchEntities() {
129
131
  entitiesSearching = true;
130
132
  failureMessage = undefined;
@@ -1,17 +1,21 @@
1
1
  import type { NymphOptions } from '@nymphjs/client';
2
2
  import { Entity, Nymph } from '@nymphjs/client';
3
- import { User, Group } from '@nymphjs/tilmeld-client';
3
+ import {
4
+ User as UserClass,
5
+ Group as GroupClass,
6
+ } from '@nymphjs/tilmeld-client';
4
7
 
5
8
  const nymph = new Nymph(
6
9
  (window as unknown as { nymphOptions: NymphOptions }).nymphOptions
7
10
  );
8
- nymph.addEntityClass(User);
9
- nymph.addEntityClass(Group);
10
-
11
- export default nymph;
11
+ const User = nymph.addEntityClass(UserClass);
12
+ const Group = nymph.addEntityClass(GroupClass);
13
+ User.init(nymph);
12
14
 
13
15
  // Helps with admin and debugging.
14
16
  (window as any).Entity = Entity;
15
17
  (window as any).User = User;
16
18
  (window as any).Group = Group;
17
19
  (window as any).nymph = nymph;
20
+
21
+ export { nymph, User, Group };