@quvel-kit/core 1.3.2 → 1.3.3
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/composables/useQueryMessageHandler.js +1 -1
- package/dist/services/WebSocketService.d.ts.map +1 -1
- package/dist/services/WebSocketService.js +3 -2
- package/dist/utils/assets.d.ts.map +1 -1
- package/dist/utils/assets.js +2 -1
- package/dist/utils/env.d.ts +2 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +1 -8
- package/dist/utils/headers.d.ts.map +1 -1
- package/dist/utils/headers.js +2 -1
- package/dist/utils/logging.js +2 -2
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ export function useQueryMessageHandler(options = {}) {
|
|
|
31
31
|
try {
|
|
32
32
|
const normalized = normalize(decodeURIComponent(rawMessage));
|
|
33
33
|
const translationKey = i18nPrefix + normalized;
|
|
34
|
-
// Only show notification if translation exists
|
|
34
|
+
// Only show notification if the translation exists
|
|
35
35
|
if (!i18n.te(translationKey)) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocketService.d.ts","sourceRoot":"","sources":["../../src/services/WebSocketService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;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oB,CAAA;KAAE,GACvE,OAAO,CAAC,iBAAiB,CAAC;IACvB,SAAS,CAAC,CAAC,GAAG,OAAO,EACzB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,SAAS,GAAG,qBAAqB,CAAA;KAAE,GACzE,OAAO,CAAC,kBAAkB,CAAC;IACxB,SAAS,CAAC,CAAC,GAAG,OAAO,EACzB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,GAClD,OAAO,CAAC,mBAAmB,CAAC;IACzB,SAAS,CAAC,CAAC,GAAG,OAAO,EACzB,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,GACnD,OAAO,CAAC,oBAAoB,CAAC;IAuEhC;;OAEG;IACH,UAAU,IAAI,IAAI;CAMnB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Service for managing Laravel Echo WebSocket connections with Pusher
|
|
5
5
|
*/
|
|
6
6
|
import { Service } from './Service.js';
|
|
7
|
+
import { getEnv } from '../utils/env.js';
|
|
7
8
|
/**
|
|
8
9
|
* WebSocket Service for Laravel Echo connections
|
|
9
10
|
*
|
|
@@ -32,8 +33,8 @@ export class WebSocketService extends Service {
|
|
|
32
33
|
register({ api, config }) {
|
|
33
34
|
this.api = api;
|
|
34
35
|
const broadcasting = config?.broadcasting?.pusher;
|
|
35
|
-
this.apiKey = broadcasting?.key ??
|
|
36
|
-
this.cluster = broadcasting?.options?.cluster ??
|
|
36
|
+
this.apiKey = broadcasting?.key ?? getEnv('VITE_PUSHER_APP_KEY', '');
|
|
37
|
+
this.cluster = broadcasting?.options?.cluster ?? getEnv('VITE_PUSHER_APP_CLUSTER', '');
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Connect to WebSocket server
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGtF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAuBpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,GACrB,eAAe,GAAG,gBAAgB,GAAG,IAAI,CAkD3C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,iBAAiB,GAAG,IAAI,CAgD/E;AA2BD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiEpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CA0GA"}
|
package/dist/utils/assets.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Helper functions for dynamically loading CSS and JS assets
|
|
5
5
|
* Support both client-side and SSR asset injection
|
|
6
6
|
*/
|
|
7
|
+
import { getEnv } from './env.js';
|
|
7
8
|
/**
|
|
8
9
|
* Validates if a URL is safe to load as an asset
|
|
9
10
|
* Prevents loading from potentially malicious sources
|
|
@@ -16,7 +17,7 @@ export function isValidAssetUrl(url) {
|
|
|
16
17
|
}
|
|
17
18
|
const parsedUrl = new URL(url);
|
|
18
19
|
// Only allow HTTPS in production
|
|
19
|
-
if (
|
|
20
|
+
if (getEnv('MODE') === 'production' && parsedUrl.protocol !== 'https:') {
|
|
20
21
|
return false;
|
|
21
22
|
}
|
|
22
23
|
// Allow HTTP/HTTPS
|
package/dist/utils/env.d.ts
CHANGED
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
* @param cast - Optional cast function to convert the value
|
|
14
14
|
* @returns The environment variable value or default
|
|
15
15
|
*/
|
|
16
|
-
export declare function getEnv<T = string>(key: string, defaultValue
|
|
16
|
+
export declare function getEnv<T = string>(key: string, defaultValue: T, cast?: (value: string) => T): T;
|
|
17
|
+
export declare function getEnv<T = string>(key: string, defaultValue?: undefined, cast?: (value: string) => T): T | undefined;
|
|
17
18
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/utils/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AAGH,wBAAgB,MAAM,CAAC,CAAC,GAAG,MAAM,EAC/B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,EACf,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAC1B,CAAC,CAAC;AAGL,wBAAgB,MAAM,CAAC,CAAC,GAAG,MAAM,EAC/B,GAAG,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,SAAS,EACxB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAC1B,CAAC,GAAG,SAAS,CAAC"}
|
package/dist/utils/env.js
CHANGED
|
@@ -5,14 +5,7 @@
|
|
|
5
5
|
* - Browser (Vite): Uses import.meta.env (only VITE_* vars exposed)
|
|
6
6
|
* - SSR (Node.js): Uses process.env
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
* Get environment variable value in an isomorphic way
|
|
10
|
-
*
|
|
11
|
-
* @param key - Environment variable name
|
|
12
|
-
* @param defaultValue - Optional default value
|
|
13
|
-
* @param cast - Optional cast function to convert the value
|
|
14
|
-
* @returns The environment variable value or default
|
|
15
|
-
*/
|
|
8
|
+
// Implementation
|
|
16
9
|
export function getEnv(key, defaultValue, cast) {
|
|
17
10
|
let value;
|
|
18
11
|
if (typeof import.meta !== 'undefined' && import.meta.env) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/utils/headers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/utils/headers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAcvD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAElE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE1D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAE7D"}
|
package/dist/utils/headers.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Centralized header name management matching backend configuration.
|
|
5
5
|
* All header names are configurable via AppConfig or environment variables.
|
|
6
6
|
*/
|
|
7
|
+
import { getEnv } from './env.js';
|
|
7
8
|
/**
|
|
8
9
|
* Get the configured header name or default
|
|
9
10
|
*/
|
|
10
11
|
function getHeaderName(configValue, envKey, defaultValue) {
|
|
11
|
-
return configValue ||
|
|
12
|
+
return configValue || getEnv(envKey, defaultValue);
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Get the Accept-Language header name
|
package/dist/utils/logging.js
CHANGED
|
@@ -6,12 +6,12 @@ import { getEnv } from './env.js';
|
|
|
6
6
|
* Create a logger instance based on configuration
|
|
7
7
|
*/
|
|
8
8
|
export function createLogger(config) {
|
|
9
|
-
const loggerType = getEnv('VITE_LOGGER', LoggerTypeEnum.NULL)
|
|
9
|
+
const loggerType = getEnv('VITE_LOGGER', LoggerTypeEnum.NULL);
|
|
10
10
|
const logLevel = getLogLevel();
|
|
11
11
|
const traceInfo = config?.trace ?? {
|
|
12
12
|
id: '',
|
|
13
13
|
timestamp: new Date().toISOString(),
|
|
14
|
-
environment: getEnv('MODE', 'development')
|
|
14
|
+
environment: getEnv('MODE', 'development'),
|
|
15
15
|
tenant: null,
|
|
16
16
|
runtime: 'client',
|
|
17
17
|
};
|