@intellegens/cornerstone-client-angular 0.0.45
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
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# @intellegens/cornerstone-client-angular
|
|
2
|
+
|
|
3
|
+
Angular integration package for Cornerstone API clients. This package provides Angular-specific HTTP service implementation and utilities for integration with Angular applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @intellegens/cornerstone-client-angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### 1. Basic Setup
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Component, inject } from '@angular/core';
|
|
17
|
+
import { HttpClient } from '@angular/common/http';
|
|
18
|
+
import { ApiReadControllerClient, AngularHttpService, apiInitializationService } from '@intellegens/cornerstone-client-angular';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'app-users',
|
|
22
|
+
template: `<div>{{ users | json }}</div>`,
|
|
23
|
+
})
|
|
24
|
+
export class UsersComponent {
|
|
25
|
+
private httpClient = inject(HttpClient);
|
|
26
|
+
private angularHttpService = new AngularHttpService(this.httpClient);
|
|
27
|
+
|
|
28
|
+
users$ = this.loadUsers();
|
|
29
|
+
|
|
30
|
+
private async loadUsers() {
|
|
31
|
+
// Initialize with Angular HTTP service
|
|
32
|
+
await apiInitializationService.initialize({
|
|
33
|
+
httpService: this.angularHttpService,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const client = new ApiReadControllerClient('/api/users');
|
|
37
|
+
return await client.readAll();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. Service-Based Approach (Recommended)
|
|
43
|
+
|
|
44
|
+
Create an Angular service for better dependency injection:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { Injectable, inject } from '@angular/core';
|
|
48
|
+
import { HttpClient } from '@angular/common/http';
|
|
49
|
+
import {
|
|
50
|
+
AngularHttpService,
|
|
51
|
+
ApiReadControllerClient,
|
|
52
|
+
ApiCrudControllerClient,
|
|
53
|
+
UserManagementControllerClient,
|
|
54
|
+
apiInitializationService,
|
|
55
|
+
} from '@intellegens/cornerstone-client-angular';
|
|
56
|
+
|
|
57
|
+
@Injectable({
|
|
58
|
+
providedIn: 'root',
|
|
59
|
+
})
|
|
60
|
+
export class ApiService {
|
|
61
|
+
private httpClient = inject(HttpClient);
|
|
62
|
+
private angularHttpService = new AngularHttpService(this.httpClient);
|
|
63
|
+
|
|
64
|
+
constructor() {
|
|
65
|
+
this.initializeApi();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private async initializeApi() {
|
|
69
|
+
await apiInitializationService.initialize({
|
|
70
|
+
httpService: this.angularHttpService,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Create typed client methods
|
|
75
|
+
getUsersClient() {
|
|
76
|
+
return new ApiReadControllerClient('/api/users', this.angularHttpService);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
getUserManagementClient() {
|
|
80
|
+
return new UserManagementControllerClient('/api/auth', this.angularHttpService);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getProductsClient() {
|
|
84
|
+
return new ApiCrudControllerClient('/api/products', this.angularHttpService);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 3. Using in Components
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { Component, inject, OnInit } from '@angular/core';
|
|
93
|
+
import { ApiService } from './api.service';
|
|
94
|
+
|
|
95
|
+
@Component({
|
|
96
|
+
selector: 'app-dashboard',
|
|
97
|
+
template: `
|
|
98
|
+
<div>
|
|
99
|
+
<h2>Users</h2>
|
|
100
|
+
<ul>
|
|
101
|
+
<li *ngFor="let user of users">{{ user.name }}</li>
|
|
102
|
+
</ul>
|
|
103
|
+
|
|
104
|
+
<h2>Products</h2>
|
|
105
|
+
<ul>
|
|
106
|
+
<li *ngFor="let product of products">{{ product.title }}</li>
|
|
107
|
+
</ul>
|
|
108
|
+
</div>
|
|
109
|
+
`,
|
|
110
|
+
})
|
|
111
|
+
export class DashboardComponent implements OnInit {
|
|
112
|
+
private apiService = inject(ApiService);
|
|
113
|
+
|
|
114
|
+
users: any[] = [];
|
|
115
|
+
products: any[] = [];
|
|
116
|
+
|
|
117
|
+
async ngOnInit() {
|
|
118
|
+
// Load users
|
|
119
|
+
const usersClient = this.apiService.getUsersClient();
|
|
120
|
+
this.users = await usersClient.readAll();
|
|
121
|
+
|
|
122
|
+
// Load products
|
|
123
|
+
const productsClient = this.apiService.getProductsClient();
|
|
124
|
+
this.products = await productsClient.readAll();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async createProduct(productData: any) {
|
|
128
|
+
const productsClient = this.apiService.getProductsClient();
|
|
129
|
+
const newProduct = await productsClient.create(productData);
|
|
130
|
+
this.products.push(newProduct);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Advanced Features
|
|
136
|
+
|
|
137
|
+
### Request Cancellation with AbortSignal
|
|
138
|
+
|
|
139
|
+
Angular components can cancel requests when destroyed:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { Component, inject, OnDestroy } from '@angular/core';
|
|
143
|
+
import { ApiService } from './api.service';
|
|
144
|
+
|
|
145
|
+
@Component({
|
|
146
|
+
selector: 'app-users-list',
|
|
147
|
+
template: `<div>{{ users | json }}</div>`,
|
|
148
|
+
})
|
|
149
|
+
export class UsersListComponent implements OnDestroy {
|
|
150
|
+
private apiService = inject(ApiService);
|
|
151
|
+
private abortController = new AbortController();
|
|
152
|
+
|
|
153
|
+
users: any[] = [];
|
|
154
|
+
|
|
155
|
+
async ngOnInit() {
|
|
156
|
+
try {
|
|
157
|
+
const client = this.apiService.getUsersClient();
|
|
158
|
+
this.users = await client.readAll(this.abortController.signal);
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (error.name === 'AbortError') {
|
|
161
|
+
console.log('Request was cancelled');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
ngOnDestroy() {
|
|
167
|
+
// Cancel any pending requests
|
|
168
|
+
this.abortController.abort();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Custom HTTP Configuration
|
|
174
|
+
|
|
175
|
+
Configure the Angular HttpClient with interceptors and custom settings:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { Injectable, inject } from '@angular/core';
|
|
179
|
+
import { HttpClient, HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http';
|
|
180
|
+
import { AngularHttpService } from '@intellegens/cornerstone-client-angular';
|
|
181
|
+
|
|
182
|
+
// Custom interceptor for authentication
|
|
183
|
+
@Injectable()
|
|
184
|
+
export class AuthInterceptor implements HttpInterceptor {
|
|
185
|
+
intercept(req: HttpRequest<any>, next: HttpHandler) {
|
|
186
|
+
const authReq = req.clone({
|
|
187
|
+
setHeaders: {
|
|
188
|
+
Authorization: `Bearer ${localStorage.getItem('token')}`,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
return next.handle(authReq);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Service with configured HTTP client
|
|
196
|
+
@Injectable({
|
|
197
|
+
providedIn: 'root',
|
|
198
|
+
})
|
|
199
|
+
export class ConfiguredApiService {
|
|
200
|
+
private httpClient = inject(HttpClient);
|
|
201
|
+
private angularHttpService = new AngularHttpService(this.httpClient);
|
|
202
|
+
|
|
203
|
+
// The HttpClient will automatically use registered interceptors
|
|
204
|
+
getUsersClient() {
|
|
205
|
+
return new ApiReadControllerClient('/api/users', this.angularHttpService);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Error Handling
|
|
211
|
+
|
|
212
|
+
Handle HTTP errors with Angular's error handling patterns:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
import { Component, inject } from '@angular/core';
|
|
216
|
+
import { catchError, of } from 'rxjs';
|
|
217
|
+
import { ApiService } from './api.service';
|
|
218
|
+
|
|
219
|
+
@Component({
|
|
220
|
+
selector: 'app-error-handling',
|
|
221
|
+
template: `<div>{{ errorMessage || 'Loading...' }}</div>`,
|
|
222
|
+
})
|
|
223
|
+
export class ErrorHandlingComponent {
|
|
224
|
+
private apiService = inject(ApiService);
|
|
225
|
+
|
|
226
|
+
errorMessage: string = '';
|
|
227
|
+
|
|
228
|
+
async loadData() {
|
|
229
|
+
try {
|
|
230
|
+
const client = this.apiService.getUsersClient();
|
|
231
|
+
const users = await client.readAll();
|
|
232
|
+
console.log('Users loaded:', users);
|
|
233
|
+
} catch (error: any) {
|
|
234
|
+
this.errorMessage = `Failed to load users: ${error.message}`;
|
|
235
|
+
console.error('API Error:', error);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## API Reference
|
|
242
|
+
|
|
243
|
+
### AngularHttpService
|
|
244
|
+
|
|
245
|
+
The `AngularHttpService` class implements the `IHttpService` interface using Angular's `HttpClient`.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
class AngularHttpService implements IHttpService {
|
|
249
|
+
constructor(private httpClient: HttpClient) {}
|
|
250
|
+
|
|
251
|
+
async request<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
252
|
+
}
|
|
253
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { fromEvent, switchMap, throwError, race, firstValueFrom } from 'rxjs';
|
|
2
|
+
export * from '@intellegens/cornerstone-client';
|
|
3
|
+
|
|
4
|
+
// Ignore eslint any error in this file
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
/**
|
|
7
|
+
* Angular HttpClient-based HTTP service implementation
|
|
8
|
+
*/
|
|
9
|
+
class AngularHttpService {
|
|
10
|
+
httpClient;
|
|
11
|
+
constructor(httpClient) {
|
|
12
|
+
if (!httpClient) {
|
|
13
|
+
throw new Error('Angular HttpClient instance is required');
|
|
14
|
+
}
|
|
15
|
+
this.httpClient = httpClient;
|
|
16
|
+
}
|
|
17
|
+
async requestAsync(url, config) {
|
|
18
|
+
try {
|
|
19
|
+
const method = config?.method || 'GET';
|
|
20
|
+
const headers = config?.headers || {};
|
|
21
|
+
const body = config?.body;
|
|
22
|
+
const withCredentials = config?.credentials === 'include';
|
|
23
|
+
const options = {
|
|
24
|
+
headers,
|
|
25
|
+
withCredentials,
|
|
26
|
+
observe: 'response',
|
|
27
|
+
responseType: 'json',
|
|
28
|
+
};
|
|
29
|
+
let request;
|
|
30
|
+
switch (method.toUpperCase()) {
|
|
31
|
+
case 'GET':
|
|
32
|
+
request = this.httpClient.get(url, options);
|
|
33
|
+
break;
|
|
34
|
+
case 'POST':
|
|
35
|
+
request = this.httpClient.post(url, body ? JSON.parse(body) : null, options);
|
|
36
|
+
break;
|
|
37
|
+
case 'PUT':
|
|
38
|
+
request = this.httpClient.put(url, body ? JSON.parse(body) : null, options);
|
|
39
|
+
break;
|
|
40
|
+
case 'DELETE':
|
|
41
|
+
request = this.httpClient.delete(url, options);
|
|
42
|
+
break;
|
|
43
|
+
case 'PATCH':
|
|
44
|
+
request = this.httpClient.patch(url, body ? JSON.parse(body) : null, options);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
throw new Error(`Unsupported HTTP method: ${method}`);
|
|
48
|
+
}
|
|
49
|
+
// Handle cancellation using AbortSignal
|
|
50
|
+
if (config?.signal) {
|
|
51
|
+
// Check if signal is already aborted
|
|
52
|
+
if (config.signal.aborted) {
|
|
53
|
+
throw new Error('Request was aborted');
|
|
54
|
+
}
|
|
55
|
+
const abort$ = fromEvent(config.signal, 'abort').pipe(switchMap(() => throwError(() => new Error('Request was aborted'))));
|
|
56
|
+
request = race(request, abort$);
|
|
57
|
+
}
|
|
58
|
+
const response = (await firstValueFrom(request));
|
|
59
|
+
// Convert Angular HttpResponse headers to plain object
|
|
60
|
+
const responseHeaders = {};
|
|
61
|
+
if (response.headers) {
|
|
62
|
+
response.headers.keys().forEach((key) => {
|
|
63
|
+
responseHeaders[key] = response.headers.get(key);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
ok: response.status >= 200 && response.status < 300,
|
|
68
|
+
status: response.status,
|
|
69
|
+
statusText: response.statusText || 'OK',
|
|
70
|
+
headers: responseHeaders,
|
|
71
|
+
json: async () => response.body,
|
|
72
|
+
text: async () => (typeof response.body === 'string' ? response.body : JSON.stringify(response.body)),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
if (error.status !== undefined) {
|
|
77
|
+
// Angular HttpErrorResponse
|
|
78
|
+
const errorHeaders = {};
|
|
79
|
+
if (error.headers) {
|
|
80
|
+
error.headers.keys().forEach((key) => {
|
|
81
|
+
errorHeaders[key] = error.headers.get(key);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ok: false,
|
|
86
|
+
status: error.status,
|
|
87
|
+
statusText: error.statusText || 'Error',
|
|
88
|
+
headers: errorHeaders,
|
|
89
|
+
json: async () => error.error,
|
|
90
|
+
text: async () => (typeof error.error === 'string' ? error.error : JSON.stringify(error.error)),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// Other errors
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* Public API Surface of cornerstone-client-angular
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Generated bundle index. Do not edit.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
export { AngularHttpService };
|
|
110
|
+
//# sourceMappingURL=intellegens-cornerstone-client-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intellegens-cornerstone-client-angular.mjs","sources":["../../../../projects/intellegens/cornerstone-client-angular/src/lib/services/AngularHttpService/index.ts","../../../../projects/intellegens/cornerstone-client-angular/src/public-api.ts","../../../../projects/intellegens/cornerstone-client-angular/src/intellegens-cornerstone-client-angular.ts"],"sourcesContent":["// Ignore eslint any error in this file\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IHttpService, HttpRequestConfig, HttpResponse } from '@intellegens/cornerstone-client';\nimport { HttpClient } from '@angular/common/http';\nimport { firstValueFrom, fromEvent, throwError, switchMap, race } from 'rxjs';\n\n/**\n * Angular HttpClient-based HTTP service implementation\n */\nexport class AngularHttpService implements IHttpService {\n private httpClient: HttpClient;\n\n constructor(httpClient: HttpClient) {\n if (!httpClient) {\n throw new Error('Angular HttpClient instance is required');\n }\n this.httpClient = httpClient;\n }\n\n public async requestAsync<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>> {\n try {\n const method = config?.method || 'GET';\n const headers = config?.headers || {};\n const body = config?.body;\n const withCredentials = config?.credentials === 'include';\n\n const options = {\n headers,\n withCredentials,\n observe: 'response' as const,\n responseType: 'json' as const,\n };\n\n let request: any;\n\n switch (method.toUpperCase()) {\n case 'GET':\n request = this.httpClient.get(url, options);\n break;\n case 'POST':\n request = this.httpClient.post(url, body ? JSON.parse(body) : null, options);\n break;\n case 'PUT':\n request = this.httpClient.put(url, body ? JSON.parse(body) : null, options);\n break;\n case 'DELETE':\n request = this.httpClient.delete(url, options);\n break;\n case 'PATCH':\n request = this.httpClient.patch(url, body ? JSON.parse(body) : null, options);\n break;\n default:\n throw new Error(`Unsupported HTTP method: ${method}`);\n }\n\n // Handle cancellation using AbortSignal\n if (config?.signal) {\n // Check if signal is already aborted\n if (config.signal.aborted) {\n throw new Error('Request was aborted');\n }\n\n const abort$ = fromEvent(config.signal, 'abort').pipe(switchMap(() => throwError(() => new Error('Request was aborted'))));\n\n request = race(request, abort$);\n }\n\n const response = (await firstValueFrom(request)) as any;\n\n // Convert Angular HttpResponse headers to plain object\n const responseHeaders: Record<string, string> = {};\n if (response.headers) {\n response.headers.keys().forEach((key: string) => {\n responseHeaders[key] = response.headers.get(key);\n });\n }\n\n return {\n ok: response.status >= 200 && response.status < 300,\n status: response.status,\n statusText: response.statusText || 'OK',\n headers: responseHeaders,\n json: async () => response.body,\n text: async () => (typeof response.body === 'string' ? response.body : JSON.stringify(response.body)),\n };\n } catch (error: any) {\n if (error.status !== undefined) {\n // Angular HttpErrorResponse\n const errorHeaders: Record<string, string> = {};\n if (error.headers) {\n error.headers.keys().forEach((key: string) => {\n errorHeaders[key] = error.headers.get(key);\n });\n }\n\n return {\n ok: false,\n status: error.status,\n statusText: error.statusText || 'Error',\n headers: errorHeaders,\n json: async () => error.error,\n text: async () => (typeof error.error === 'string' ? error.error : JSON.stringify(error.error)),\n };\n } else {\n // Other errors\n throw error;\n }\n }\n }\n}\n","/*\n * Public API Surface of cornerstone-client-angular\n */\n\nexport * from './lib/';\nexport * from '@intellegens/cornerstone-client';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;AACA;AAMA;;AAEG;MACU,kBAAkB,CAAA;AACrB,IAAA,UAAU;AAElB,IAAA,WAAA,CAAY,UAAsB,EAAA;QAChC,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC;QAC5D;AACA,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU;IAC9B;AAEO,IAAA,MAAM,YAAY,CAAU,GAAW,EAAE,MAA0B,EAAA;AACxE,QAAA,IAAI;AACF,YAAA,MAAM,MAAM,GAAG,M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A,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE;;gBAE9B,MAAM,YAAY,GAA2B,EAAE;AAC/C,gBAAA,IAAI,KAAK,CAAC,OAAO,EAAE;oBACjB,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,GAAW,KAAI;AAC3C,wBAAA,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;AAC5C,oBAAA,CAAC,CAAC;gBACJ;gBAEA,OAAO;AACL,oBAAA,EAAE,EAAE,KAAK;oBACT,MAAM,EAAE,KAAK,CAAC,MAAM;AACpB,oBAAA,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,OAAO;AACvC,oBAAA,OAAO,EAAE,YAAY;AACrB,oBAAA,IAAI,EAAE,YAAY,KAAK,CAAC,KAAK;AAC7B,oBAAA,IAAI,EAAE,aAAa,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBAChG;YACH;iBAAO;;AAEL,gBAAA,MAAM,KAAK;YACb;QACF;IACF;AACD;;AC9GD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IHttpService, HttpRequestConfig, HttpResponse } from '@intellegens/cornerstone-client';
|
|
2
|
+
export * from '@intellegens/cornerstone-client';
|
|
3
|
+
import { HttpClient } from '@angular/common/http';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Angular HttpClient-based HTTP service implementation
|
|
7
|
+
*/
|
|
8
|
+
declare class AngularHttpService implements IHttpService {
|
|
9
|
+
private httpClient;
|
|
10
|
+
constructor(httpClient: HttpClient);
|
|
11
|
+
requestAsync<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { AngularHttpService };
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@intellegens/cornerstone-client-angular",
|
|
3
|
+
"version": "0.0.45",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishable": true,
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"module": "fesm2022/intellegens-cornerstone-client-angular.mjs",
|
|
8
|
+
"typings": "index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": {
|
|
11
|
+
"default": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"default": "./fesm2022/intellegens-cornerstone-client-angular.mjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"tslib": "^2.3.0"
|
|
20
|
+
}
|
|
21
|
+
}
|