kimu-core 0.4.1 → 0.5.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/.editorconfig +116 -30
- package/.gitattributes +81 -11
- package/.github/FUNDING.yml +8 -8
- package/.github/kimu-copilot-instructions.md +3779 -3779
- package/.github/workflows/deploy-demo.yml +39 -39
- package/.nvmrc +1 -0
- package/.prettierignore +44 -0
- package/.prettierrc +16 -0
- package/FUNDING.md +31 -31
- package/icon.svg +10 -10
- package/kimu-core-0.5.0.tgz +0 -0
- package/package.json +10 -3
- package/scripts/minify-css-assets.js +82 -82
- package/src/core/index.ts +47 -47
- package/src/core/kimu-global-styles.ts +136 -136
- package/src/core/kimu-reactive.ts +196 -196
- package/src/extensions/{kimu-home → app-root}/component.ts +5 -5
- package/src/extensions/extensions-manifest.json +4 -4
- package/src/main.ts +3 -3
- package/src/modules-repository/api-axios/CHANGELOG.md +48 -48
- package/src/modules-repository/api-axios/QUICK-REFERENCE.md +178 -178
- package/src/modules-repository/api-axios/README.md +304 -304
- package/src/modules-repository/api-axios/api-axios-service.ts +355 -355
- package/src/modules-repository/api-axios/examples.ts +293 -293
- package/src/modules-repository/api-axios/index.ts +19 -19
- package/src/modules-repository/api-axios/interfaces.ts +71 -71
- package/src/modules-repository/api-axios/module.ts +41 -41
- package/src/modules-repository/api-core/CHANGELOG.md +42 -42
- package/src/modules-repository/api-core/QUICK-REFERENCE.md +192 -192
- package/src/modules-repository/api-core/README.md +435 -435
- package/src/modules-repository/api-core/api-core-service.ts +289 -289
- package/src/modules-repository/api-core/examples.ts +432 -432
- package/src/modules-repository/api-core/index.ts +8 -8
- package/src/modules-repository/api-core/interfaces.ts +83 -83
- package/src/modules-repository/api-core/module.ts +30 -30
- package/src/modules-repository/event-bus/README.md +273 -273
- package/src/modules-repository/event-bus/event-bus-service.ts +176 -176
- package/src/modules-repository/event-bus/module.ts +30 -30
- package/src/modules-repository/notification/README.md +423 -423
- package/src/modules-repository/notification/module.ts +30 -30
- package/src/modules-repository/notification/notification-service.ts +436 -436
- package/src/modules-repository/router/README.it.md +61 -10
- package/src/modules-repository/router/README.md +61 -10
- package/src/modules-repository/router/router-config.ts.example +61 -0
- package/src/modules-repository/router/router.ts +18 -0
- package/src/modules-repository/state/README.md +409 -409
- package/src/modules-repository/state/module.ts +30 -30
- package/src/modules-repository/state/state-service.ts +296 -296
- package/src/modules-repository/theme/README.md +311 -267
- package/src/modules-repository/theme/module.ts +30 -30
- package/src/modules-repository/theme/pre-build.js +40 -40
- package/src/modules-repository/theme/theme-service.ts +411 -389
- package/src/modules-repository/theme/themes/theme-cherry-blossom.css +78 -78
- package/src/modules-repository/theme/themes/theme-cozy.css +111 -111
- package/src/modules-repository/theme/themes/theme-cyberpunk.css +150 -150
- package/src/modules-repository/theme/themes/theme-dark.css +79 -79
- package/src/modules-repository/theme/themes/theme-forest.css +171 -171
- package/src/modules-repository/theme/themes/theme-gold.css +100 -100
- package/src/modules-repository/theme/themes/theme-high-contrast.css +126 -126
- package/src/modules-repository/theme/themes/theme-lava.css +101 -101
- package/src/modules-repository/theme/themes/theme-lavender.css +90 -90
- package/src/modules-repository/theme/themes/theme-light.css +79 -79
- package/src/modules-repository/theme/themes/theme-matrix.css +103 -103
- package/src/modules-repository/theme/themes/theme-midnight.css +81 -81
- package/src/modules-repository/theme/themes/theme-nord.css +94 -94
- package/src/modules-repository/theme/themes/theme-ocean.css +84 -84
- package/src/modules-repository/theme/themes/theme-retro80s.css +343 -343
- package/src/modules-repository/theme/themes/theme-sunset.css +62 -62
- package/src/modules-repository/theme/themes-config-default.json +19 -0
- package/src/modules-repository/theme/themes-config.d.ts +27 -27
- package/src/modules-repository/theme/{themes-config.json → themes-config.json.example} +223 -213
- /package/src/extensions/{kimu-home → app-root}/lang/en.json +0 -0
- /package/src/extensions/{kimu-home → app-root}/lang/it.json +0 -0
- /package/src/extensions/{kimu-home → app-root}/style.css +0 -0
- /package/src/extensions/{kimu-home → app-root}/view.html +0 -0
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP method types supported by the API service
|
|
3
|
-
*/
|
|
4
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Configuration options for HTTP requests
|
|
8
|
-
*/
|
|
9
|
-
export interface ApiRequestConfig {
|
|
10
|
-
/** HTTP headers to include in the request */
|
|
11
|
-
headers?: Record<string, string>;
|
|
12
|
-
/** Query parameters to append to the URL */
|
|
13
|
-
params?: Record<string, string | number | boolean>;
|
|
14
|
-
/** Request timeout in milliseconds */
|
|
15
|
-
timeout?: number;
|
|
16
|
-
/** Whether to include credentials (cookies) in the request */
|
|
17
|
-
withCredentials?: boolean;
|
|
18
|
-
/** Response type expected from the server */
|
|
19
|
-
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
|
20
|
-
/** Callback for upload progress */
|
|
21
|
-
onUploadProgress?: (progressEvent: ProgressEvent) => void;
|
|
22
|
-
/** Callback for download progress */
|
|
23
|
-
onDownloadProgress?: (progressEvent: ProgressEvent) => void;
|
|
24
|
-
/** Custom axios config to merge */
|
|
25
|
-
axiosConfig?: any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Standard API response structure
|
|
30
|
-
*/
|
|
31
|
-
export interface ApiResponse<T = any> {
|
|
32
|
-
/** Response data from the server */
|
|
33
|
-
data: T;
|
|
34
|
-
/** HTTP status code */
|
|
35
|
-
status: number;
|
|
36
|
-
/** HTTP status text */
|
|
37
|
-
statusText: string;
|
|
38
|
-
/** Response headers */
|
|
39
|
-
headers: Record<string, string>;
|
|
40
|
-
/** Original request configuration */
|
|
41
|
-
config: ApiRequestConfig;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Error response structure for failed requests
|
|
46
|
-
*/
|
|
47
|
-
export interface ApiError {
|
|
48
|
-
/** Error message */
|
|
49
|
-
message: string;
|
|
50
|
-
/** HTTP status code (if available) */
|
|
51
|
-
status?: number;
|
|
52
|
-
/** Response data from the server (if available) */
|
|
53
|
-
data?: any;
|
|
54
|
-
/** Original error object */
|
|
55
|
-
originalError?: any;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Interceptor function for requests
|
|
60
|
-
*/
|
|
61
|
-
export type RequestInterceptor = (config: ApiRequestConfig) => ApiRequestConfig | Promise<ApiRequestConfig>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Interceptor function for responses
|
|
65
|
-
*/
|
|
66
|
-
export type ResponseInterceptor = (response: ApiResponse) => ApiResponse | Promise<ApiResponse>;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Interceptor function for errors
|
|
70
|
-
*/
|
|
71
|
-
export type ErrorInterceptor = (error: ApiError) => any;
|
|
1
|
+
/**
|
|
2
|
+
* HTTP method types supported by the API service
|
|
3
|
+
*/
|
|
4
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options for HTTP requests
|
|
8
|
+
*/
|
|
9
|
+
export interface ApiRequestConfig {
|
|
10
|
+
/** HTTP headers to include in the request */
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
/** Query parameters to append to the URL */
|
|
13
|
+
params?: Record<string, string | number | boolean>;
|
|
14
|
+
/** Request timeout in milliseconds */
|
|
15
|
+
timeout?: number;
|
|
16
|
+
/** Whether to include credentials (cookies) in the request */
|
|
17
|
+
withCredentials?: boolean;
|
|
18
|
+
/** Response type expected from the server */
|
|
19
|
+
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
|
|
20
|
+
/** Callback for upload progress */
|
|
21
|
+
onUploadProgress?: (progressEvent: ProgressEvent) => void;
|
|
22
|
+
/** Callback for download progress */
|
|
23
|
+
onDownloadProgress?: (progressEvent: ProgressEvent) => void;
|
|
24
|
+
/** Custom axios config to merge */
|
|
25
|
+
axiosConfig?: any;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Standard API response structure
|
|
30
|
+
*/
|
|
31
|
+
export interface ApiResponse<T = any> {
|
|
32
|
+
/** Response data from the server */
|
|
33
|
+
data: T;
|
|
34
|
+
/** HTTP status code */
|
|
35
|
+
status: number;
|
|
36
|
+
/** HTTP status text */
|
|
37
|
+
statusText: string;
|
|
38
|
+
/** Response headers */
|
|
39
|
+
headers: Record<string, string>;
|
|
40
|
+
/** Original request configuration */
|
|
41
|
+
config: ApiRequestConfig;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Error response structure for failed requests
|
|
46
|
+
*/
|
|
47
|
+
export interface ApiError {
|
|
48
|
+
/** Error message */
|
|
49
|
+
message: string;
|
|
50
|
+
/** HTTP status code (if available) */
|
|
51
|
+
status?: number;
|
|
52
|
+
/** Response data from the server (if available) */
|
|
53
|
+
data?: any;
|
|
54
|
+
/** Original error object */
|
|
55
|
+
originalError?: any;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Interceptor function for requests
|
|
60
|
+
*/
|
|
61
|
+
export type RequestInterceptor = (config: ApiRequestConfig) => ApiRequestConfig | Promise<ApiRequestConfig>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Interceptor function for responses
|
|
65
|
+
*/
|
|
66
|
+
export type ResponseInterceptor = (response: ApiResponse) => ApiResponse | Promise<ApiResponse>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Interceptor function for errors
|
|
70
|
+
*/
|
|
71
|
+
export type ErrorInterceptor = (error: ApiError) => any;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Axios Module
|
|
3
|
-
*
|
|
4
|
-
* Advanced HTTP client module based on Axios library.
|
|
5
|
-
* Provides enhanced features over the basic api-core module.
|
|
6
|
-
*
|
|
7
|
-
* @module api-axios
|
|
8
|
-
* @author UnicòVerso
|
|
9
|
-
* @version 1.0.0
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { KimuModule } from '../../core/kimu-module';
|
|
13
|
-
import { apiAxiosService } from './api-axios-service';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* ApiAxiosModule - Module wrapper for the Axios-based API service
|
|
17
|
-
*
|
|
18
|
-
* This module provides an advanced HTTP client with features like:
|
|
19
|
-
* - Request/response interceptors
|
|
20
|
-
* - Automatic retry logic
|
|
21
|
-
* - Request cancellation
|
|
22
|
-
* - Progress tracking
|
|
23
|
-
* - Response caching
|
|
24
|
-
*/
|
|
25
|
-
export default class ApiAxiosModule extends KimuModule {
|
|
26
|
-
constructor(name = 'api-axios', version = '1.0.0', options?: any) {
|
|
27
|
-
super(name, version, options);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Returns the singleton instance of the API Axios service
|
|
32
|
-
*/
|
|
33
|
-
getService() {
|
|
34
|
-
return apiAxiosService;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Re-export for convenience
|
|
39
|
-
export { apiAxiosService } from './api-axios-service';
|
|
40
|
-
export { ApiAxiosService } from './api-axios-service';
|
|
41
|
-
export * from './interfaces';
|
|
1
|
+
/**
|
|
2
|
+
* API Axios Module
|
|
3
|
+
*
|
|
4
|
+
* Advanced HTTP client module based on Axios library.
|
|
5
|
+
* Provides enhanced features over the basic api-core module.
|
|
6
|
+
*
|
|
7
|
+
* @module api-axios
|
|
8
|
+
* @author UnicòVerso
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { KimuModule } from '../../core/kimu-module';
|
|
13
|
+
import { apiAxiosService } from './api-axios-service';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ApiAxiosModule - Module wrapper for the Axios-based API service
|
|
17
|
+
*
|
|
18
|
+
* This module provides an advanced HTTP client with features like:
|
|
19
|
+
* - Request/response interceptors
|
|
20
|
+
* - Automatic retry logic
|
|
21
|
+
* - Request cancellation
|
|
22
|
+
* - Progress tracking
|
|
23
|
+
* - Response caching
|
|
24
|
+
*/
|
|
25
|
+
export default class ApiAxiosModule extends KimuModule {
|
|
26
|
+
constructor(name = 'api-axios', version = '1.0.0', options?: any) {
|
|
27
|
+
super(name, version, options);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns the singleton instance of the API Axios service
|
|
32
|
+
*/
|
|
33
|
+
getService() {
|
|
34
|
+
return apiAxiosService;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Re-export for convenience
|
|
39
|
+
export { apiAxiosService } from './api-axios-service';
|
|
40
|
+
export { ApiAxiosService } from './api-axios-service';
|
|
41
|
+
export * from './interfaces';
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# API Core Module - Changelog
|
|
2
|
-
|
|
3
|
-
## [1.0.0] - 2025-11-01
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
- Initial release of API Core module
|
|
7
|
-
- Basic HTTP client functionality based on native fetch API
|
|
8
|
-
- Support for all HTTP methods (GET, POST, PUT, PATCH, DELETE)
|
|
9
|
-
- Request/Response/Error interceptors
|
|
10
|
-
- Query parameters and headers management
|
|
11
|
-
- Timeout and request cancellation support
|
|
12
|
-
- Multiple response types (JSON, text, blob, arraybuffer)
|
|
13
|
-
- Global configuration with baseURL
|
|
14
|
-
- TypeScript-first with complete type safety
|
|
15
|
-
- Zero external dependencies (~2KB minified)
|
|
16
|
-
- Comprehensive documentation and examples
|
|
17
|
-
|
|
18
|
-
### Features
|
|
19
|
-
- ✅ Promise-based async/await API
|
|
20
|
-
- ✅ Automatic JSON parsing
|
|
21
|
-
- ✅ Error handling with structured ApiError
|
|
22
|
-
- ✅ Request/Response transformation via interceptors
|
|
23
|
-
- ✅ Configurable timeout
|
|
24
|
-
- ✅ AbortController support for request cancellation
|
|
25
|
-
- ✅ Query parameters serialization
|
|
26
|
-
- ✅ Custom headers support
|
|
27
|
-
- ✅ Credentials and cache mode configuration
|
|
28
|
-
- ✅ Lightweight and performant
|
|
29
|
-
|
|
30
|
-
### Documentation
|
|
31
|
-
- Complete README with usage examples
|
|
32
|
-
- TypeScript interfaces and type definitions
|
|
33
|
-
- Example file with 17+ practical use cases
|
|
34
|
-
- Integration examples with KIMU components
|
|
35
|
-
|
|
36
|
-
### Future Roadmap
|
|
37
|
-
- Automatic retry logic
|
|
38
|
-
- Request caching
|
|
39
|
-
- Request deduplication
|
|
40
|
-
- Upload/Download progress tracking
|
|
41
|
-
- Request queue with priority
|
|
42
|
-
- Mock/test utilities
|
|
1
|
+
# API Core Module - Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.0] - 2025-11-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Initial release of API Core module
|
|
7
|
+
- Basic HTTP client functionality based on native fetch API
|
|
8
|
+
- Support for all HTTP methods (GET, POST, PUT, PATCH, DELETE)
|
|
9
|
+
- Request/Response/Error interceptors
|
|
10
|
+
- Query parameters and headers management
|
|
11
|
+
- Timeout and request cancellation support
|
|
12
|
+
- Multiple response types (JSON, text, blob, arraybuffer)
|
|
13
|
+
- Global configuration with baseURL
|
|
14
|
+
- TypeScript-first with complete type safety
|
|
15
|
+
- Zero external dependencies (~2KB minified)
|
|
16
|
+
- Comprehensive documentation and examples
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
- ✅ Promise-based async/await API
|
|
20
|
+
- ✅ Automatic JSON parsing
|
|
21
|
+
- ✅ Error handling with structured ApiError
|
|
22
|
+
- ✅ Request/Response transformation via interceptors
|
|
23
|
+
- ✅ Configurable timeout
|
|
24
|
+
- ✅ AbortController support for request cancellation
|
|
25
|
+
- ✅ Query parameters serialization
|
|
26
|
+
- ✅ Custom headers support
|
|
27
|
+
- ✅ Credentials and cache mode configuration
|
|
28
|
+
- ✅ Lightweight and performant
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
- Complete README with usage examples
|
|
32
|
+
- TypeScript interfaces and type definitions
|
|
33
|
+
- Example file with 17+ practical use cases
|
|
34
|
+
- Integration examples with KIMU components
|
|
35
|
+
|
|
36
|
+
### Future Roadmap
|
|
37
|
+
- Automatic retry logic
|
|
38
|
+
- Request caching
|
|
39
|
+
- Request deduplication
|
|
40
|
+
- Upload/Download progress tracking
|
|
41
|
+
- Request queue with priority
|
|
42
|
+
- Mock/test utilities
|