@ezeep/ezeep-js 1.0.249 → 1.0.251
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/dist/cjs/ezp-auth_15.cjs.entry.js +29 -6
- package/dist/collection/components/ezp-printing/ezp-printing.js +27 -5
- package/dist/collection/services/auth.js +2 -1
- package/dist/custom-elements/index.js +29 -6
- package/dist/esm/ezp-auth_15.entry.js +29 -6
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-2562e9cb.entry.js → p-5a3c83af.entry.js} +2 -2
- package/dist/ezeep/{p-aebf439e.system.entry.js → p-71b4dead.system.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +5 -0
- package/dist/types/services/auth.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +13 -7
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-2562e9cb.entry.js → p-5a3c83af.entry.js} +2 -2
- package/www/build/{p-aebf439e.system.entry.js → p-71b4dead.system.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/index.html +1 -13
|
@@ -3180,7 +3180,7 @@ class EzpAuthorizationService {
|
|
|
3180
3180
|
});
|
|
3181
3181
|
}
|
|
3182
3182
|
refreshTokens() {
|
|
3183
|
-
fetch(this.accessTokenURL, {
|
|
3183
|
+
return fetch(this.accessTokenURL, {
|
|
3184
3184
|
credentials: 'include',
|
|
3185
3185
|
headers: {
|
|
3186
3186
|
Authorization: 'Basic ' + btoa(this.clientID + ':'),
|
|
@@ -3203,6 +3203,7 @@ class EzpAuthorizationService {
|
|
|
3203
3203
|
localStorage.setItem('refreshToken', this.refreshToken);
|
|
3204
3204
|
authStore.state.refreshToken = this.refreshToken;
|
|
3205
3205
|
authStore.state.isAuthorized = true;
|
|
3206
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
3206
3207
|
}
|
|
3207
3208
|
});
|
|
3208
3209
|
}
|
|
@@ -33784,9 +33785,9 @@ let EzpPrinting = class {
|
|
|
33784
33785
|
// Store the refresh token in the same way as the component does in self-managed auth
|
|
33785
33786
|
authStore.state.refreshToken = refreshToken;
|
|
33786
33787
|
localStorage.setItem('refreshToken', refreshToken);
|
|
33787
|
-
//
|
|
33788
|
-
|
|
33789
|
-
|
|
33788
|
+
// Use the refresh token to obtain a valid access token
|
|
33789
|
+
// This ensures the user doesn't see the login dialog
|
|
33790
|
+
await this.auth.refreshTokens();
|
|
33790
33791
|
}
|
|
33791
33792
|
async checkAuth() {
|
|
33792
33793
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
@@ -33815,6 +33816,28 @@ let EzpPrinting = class {
|
|
|
33815
33816
|
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
33816
33817
|
return authStore.state.isAuthorized;
|
|
33817
33818
|
}
|
|
33819
|
+
/**
|
|
33820
|
+
* Normalizes a URL or hostname to just the hostname without protocol
|
|
33821
|
+
* Accepts both "hostname" and "https://hostname" formats
|
|
33822
|
+
*/
|
|
33823
|
+
normalizeHostUrl(hostUrl) {
|
|
33824
|
+
if (!hostUrl) {
|
|
33825
|
+
return hostUrl;
|
|
33826
|
+
}
|
|
33827
|
+
// If it starts with http:// or https://, extract just the hostname
|
|
33828
|
+
try {
|
|
33829
|
+
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
33830
|
+
const url = new URL(hostUrl);
|
|
33831
|
+
return url.host;
|
|
33832
|
+
}
|
|
33833
|
+
}
|
|
33834
|
+
catch (e) {
|
|
33835
|
+
// If URL parsing fails, return the original value
|
|
33836
|
+
console.warn('Failed to parse URL:', hostUrl, e);
|
|
33837
|
+
}
|
|
33838
|
+
// Return as-is if it's already just a hostname
|
|
33839
|
+
return hostUrl;
|
|
33840
|
+
}
|
|
33818
33841
|
refreshTokensPeriodically(seconds) {
|
|
33819
33842
|
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
33820
33843
|
setInterval(() => {
|
|
@@ -33831,13 +33854,13 @@ let EzpPrinting = class {
|
|
|
33831
33854
|
userStore.state.theme = this.theme;
|
|
33832
33855
|
userStore.state.appearance = this.appearance;
|
|
33833
33856
|
if (this.authapihosturl) {
|
|
33834
|
-
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
33857
|
+
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
33835
33858
|
}
|
|
33836
33859
|
else {
|
|
33837
33860
|
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
33838
33861
|
}
|
|
33839
33862
|
if (this.printapihosturl) {
|
|
33840
|
-
printStore.state.printApiHostUrl = this.printapihosturl;
|
|
33863
|
+
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
33841
33864
|
}
|
|
33842
33865
|
else {
|
|
33843
33866
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
@@ -166,9 +166,9 @@ export class EzpPrinting {
|
|
|
166
166
|
// Store the refresh token in the same way as the component does in self-managed auth
|
|
167
167
|
authStore.state.refreshToken = refreshToken;
|
|
168
168
|
localStorage.setItem('refreshToken', refreshToken);
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
// Use the refresh token to obtain a valid access token
|
|
170
|
+
// This ensures the user doesn't see the login dialog
|
|
171
|
+
await this.auth.refreshTokens();
|
|
172
172
|
}
|
|
173
173
|
async checkAuth() {
|
|
174
174
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
@@ -197,6 +197,28 @@ export class EzpPrinting {
|
|
|
197
197
|
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
198
198
|
return authStore.state.isAuthorized;
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Normalizes a URL or hostname to just the hostname without protocol
|
|
202
|
+
* Accepts both "hostname" and "https://hostname" formats
|
|
203
|
+
*/
|
|
204
|
+
normalizeHostUrl(hostUrl) {
|
|
205
|
+
if (!hostUrl) {
|
|
206
|
+
return hostUrl;
|
|
207
|
+
}
|
|
208
|
+
// If it starts with http:// or https://, extract just the hostname
|
|
209
|
+
try {
|
|
210
|
+
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
211
|
+
const url = new URL(hostUrl);
|
|
212
|
+
return url.host;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch (e) {
|
|
216
|
+
// If URL parsing fails, return the original value
|
|
217
|
+
console.warn('Failed to parse URL:', hostUrl, e);
|
|
218
|
+
}
|
|
219
|
+
// Return as-is if it's already just a hostname
|
|
220
|
+
return hostUrl;
|
|
221
|
+
}
|
|
200
222
|
refreshTokensPeriodically(seconds) {
|
|
201
223
|
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
202
224
|
setInterval(() => {
|
|
@@ -213,13 +235,13 @@ export class EzpPrinting {
|
|
|
213
235
|
userStore.state.theme = this.theme;
|
|
214
236
|
userStore.state.appearance = this.appearance;
|
|
215
237
|
if (this.authapihosturl) {
|
|
216
|
-
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
238
|
+
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
217
239
|
}
|
|
218
240
|
else {
|
|
219
241
|
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
220
242
|
}
|
|
221
243
|
if (this.printapihosturl) {
|
|
222
|
-
printStore.state.printApiHostUrl = this.printapihosturl;
|
|
244
|
+
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
223
245
|
}
|
|
224
246
|
else {
|
|
225
247
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
@@ -73,7 +73,7 @@ export class EzpAuthorizationService {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
refreshTokens() {
|
|
76
|
-
fetch(this.accessTokenURL, {
|
|
76
|
+
return fetch(this.accessTokenURL, {
|
|
77
77
|
credentials: 'include',
|
|
78
78
|
headers: {
|
|
79
79
|
Authorization: 'Basic ' + btoa(this.clientID + ':'),
|
|
@@ -96,6 +96,7 @@ export class EzpAuthorizationService {
|
|
|
96
96
|
localStorage.setItem('refreshToken', this.refreshToken);
|
|
97
97
|
authStore.state.refreshToken = this.refreshToken;
|
|
98
98
|
authStore.state.isAuthorized = true;
|
|
99
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
}
|
|
@@ -3189,7 +3189,7 @@ class EzpAuthorizationService {
|
|
|
3189
3189
|
});
|
|
3190
3190
|
}
|
|
3191
3191
|
refreshTokens() {
|
|
3192
|
-
fetch(this.accessTokenURL, {
|
|
3192
|
+
return fetch(this.accessTokenURL, {
|
|
3193
3193
|
credentials: 'include',
|
|
3194
3194
|
headers: {
|
|
3195
3195
|
Authorization: 'Basic ' + btoa(this.clientID + ':'),
|
|
@@ -3212,6 +3212,7 @@ class EzpAuthorizationService {
|
|
|
3212
3212
|
localStorage.setItem('refreshToken', this.refreshToken);
|
|
3213
3213
|
authStore.state.refreshToken = this.refreshToken;
|
|
3214
3214
|
authStore.state.isAuthorized = true;
|
|
3215
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
3215
3216
|
}
|
|
3216
3217
|
});
|
|
3217
3218
|
}
|
|
@@ -33811,9 +33812,9 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33811
33812
|
// Store the refresh token in the same way as the component does in self-managed auth
|
|
33812
33813
|
authStore.state.refreshToken = refreshToken;
|
|
33813
33814
|
localStorage.setItem('refreshToken', refreshToken);
|
|
33814
|
-
//
|
|
33815
|
-
|
|
33816
|
-
|
|
33815
|
+
// Use the refresh token to obtain a valid access token
|
|
33816
|
+
// This ensures the user doesn't see the login dialog
|
|
33817
|
+
await this.auth.refreshTokens();
|
|
33817
33818
|
}
|
|
33818
33819
|
async checkAuth() {
|
|
33819
33820
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
@@ -33842,6 +33843,28 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33842
33843
|
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
33843
33844
|
return authStore.state.isAuthorized;
|
|
33844
33845
|
}
|
|
33846
|
+
/**
|
|
33847
|
+
* Normalizes a URL or hostname to just the hostname without protocol
|
|
33848
|
+
* Accepts both "hostname" and "https://hostname" formats
|
|
33849
|
+
*/
|
|
33850
|
+
normalizeHostUrl(hostUrl) {
|
|
33851
|
+
if (!hostUrl) {
|
|
33852
|
+
return hostUrl;
|
|
33853
|
+
}
|
|
33854
|
+
// If it starts with http:// or https://, extract just the hostname
|
|
33855
|
+
try {
|
|
33856
|
+
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
33857
|
+
const url = new URL(hostUrl);
|
|
33858
|
+
return url.host;
|
|
33859
|
+
}
|
|
33860
|
+
}
|
|
33861
|
+
catch (e) {
|
|
33862
|
+
// If URL parsing fails, return the original value
|
|
33863
|
+
console.warn('Failed to parse URL:', hostUrl, e);
|
|
33864
|
+
}
|
|
33865
|
+
// Return as-is if it's already just a hostname
|
|
33866
|
+
return hostUrl;
|
|
33867
|
+
}
|
|
33845
33868
|
refreshTokensPeriodically(seconds) {
|
|
33846
33869
|
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
33847
33870
|
setInterval(() => {
|
|
@@ -33858,13 +33881,13 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33858
33881
|
userStore.state.theme = this.theme;
|
|
33859
33882
|
userStore.state.appearance = this.appearance;
|
|
33860
33883
|
if (this.authapihosturl) {
|
|
33861
|
-
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
33884
|
+
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
33862
33885
|
}
|
|
33863
33886
|
else {
|
|
33864
33887
|
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
33865
33888
|
}
|
|
33866
33889
|
if (this.printapihosturl) {
|
|
33867
|
-
printStore.state.printApiHostUrl = this.printapihosturl;
|
|
33890
|
+
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
33868
33891
|
}
|
|
33869
33892
|
else {
|
|
33870
33893
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
@@ -3176,7 +3176,7 @@ class EzpAuthorizationService {
|
|
|
3176
3176
|
});
|
|
3177
3177
|
}
|
|
3178
3178
|
refreshTokens() {
|
|
3179
|
-
fetch(this.accessTokenURL, {
|
|
3179
|
+
return fetch(this.accessTokenURL, {
|
|
3180
3180
|
credentials: 'include',
|
|
3181
3181
|
headers: {
|
|
3182
3182
|
Authorization: 'Basic ' + btoa(this.clientID + ':'),
|
|
@@ -3199,6 +3199,7 @@ class EzpAuthorizationService {
|
|
|
3199
3199
|
localStorage.setItem('refreshToken', this.refreshToken);
|
|
3200
3200
|
authStore.state.refreshToken = this.refreshToken;
|
|
3201
3201
|
authStore.state.isAuthorized = true;
|
|
3202
|
+
localStorage.setItem('isAuthorized', 'true');
|
|
3202
3203
|
}
|
|
3203
3204
|
});
|
|
3204
3205
|
}
|
|
@@ -33780,9 +33781,9 @@ let EzpPrinting = class {
|
|
|
33780
33781
|
// Store the refresh token in the same way as the component does in self-managed auth
|
|
33781
33782
|
authStore.state.refreshToken = refreshToken;
|
|
33782
33783
|
localStorage.setItem('refreshToken', refreshToken);
|
|
33783
|
-
//
|
|
33784
|
-
|
|
33785
|
-
|
|
33784
|
+
// Use the refresh token to obtain a valid access token
|
|
33785
|
+
// This ensures the user doesn't see the login dialog
|
|
33786
|
+
await this.auth.refreshTokens();
|
|
33786
33787
|
}
|
|
33787
33788
|
async checkAuth() {
|
|
33788
33789
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
@@ -33811,6 +33812,28 @@ let EzpPrinting = class {
|
|
|
33811
33812
|
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
33812
33813
|
return authStore.state.isAuthorized;
|
|
33813
33814
|
}
|
|
33815
|
+
/**
|
|
33816
|
+
* Normalizes a URL or hostname to just the hostname without protocol
|
|
33817
|
+
* Accepts both "hostname" and "https://hostname" formats
|
|
33818
|
+
*/
|
|
33819
|
+
normalizeHostUrl(hostUrl) {
|
|
33820
|
+
if (!hostUrl) {
|
|
33821
|
+
return hostUrl;
|
|
33822
|
+
}
|
|
33823
|
+
// If it starts with http:// or https://, extract just the hostname
|
|
33824
|
+
try {
|
|
33825
|
+
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
33826
|
+
const url = new URL(hostUrl);
|
|
33827
|
+
return url.host;
|
|
33828
|
+
}
|
|
33829
|
+
}
|
|
33830
|
+
catch (e) {
|
|
33831
|
+
// If URL parsing fails, return the original value
|
|
33832
|
+
console.warn('Failed to parse URL:', hostUrl, e);
|
|
33833
|
+
}
|
|
33834
|
+
// Return as-is if it's already just a hostname
|
|
33835
|
+
return hostUrl;
|
|
33836
|
+
}
|
|
33814
33837
|
refreshTokensPeriodically(seconds) {
|
|
33815
33838
|
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
33816
33839
|
setInterval(() => {
|
|
@@ -33827,13 +33850,13 @@ let EzpPrinting = class {
|
|
|
33827
33850
|
userStore.state.theme = this.theme;
|
|
33828
33851
|
userStore.state.appearance = this.appearance;
|
|
33829
33852
|
if (this.authapihosturl) {
|
|
33830
|
-
authStore.state.authApiHostUrl = this.authapihosturl;
|
|
33853
|
+
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
33831
33854
|
}
|
|
33832
33855
|
else {
|
|
33833
33856
|
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
33834
33857
|
}
|
|
33835
33858
|
if (this.printapihosturl) {
|
|
33836
|
-
printStore.state.printApiHostUrl = this.printapihosturl;
|
|
33859
|
+
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
33837
33860
|
}
|
|
33838
33861
|
else {
|
|
33839
33862
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|