@intellegens/cornerstone-client 0.0.45 → 0.0.9999-alpha-2

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.
Files changed (70) hide show
  1. package/LICENSE.md +0 -0
  2. package/README.md +133 -12
  3. package/adapters/CollectionViewAdapter/index.d.ts +154 -0
  4. package/adapters/CollectionViewAdapter/index.js +281 -0
  5. package/adapters/index.d.ts +1 -0
  6. package/adapters/index.js +1 -0
  7. package/data/api/dto/PropertyPathDto.d.ts +4 -0
  8. package/data/api/dto/ReadOptionsDto.d.ts +8 -0
  9. package/data/api/dto/ReadResultDto.d.ts +12 -0
  10. package/data/api/dto/ReadResultMetadataDto.d.ts +8 -0
  11. package/data/api/dto/crud/{CrudMetadata.d.ts → CrudMetadataDto.d.ts} +1 -1
  12. package/data/api/dto/crud/index.d.ts +1 -1
  13. package/data/api/dto/crud/index.js +1 -1
  14. package/data/api/dto/index.d.ts +1 -0
  15. package/data/api/dto/index.js +1 -0
  16. package/data/api/dto/read/{ReadMetadata.d.ts → ReadMetadataDto.d.ts} +1 -1
  17. package/data/api/dto/read/ReadSelectedOrderingPropertyDefinitionDto.d.ts +2 -2
  18. package/data/api/dto/read/ReadSelectedSearchPropertyDefinitionDto.d.ts +2 -2
  19. package/data/api/dto/read/index.d.ts +1 -1
  20. package/data/api/dto/read/index.js +1 -1
  21. package/data/api/dto/response/{ApiError.d.ts → ApiErrorDto.d.ts} +1 -1
  22. package/data/api/dto/response/ApiErrorDto.js +1 -0
  23. package/data/api/dto/response/{ApiResponse.d.ts → ApiResponseDto.d.ts} +3 -3
  24. package/data/api/dto/response/ApiResponseDto.js +1 -0
  25. package/data/api/dto/response/{ApiSuccessResponse.d.ts → ApiSuccessResponseDto.d.ts} +1 -1
  26. package/data/api/dto/response/ApiSuccessResponseDto.js +1 -0
  27. package/data/api/dto/response/EmptyMetadataDto.d.ts +4 -0
  28. package/data/api/dto/response/EmptyMetadataDto.js +1 -0
  29. package/data/api/dto/response/index.d.ts +4 -4
  30. package/data/api/dto/response/index.js +4 -4
  31. package/data/api/interface/IConcurrencySafe.d.ts +9 -0
  32. package/data/api/interface/IConcurrencySafe.js +2 -0
  33. package/data/api/interface/IIdentifiable.d.ts +4 -3
  34. package/data/api/interface/IIdentifiableSecondary.d.ts +3 -3
  35. package/data/api/interface/index.d.ts +1 -0
  36. package/data/api/interface/index.js +1 -0
  37. package/index.d.ts +3 -0
  38. package/index.js +3 -0
  39. package/package.json +15 -10
  40. package/services/api/ApiCrudControllerClient/index.d.ts +9 -5
  41. package/services/api/ApiCrudControllerClient/index.js +15 -9
  42. package/services/api/ApiInitializationService/index.d.ts +21 -3
  43. package/services/api/ApiInitializationService/index.js +36 -7
  44. package/services/api/ApiReadControllerClient/index.d.ts +12 -13
  45. package/services/api/ApiReadControllerClient/index.js +17 -18
  46. package/services/api/HttpService/FetchHttpService.d.ts +1 -1
  47. package/services/api/HttpService/FetchHttpService.js +2 -1
  48. package/services/api/HttpService/HttpRequestConfig.d.ts +1 -0
  49. package/services/api/HttpService/IHttpService.d.ts +1 -1
  50. package/services/api/HttpService/index.d.ts +0 -2
  51. package/services/api/HttpService/index.js +0 -2
  52. package/services/api/UserManagementControllerClient/index.d.ts +9 -5
  53. package/services/api/UserManagementControllerClient/index.js +20 -12
  54. package/services/auth/client/AuthService/index.d.ts +5 -5
  55. package/services/auth/client/AuthService/index.js +9 -9
  56. package/services/auth/client/AuthorizationManagementControllerClient/index.d.ts +5 -5
  57. package/services/auth/client/AuthorizationManagementControllerClient/index.js +8 -8
  58. package/utils/index.d.ts +37 -0
  59. package/utils/index.js +106 -0
  60. package/data/api/dto/response/EmptyMetadata.d.ts +0 -4
  61. package/services/api/HttpService/AngularHttpService.d.ts +0 -9
  62. package/services/api/HttpService/AngularHttpService.js +0 -86
  63. package/services/api/HttpService/AxiosHttpService.d.ts +0 -10
  64. package/services/api/HttpService/AxiosHttpService.js +0 -53
  65. /package/data/api/dto/{crud/CrudMetadata.js → PropertyPathDto.js} +0 -0
  66. /package/data/api/dto/{read/ReadMetadata.js → ReadOptionsDto.js} +0 -0
  67. /package/data/api/dto/{response/ApiError.js → ReadResultDto.js} +0 -0
  68. /package/data/api/dto/{response/ApiResponse.js → ReadResultMetadataDto.js} +0 -0
  69. /package/data/api/dto/{response/ApiSuccessResponse.js → crud/CrudMetadataDto.js} +0 -0
  70. /package/data/api/dto/{response/EmptyMetadata.js → read/ReadMetadataDto.js} +0 -0
@@ -1,86 +0,0 @@
1
- // Ignore eslint any error in this file
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- /**
4
- * Angular HttpClient-based HTTP service implementation
5
- */
6
- export class AngularHttpService {
7
- httpClient;
8
- constructor(httpClient) {
9
- if (!httpClient) {
10
- throw new Error('Angular HttpClient instance is required');
11
- }
12
- this.httpClient = httpClient;
13
- }
14
- async request(url, config) {
15
- try {
16
- const method = config?.method || 'GET';
17
- const headers = config?.headers || {};
18
- const body = config?.body;
19
- const withCredentials = config?.credentials === 'include';
20
- const options = {
21
- headers,
22
- withCredentials,
23
- observe: 'response',
24
- responseType: 'json',
25
- };
26
- let response;
27
- switch (method.toUpperCase()) {
28
- case 'GET':
29
- response = await this.httpClient.get(url, options).toPromise();
30
- break;
31
- case 'POST':
32
- response = await this.httpClient.post(url, body ? JSON.parse(body) : null, options).toPromise();
33
- break;
34
- case 'PUT':
35
- response = await this.httpClient.put(url, body ? JSON.parse(body) : null, options).toPromise();
36
- break;
37
- case 'DELETE':
38
- response = await this.httpClient.delete(url, options).toPromise();
39
- break;
40
- case 'PATCH':
41
- response = await this.httpClient.patch(url, body ? JSON.parse(body) : null, options).toPromise();
42
- break;
43
- default:
44
- throw new Error(`Unsupported HTTP method: ${method}`);
45
- }
46
- // Convert Angular HttpResponse headers to plain object
47
- const responseHeaders = {};
48
- if (response.headers) {
49
- response.headers.keys().forEach((key) => {
50
- responseHeaders[key] = response.headers.get(key);
51
- });
52
- }
53
- return {
54
- ok: response.status >= 200 && response.status < 300,
55
- status: response.status,
56
- statusText: response.statusText || 'OK',
57
- headers: responseHeaders,
58
- json: async () => response.body,
59
- text: async () => (typeof response.body === 'string' ? response.body : JSON.stringify(response.body)),
60
- };
61
- }
62
- catch (error) {
63
- if (error.status !== undefined) {
64
- // Angular HttpErrorResponse
65
- const errorHeaders = {};
66
- if (error.headers) {
67
- error.headers.keys().forEach((key) => {
68
- errorHeaders[key] = error.headers.get(key);
69
- });
70
- }
71
- return {
72
- ok: false,
73
- status: error.status,
74
- statusText: error.statusText || 'Error',
75
- headers: errorHeaders,
76
- json: async () => error.error,
77
- text: async () => (typeof error.error === 'string' ? error.error : JSON.stringify(error.error)),
78
- };
79
- }
80
- else {
81
- // Other errors
82
- throw error;
83
- }
84
- }
85
- }
86
- }
@@ -1,10 +0,0 @@
1
- import { IHttpService, HttpRequestConfig, HttpResponse } from './index';
2
- /**
3
- * Axios-based HTTP service implementation
4
- * Note: This requires axios to be installed as a dependency
5
- */
6
- export declare class AxiosHttpService implements IHttpService {
7
- private readonly axios;
8
- constructor(axiosInstance?: any);
9
- request<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
10
- }
@@ -1,53 +0,0 @@
1
- // Ignore eslint any error in this file
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- /**
4
- * Axios-based HTTP service implementation
5
- * Note: This requires axios to be installed as a dependency
6
- */
7
- export class AxiosHttpService {
8
- axios;
9
- constructor(axiosInstance) {
10
- if (!axiosInstance) {
11
- throw new Error('Axios instance is required');
12
- }
13
- this.axios = axiosInstance;
14
- }
15
- async request(url, config) {
16
- try {
17
- const axiosConfig = {
18
- url,
19
- method: config?.method || 'GET',
20
- headers: config?.headers,
21
- data: config?.body,
22
- withCredentials: config?.credentials === 'include',
23
- };
24
- const response = await this.axios(axiosConfig);
25
- return {
26
- ok: response.status >= 200 && response.status < 300,
27
- status: response.status,
28
- statusText: response.statusText,
29
- headers: response.headers,
30
- json: async () => response.data,
31
- text: async () => (typeof response.data === 'string' ? response.data : JSON.stringify(response.data)),
32
- };
33
- }
34
- catch (error) {
35
- if (error.response) {
36
- // The request was made and the server responded with a status code
37
- // that falls out of the range of 2xx
38
- return {
39
- ok: false,
40
- status: error.response.status,
41
- statusText: error.response.statusText,
42
- headers: error.response.headers,
43
- json: async () => error.response.data,
44
- text: async () => (typeof error.response.data === 'string' ? error.response.data : JSON.stringify(error.response.data)),
45
- };
46
- }
47
- else {
48
- // Something happened in setting up the request that triggered an Error
49
- throw error;
50
- }
51
- }
52
- }
53
- }