@thzero/library_client_svelte 0.17.8 → 0.17.10
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/boot/baseServices.js +3 -3
- package/boot/main.js +16 -2
- package/license.md +1 -1
- package/package.json +4 -4
- package/service/baseUser.js +10 -10
- package/service/router.js +2 -2
package/boot/baseServices.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import LibraryClientUtility from '@thzero/library_client/utility/index';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import RootServicesBaseBoot from '@thzero/library_client/boot/rootServices';
|
|
4
4
|
|
|
5
5
|
import eventService from '../service/event';
|
|
6
6
|
import routerService from '../service/router';
|
|
7
7
|
import storeService from '../service/store';
|
|
8
8
|
import translateService from '../service/translate';
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class SveleteRootServicesBaseBoot extends RootServicesBaseBoot {
|
|
11
11
|
_initializeInjector(framework, injector) {
|
|
12
12
|
LibraryClientUtility.$injector = injector;
|
|
13
13
|
}
|
|
@@ -29,4 +29,4 @@ class SvelteServicesBaseBoot extends ServicesBaseBoot {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export default
|
|
32
|
+
export default SveleteRootServicesBaseBoot;
|
package/boot/main.js
CHANGED
|
@@ -4,11 +4,12 @@ import LibraryClientUtility from '@thzero/library_client/utility/index';
|
|
|
4
4
|
import {} from '@thzero/library_common/utility/string';
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line
|
|
7
|
-
async function start(app, storeRequest, bootFiles, starter) {
|
|
7
|
+
async function start(app, storeRequest, bootFiles, starter, options) {
|
|
8
8
|
let store = null;
|
|
9
9
|
if (storeRequest) {
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
const temp = new storeRequest();
|
|
12
|
+
store = temp.initialize();
|
|
12
13
|
}
|
|
13
14
|
catch (err) {
|
|
14
15
|
console.log(err);
|
|
@@ -20,6 +21,19 @@ async function start(app, storeRequest, bootFiles, starter) {
|
|
|
20
21
|
throw Error('Unable to create store.');
|
|
21
22
|
LibraryClientUtility.$store = store;
|
|
22
23
|
|
|
24
|
+
if (options) {
|
|
25
|
+
if (options.idGenerator) {
|
|
26
|
+
if (options.idGenerator.override)
|
|
27
|
+
LibraryCommonUtility.setIdGenerator(options.idGenerator.override);
|
|
28
|
+
if (options.idGenerator.alphabet)
|
|
29
|
+
LibraryCommonUtility.setIdGeneratorAlphabet(options.idGenerator.alphabet);
|
|
30
|
+
if (options.idGenerator.lengthLong)
|
|
31
|
+
LibraryCommonUtility.setIdGeneratorLengthLong(options.idGenerator.lengthLong);
|
|
32
|
+
if (options.idGenerator.lengthShort)
|
|
33
|
+
LibraryCommonUtility.setIdGeneratorLengthShort(options.idGenerator.lengthShort);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
if (bootFiles && (bootFiles.length > 0)) {
|
|
24
38
|
let obj;
|
|
25
39
|
for (const bootFile of bootFiles) {
|
package/license.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
3
|
+
Copyright (c) 2021-2024 thZero.com
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_client_svelte",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.10",
|
|
4
4
|
"version_major": 0,
|
|
5
5
|
"version_minor": 17,
|
|
6
|
-
"version_patch":
|
|
7
|
-
"version_date": "
|
|
6
|
+
"version_patch": 10,
|
|
7
|
+
"version_date": "01/14/2024",
|
|
8
8
|
"description": "An opinionated library of common functionality to bootstrap a Svelte based SPA application.",
|
|
9
9
|
"author": "thZero",
|
|
10
10
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@thzero/library_common": "^0.17",
|
|
26
26
|
"mitt": "^3.0.1",
|
|
27
27
|
"svelte-i18n": "^4.0.0",
|
|
28
|
-
"svelte-spa-router": "^4.0.
|
|
28
|
+
"svelte-spa-router": "^4.0.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"svelte": "^4"
|
package/service/baseUser.js
CHANGED
|
@@ -2,7 +2,7 @@ import LibraryClientConstants from '@thzero/library_client/constants';
|
|
|
2
2
|
|
|
3
3
|
import BaseUserService from '@thzero/library_client/service/baseUser';
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class SvelteBaseUserService extends BaseUserService {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
|
|
@@ -16,34 +16,34 @@ class VueBaseUserService extends BaseUserService {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async resetUser(correlationId) {
|
|
19
|
-
await this._serviceStore.
|
|
19
|
+
await this._serviceStore.store.user.dispatcher.resetUser(correlationId);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async setAuthCompleted(correlationId) {
|
|
23
|
-
await this._serviceStore.
|
|
23
|
+
await this._serviceStore.store.user.dispatcher.setAuthCompleted(correlationId, true);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async setClaims(correlationId, claims) {
|
|
27
|
-
await this._serviceStore.
|
|
27
|
+
await this._serviceStore.store.user.dispatcher.setClaims(correlationId, claims);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async setLoggedIn(correlationId, value) {
|
|
31
|
-
await this._serviceStore.
|
|
31
|
+
await this._serviceStore.store.user.dispatcher.setLoggedIn(correlationId, value);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
async setTokenResult(correlationId, tokenResult) {
|
|
35
|
-
await this._serviceStore.
|
|
35
|
+
await this._serviceStore.store.user.dispatcher.setTokenResult(correlationId, tokenResult);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async setUser(correlationId, user) {
|
|
39
|
-
await this._serviceStore.
|
|
39
|
+
await this._serviceStore.store.user.dispatcher.setUser(correlationId, user);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
get token() {
|
|
43
|
-
if (this._serviceStore.
|
|
44
|
-
return this._serviceStore.
|
|
43
|
+
if (this._serviceStore.store.user)
|
|
44
|
+
return this._serviceStore.store.user.token;
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export default
|
|
49
|
+
export default SvelteBaseUserService;
|
package/service/router.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { push } from 'svelte-spa-router';
|
|
2
2
|
|
|
3
3
|
import RouterService from '@thzero/library_client/service/router';
|
|
4
4
|
|
|
5
5
|
class SvelteRouterService extends RouterService {
|
|
6
6
|
// eslint-disable-next-line
|
|
7
7
|
route(path, options) {
|
|
8
|
-
|
|
8
|
+
push(path);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|