septor-store 1.0.1 → 1.1.0
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/README.md +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -118,8 +118,8 @@ app.use(pinia);
|
|
|
118
118
|
// functions.ts
|
|
119
119
|
import { pomPinia,setBearerToken,getBearerToken } from "septor-store"
|
|
120
120
|
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const pomStore = pomPinia('myCustomStoreId')|| pomPinia();
|
|
122
|
+
|
|
123
123
|
// Example: Call API and store data
|
|
124
124
|
const fetchData = async () => {
|
|
125
125
|
const data = await pomStore.stateGenaratorApi({
|
package/dist/index.cjs
CHANGED
|
@@ -75,9 +75,9 @@ var requestHandler = (request) => {
|
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
request.headers = { ...(request == null ? void 0 : request.headers) ?? {} };
|
|
79
|
+
if (token)
|
|
79
80
|
request.headers.Authorization = `Bearer ${token}`;
|
|
80
|
-
}
|
|
81
81
|
if (request.data instanceof FormData) {
|
|
82
82
|
const formData = request.data;
|
|
83
83
|
request.data = formData;
|
package/dist/index.d.cts
CHANGED
|
@@ -22,15 +22,13 @@ const requestHandler = (request) => {
|
|
|
22
22
|
const now = Date.now();
|
|
23
23
|
if (expiresIn && (now - timestamp) > (expiresIn * 1000)) {
|
|
24
24
|
console.warn("Token has expired.");
|
|
25
|
-
localStorage.removeItem("logginToken");
|
|
25
|
+
localStorage.removeItem("logginToken");
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
if (token)
|
|
29
|
+
request.headers = {...(request?.headers??{}),} || {};
|
|
30
|
+
if (token)
|
|
31
31
|
request.headers.Authorization = `Bearer ${token}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
32
|
// Handle FormData explicitly if needed
|
|
35
33
|
if (request.data instanceof FormData) {
|
|
36
34
|
const formData = request.data;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,15 +22,13 @@ const requestHandler = (request) => {
|
|
|
22
22
|
const now = Date.now();
|
|
23
23
|
if (expiresIn && (now - timestamp) > (expiresIn * 1000)) {
|
|
24
24
|
console.warn("Token has expired.");
|
|
25
|
-
localStorage.removeItem("logginToken");
|
|
25
|
+
localStorage.removeItem("logginToken");
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
if (token)
|
|
29
|
+
request.headers = {...(request?.headers??{}),} || {};
|
|
30
|
+
if (token)
|
|
31
31
|
request.headers.Authorization = `Bearer ${token}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
32
|
// Handle FormData explicitly if needed
|
|
35
33
|
if (request.data instanceof FormData) {
|
|
36
34
|
const formData = request.data;
|
package/dist/index.js
CHANGED
|
@@ -35,9 +35,9 @@ var requestHandler = (request) => {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
request.headers = { ...(request == null ? void 0 : request.headers) ?? {} };
|
|
39
|
+
if (token)
|
|
39
40
|
request.headers.Authorization = `Bearer ${token}`;
|
|
40
|
-
}
|
|
41
41
|
if (request.data instanceof FormData) {
|
|
42
42
|
const formData = request.data;
|
|
43
43
|
request.data = formData;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A powerful, modular state management solution for Vue 3 applications, built on top of Pinia. Septor Store leverages the Plain Old Module (POM) pattern to provide dynamic store generation, intelligent API request handling, smart caching, and clean separation of concerns—making it ideal for scalable, maintainable, and high-performance frontend development.",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0
|
|
6
|
+
"version": "1.1.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.cjs",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"author": "Ssengendo Nazil",
|
|
72
72
|
"repository": {
|
|
73
73
|
"type": "git",
|
|
74
|
-
"url": "https://github.com/ssengedonazil/septor-store-testing.git"
|
|
74
|
+
"url": "git+https://github.com/ssengedonazil/septor-store-testing.git"
|
|
75
75
|
},
|
|
76
76
|
"bugs": {
|
|
77
77
|
"url": "https://github.com/ssengedonazil/septor-store-testing.git/issues"
|