@limetech/lime-web-components 6.6.0 → 6.8.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/CHANGELOG.md +17 -0
- package/dist/error/error.d.ts +15 -0
- package/dist/error/error.d.ts.map +1 -0
- package/dist/error/error.spec.d.ts +2 -0
- package/dist/error/error.spec.d.ts.map +1 -0
- package/dist/error/index.d.ts +2 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/eventdispatcher/eventdispatcher.d.ts +76 -10
- package/dist/eventdispatcher/eventdispatcher.d.ts.map +1 -1
- package/dist/filter/decorator.d.ts +21 -3
- package/dist/filter/decorator.d.ts.map +1 -1
- package/dist/filter/repository.d.ts +84 -6
- package/dist/filter/repository.d.ts.map +1 -1
- package/dist/http/http.d.ts +244 -37
- package/dist/http/http.d.ts.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +467 -333
- package/dist/index.esm.js.map +1 -1
- package/dist/keybindings/registry.d.ts +140 -27
- package/dist/keybindings/registry.d.ts.map +1 -1
- package/dist/logger/factory.d.ts +51 -0
- package/dist/logger/factory.d.ts.map +1 -0
- package/dist/logger/factory.spec.d.ts +2 -0
- package/dist/logger/factory.spec.d.ts.map +1 -0
- package/dist/logger/index.d.ts +1 -0
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/problem/index.d.ts +6 -0
- package/dist/problem/index.d.ts.map +1 -0
- package/dist/problem/problem.d.ts +394 -0
- package/dist/problem/problem.d.ts.map +1 -0
- package/dist/problem/provider.d.ts +192 -0
- package/dist/problem/provider.d.ts.map +1 -0
- package/dist/problem/query.d.ts +312 -0
- package/dist/problem/query.d.ts.map +1 -0
- package/dist/problem/repository.d.ts +111 -0
- package/dist/problem/repository.d.ts.map +1 -0
- package/dist/problem/types.d.ts +15 -0
- package/dist/problem/types.d.ts.map +1 -0
- package/package.json +6 -6
package/dist/http/http.d.ts
CHANGED
|
@@ -1,76 +1,227 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HTTP service for sending requests to
|
|
2
|
+
* HTTP service for sending requests to backend endpoints
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The {@link HttpClient} is the primary interface for making HTTP requests
|
|
5
|
+
* within the Lime platform.
|
|
6
|
+
*
|
|
7
|
+
* By default, all requests expect JSON responses. For other content types
|
|
8
|
+
* (text, binary data, etc.), set the `responseType` in {@link HttpOptions}.
|
|
9
|
+
*
|
|
10
|
+
* All methods throw {@link HttpResponseError} on HTTP errors (4xx, 5xx status codes).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* Basic GET request for JSON data
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
16
|
+
* const data = await http.get('my_addon/endpoint');
|
|
17
|
+
* console.log(data);
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* POST request with data and query parameters
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
24
|
+
* const response = await http.post(
|
|
25
|
+
* 'my_addon/users',
|
|
26
|
+
* { name: 'John Doe', email: 'john@example.com' },
|
|
27
|
+
* { params: { notify: 'true' } }
|
|
28
|
+
* );
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* Error handling with HttpResponseError
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
35
|
+
* try {
|
|
36
|
+
* const data = await http.get('my_addon/endpoint');
|
|
37
|
+
* } catch (error) {
|
|
38
|
+
* if (error.name === 'HttpResponseError') {
|
|
39
|
+
* console.error(`HTTP ${error.status}: ${error.message}`);
|
|
40
|
+
* console.error('Response:', error.response);
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* Downloading a file as blob
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
49
|
+
* const blob = await http.get('my_addon/download/report.pdf', {
|
|
50
|
+
* responseType: 'blob'
|
|
51
|
+
* });
|
|
52
|
+
* const url = URL.createObjectURL(blob);
|
|
53
|
+
* window.open(url);
|
|
54
|
+
* ```
|
|
6
55
|
*
|
|
7
56
|
* @public
|
|
8
57
|
* @group HTTP
|
|
9
58
|
*/
|
|
10
59
|
export interface HttpClient {
|
|
11
60
|
/**
|
|
12
|
-
* Sends a
|
|
61
|
+
* Sends a GET request to retrieve data from the server
|
|
13
62
|
*
|
|
14
|
-
* @param url -
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
63
|
+
* @param url - Relative URL to the resource (e.g., 'my_addon/endpoint').
|
|
64
|
+
* The URL is relative to the Lime CRM base URL.
|
|
65
|
+
* @param options - Optional {@link HttpOptions} for query parameters, headers, or response type
|
|
66
|
+
* @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
73
|
+
* const users = await http.get('my_addon/users', {
|
|
74
|
+
* params: { active: 'true', limit: '10' }
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
17
77
|
*/
|
|
18
78
|
get(url: string, options?: HttpOptions): Promise<any>;
|
|
19
79
|
/**
|
|
20
|
-
* Sends a
|
|
80
|
+
* Sends a POST request to create new data on the server
|
|
81
|
+
*
|
|
82
|
+
* @param url - Relative URL to the resource (e.g., 'my_addon/endpoint')
|
|
83
|
+
* @param data - Payload to send in the request body. Will be JSON-encoded by default.
|
|
84
|
+
* @param options - Optional {@link HttpOptions} for query parameters, headers, or response type
|
|
85
|
+
* @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}
|
|
21
86
|
*
|
|
22
|
-
* @
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
87
|
+
* @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
92
|
+
* const newUser = await http.post('my_addon/users', {
|
|
93
|
+
* name: 'Jane Smith',
|
|
94
|
+
* email: 'jane@example.com'
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
26
97
|
*/
|
|
27
98
|
post(url: string, data?: object, options?: HttpOptions): Promise<any>;
|
|
28
99
|
/**
|
|
29
|
-
* Sends a
|
|
100
|
+
* Sends a PATCH request to partially update existing data on the server
|
|
101
|
+
*
|
|
102
|
+
* @param url - Relative URL to the resource (e.g., 'my_addon/users/123')
|
|
103
|
+
* @param data - Partial payload containing only the fields to update
|
|
104
|
+
* @param options - Optional {@link HttpOptions} for query parameters, headers, or response type
|
|
105
|
+
* @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}
|
|
30
106
|
*
|
|
31
|
-
* @
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
*
|
|
107
|
+
* @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
112
|
+
* await http.patch('my_addon/users/123', {
|
|
113
|
+
* email: 'newemail@example.com'
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
35
116
|
*/
|
|
36
117
|
patch(url: string, data?: object, options?: HttpOptions): Promise<any>;
|
|
37
118
|
/**
|
|
38
|
-
* Sends a
|
|
119
|
+
* Sends a PUT request to replace existing data on the server
|
|
120
|
+
*
|
|
121
|
+
* @param url - Relative URL to the resource (e.g., 'my_addon/users/123')
|
|
122
|
+
* @param data - Complete payload to replace the existing resource
|
|
123
|
+
* @param options - Optional {@link HttpOptions} for query parameters, headers, or response type
|
|
124
|
+
* @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}
|
|
125
|
+
*
|
|
126
|
+
* @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)
|
|
39
127
|
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
131
|
+
* await http.put('my_addon/users/123', {
|
|
132
|
+
* name: 'Jane Doe',
|
|
133
|
+
* email: 'jane@example.com',
|
|
134
|
+
* role: 'admin'
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
44
137
|
*/
|
|
45
138
|
put(url: string, data?: object, options?: HttpOptions): Promise<any>;
|
|
46
139
|
/**
|
|
47
|
-
* Sends a
|
|
140
|
+
* Sends a DELETE request to remove data from the server
|
|
141
|
+
*
|
|
142
|
+
* @param url - Relative URL to the resource (e.g., 'my_addon/users/123')
|
|
143
|
+
* @param options - Optional {@link HttpOptions} for query parameters or headers
|
|
144
|
+
* @returns Promise resolving to the response data. Type depends on {@link HttpOptions.responseType}
|
|
145
|
+
*
|
|
146
|
+
* @throws {@link HttpResponseError} when the server responds with an error status (4xx, 5xx)
|
|
48
147
|
*
|
|
49
|
-
* @
|
|
50
|
-
*
|
|
51
|
-
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
151
|
+
* await http.delete('my_addon/users/123');
|
|
152
|
+
* ```
|
|
52
153
|
*/
|
|
53
154
|
delete(url: string, options?: HttpOptions): Promise<any>;
|
|
54
155
|
}
|
|
55
156
|
/**
|
|
157
|
+
* Configuration options for HTTP requests
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
162
|
+
* const options: HttpOptions = {
|
|
163
|
+
* params: { search: 'John', limit: '10' },
|
|
164
|
+
* headers: { 'X-Custom-Header': 'value' },
|
|
165
|
+
* responseType: 'json'
|
|
166
|
+
* };
|
|
167
|
+
* const data = await http.get('my_addon/users', options);
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
56
170
|
* @public
|
|
57
171
|
* @group HTTP
|
|
58
172
|
*/
|
|
59
173
|
export interface HttpOptions {
|
|
60
174
|
/**
|
|
61
|
-
* Query parameters to
|
|
175
|
+
* Query parameters to append to the URL
|
|
176
|
+
*
|
|
177
|
+
* Parameters will be URL-encoded and appended to the request URL.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* // Results in: my_addon/users?active=true&role=admin&role=user
|
|
182
|
+
* const params = {
|
|
183
|
+
* active: 'true',
|
|
184
|
+
* role: ['admin', 'user']
|
|
185
|
+
* };
|
|
186
|
+
* ```
|
|
62
187
|
*/
|
|
63
188
|
params?: HttpParams;
|
|
64
189
|
/**
|
|
65
|
-
* Additional HTTP
|
|
190
|
+
* Additional HTTP headers to include in the request
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const headers = {
|
|
195
|
+
* 'Authorization': 'Bearer token123',
|
|
196
|
+
* 'Accept-Language': 'en-US'
|
|
197
|
+
* };
|
|
198
|
+
* ```
|
|
66
199
|
*/
|
|
67
200
|
headers?: HttpHeaders;
|
|
68
201
|
/**
|
|
69
|
-
*
|
|
202
|
+
* Expected response data type. Defaults to 'json'
|
|
203
|
+
*
|
|
204
|
+
* - `json`: Parse response as JSON (default)
|
|
205
|
+
* - `text`: Get response as plain text string
|
|
206
|
+
* - `blob`: Get response as binary Blob (for file downloads)
|
|
207
|
+
* - `arraybuffer`: Get response as ArrayBuffer (for binary data processing)
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* // Download PDF file
|
|
212
|
+
* const pdfBlob = await http.get('my_addon/report.pdf', {
|
|
213
|
+
* responseType: 'blob'
|
|
214
|
+
* });
|
|
215
|
+
* ```
|
|
70
216
|
*/
|
|
71
217
|
responseType?: HttpResponseType;
|
|
72
218
|
}
|
|
73
219
|
/**
|
|
220
|
+
* URL query parameters for HTTP requests
|
|
221
|
+
*
|
|
222
|
+
* Key-value pairs that will be appended to the request URL as query string.
|
|
223
|
+
* Array values will be repeated for the same parameter name.
|
|
224
|
+
*
|
|
74
225
|
* @public
|
|
75
226
|
* @group HTTP
|
|
76
227
|
*/
|
|
@@ -78,6 +229,11 @@ export interface HttpParams {
|
|
|
78
229
|
[param: string]: string | string[];
|
|
79
230
|
}
|
|
80
231
|
/**
|
|
232
|
+
* HTTP headers for requests
|
|
233
|
+
*
|
|
234
|
+
* Custom headers to include in the HTTP request. Array values will be
|
|
235
|
+
* joined as comma-separated values for the same header name.
|
|
236
|
+
*
|
|
81
237
|
* @public
|
|
82
238
|
* @group HTTP
|
|
83
239
|
*/
|
|
@@ -85,15 +241,33 @@ export interface HttpHeaders {
|
|
|
85
241
|
[header: string]: string | string[];
|
|
86
242
|
}
|
|
87
243
|
/**
|
|
244
|
+
* Response data type for HTTP requests
|
|
245
|
+
*
|
|
246
|
+
* Determines how the response body will be parsed and returned.
|
|
247
|
+
*
|
|
88
248
|
* @public
|
|
89
249
|
* @group HTTP
|
|
90
250
|
*/
|
|
91
251
|
export type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';
|
|
92
252
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
253
|
+
* HTTP method constants
|
|
254
|
+
*
|
|
255
|
+
* Standard HTTP methods as constant values. Useful for type-safe method
|
|
256
|
+
* selection in custom HTTP utilities.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```typescript
|
|
260
|
+
* function makeRequest(method: HttpMethod, url: string) {
|
|
261
|
+
* if (method === HttpMethod.Get) {
|
|
262
|
+
* // Handle GET request
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
*
|
|
266
|
+
* makeRequest(HttpMethod.Post, 'my_addon/endpoint');
|
|
267
|
+
* ```
|
|
95
268
|
*
|
|
96
269
|
* @public
|
|
270
|
+
* @group HTTP
|
|
97
271
|
*/
|
|
98
272
|
export declare const HttpMethod: {
|
|
99
273
|
readonly Get: "GET";
|
|
@@ -103,26 +277,59 @@ export declare const HttpMethod: {
|
|
|
103
277
|
readonly Patch: "PATCH";
|
|
104
278
|
};
|
|
105
279
|
/**
|
|
106
|
-
* Type definition for HTTP methods
|
|
107
|
-
*
|
|
280
|
+
* Type definition for HTTP methods
|
|
281
|
+
*
|
|
282
|
+
* Union type of all values in the {@link HttpMethod} constant.
|
|
108
283
|
*
|
|
109
284
|
* @public
|
|
285
|
+
* @group HTTP
|
|
110
286
|
*/
|
|
111
287
|
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|
|
112
288
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
289
|
+
* Error thrown when an HTTP request fails
|
|
290
|
+
*
|
|
291
|
+
* This error is thrown by {@link HttpClient} methods when the server responds
|
|
292
|
+
* with an error status code (4xx or 5xx).
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```typescript
|
|
296
|
+
* const http = platform.get(PlatformServiceName.Http);
|
|
297
|
+
*
|
|
298
|
+
* try {
|
|
299
|
+
* const data = await http.get('my_addon/data');
|
|
300
|
+
* } catch (error) {
|
|
301
|
+
* if (error.name !== 'HttpResponseError') {
|
|
302
|
+
* throw error;
|
|
303
|
+
* }
|
|
304
|
+
*
|
|
305
|
+
* if (error.status === 404) {
|
|
306
|
+
* console.error('Resource not found');
|
|
307
|
+
* } else if (error.status >= 500) {
|
|
308
|
+
* console.error('Server error:', error.status);
|
|
309
|
+
* }
|
|
310
|
+
*
|
|
311
|
+
* const body = await error.response.text();
|
|
312
|
+
* console.error('Response body:', body);
|
|
313
|
+
* }
|
|
314
|
+
* ```
|
|
115
315
|
*
|
|
116
316
|
* @public
|
|
317
|
+
* @group HTTP
|
|
117
318
|
*/
|
|
118
319
|
export interface HttpResponseError extends Error {
|
|
119
320
|
name: 'HttpResponseError';
|
|
120
321
|
/**
|
|
121
|
-
*
|
|
322
|
+
* HTTP status code from the failed response
|
|
122
323
|
*/
|
|
123
324
|
status: number;
|
|
124
325
|
/**
|
|
125
|
-
* The
|
|
326
|
+
* The full Response object from the failed request
|
|
327
|
+
*
|
|
328
|
+
* Use this to access response headers or read the response body:
|
|
329
|
+
* ```typescript
|
|
330
|
+
* const body = await error.response.text();
|
|
331
|
+
* const contentType = error.response.headers.get('content-type');
|
|
332
|
+
* ```
|
|
126
333
|
*/
|
|
127
334
|
response: Response;
|
|
128
335
|
}
|
package/dist/http/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http/http.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;;;;;;;;;;;;;OAiBG;IAEH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;;;;OAkBG;IAEH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtE;;;;;;;;;;;;;;;;;OAiBG;IAEH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;;;;OAmBG;IAEH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAErE;;;;;;;;;;;;;;OAcG;IAEH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,WAAW;IACxB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACvB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IACxB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,CAAC;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC5C,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;;;OAQG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACtB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("@stencil/core");var p=typeof document<"u"?document.currentScript:null;const s={Route:"route"},ae="idle-state";function ue(e){return e&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(e.type)}function le(e){return e&&["belongsto","hasone"].includes(e.type)}function fe(e){return e&&["time","timeofday","date","year","quarter","month"].includes(e.type)}function pe(e){return e&&["string","text","phone","link"].includes(e.type)}function de(e){return e&&["decimal","percent"].includes(e.type)}const me="state.limetypes";s.LimeTypeRepository=me;var w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},w(e,t)};function b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");w(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function A(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],c;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){c={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return i}function I(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function d(e){return typeof e=="function"}function W(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var R=W(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
2
2
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function w(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var S=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=O(s),u=a.next();!u.done;u=a.next()){var E=u.value;E.remove(this)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else s.remove(this);var D=this.initialTeardown;if(p(D))try{D()}catch(f){i=f instanceof C?f.errors:[f]}var I=this._finalizers;if(I){this._finalizers=null;try{for(var b=O(I),m=b.next();!m.done;m=b.next()){var te=m.value;try{L(te)}catch(f){i=i??[],f instanceof C?i=R(R([],A(i)),A(f.errors)):i.push(f)}}}catch(f){n={error:f}}finally{try{m&&!m.done&&(o=b.return)&&o.call(b)}finally{if(n)throw n.error}}}if(i)throw new C(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)L(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&w(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&w(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),k=S.EMPTY;function W(e){return e instanceof S||e&&"closed"in e&&p(e.remove)&&p(e.add)&&p(e.unsubscribe)}function L(e){p(e)?e():e.unsubscribe()}var ue={Promise:void 0},le={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,R([e,t],A(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function fe(e){le.setTimeout(function(){throw e})}function N(){}function v(e){e()}var G=(function(e){h(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,W(r)&&r.add(n)):n.destination=me,n}return t.create=function(r,n,o){return new j(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(S),pe=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){y(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){y(n)}else y(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){y(r)}},e})(),j=(function(e){h(t,e);function t(r,n,o){var i=e.call(this)||this,s;return p(r)||!r?s={next:r??void 0,error:n??void 0,complete:o??void 0}:s=r,i.destination=new pe(s),i}return t})(G);function y(e){fe(e)}function de(e){throw e}var me={closed:!0,next:N,error:de,complete:N},he=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function be(e){return e}function ye(e){return e.length===0?be:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var M=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=ge(t)?t:new j(t,r,n);return v(function(){var s=o,a=s.operator,u=s.source;i.add(a?a.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=T(r),new r(function(o,i){var s=new j({next:function(a){try{t(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[he]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return ye(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=T(t),new t(function(n,o){var i;r.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})();function T(e){var t;return(t=e??ue.Promise)!==null&&t!==void 0?t:Promise}function ve(e){return e&&p(e.next)&&p(e.error)&&p(e.complete)}function ge(e){return e&&e instanceof G||ve(e)&&W(e)}var Se=B(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),H=(function(e){h(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new $(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Se},t.prototype.next=function(r){var n=this;v(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=O(n.currentObservers),a=s.next();!a.done;a=s.next()){var u=a.value;u.next(r)}}catch(E){o={error:E}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;v(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;v(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?k:(this.currentObservers=null,a.push(r),new S(function(){n.currentObservers=null,w(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},t.prototype.asObservable=function(){var r=new M;return r.source=this,r},t.create=function(r,n){return new $(r,n)},t})(M),$=(function(e){h(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:k},t})(H),Ee=(function(e){h(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(H);function Ce(e){return e}function l(e,t){return(r,n)=>{const o=_e(r,n,e,t);o.length===1&&Oe(r,o)}}const x=new WeakMap,g=new WeakMap,Q=new WeakMap;function _e(e,t,r,n){let o=x.get(e);return o||(o=[],x.set(e,o)),o.push({options:r,name:t,optionFactory:n.optionFactory||Ce,service:{name:n.name,method:n.method||"subscribe"}}),o}function Oe(e,t){e.connectedCallback=Y(e.connectedCallback,t),e.componentWillLoad=Ae(e.componentWillLoad,t),e.componentDidUnload=V(e.componentDidUnload),e.disconnectedCallback=V(e.disconnectedCallback)}function Y(e,t){return async function(...r){Q.set(this,!0),g.set(this,[]),await q(this);const n=new Ee(this.context);we(this,"context",n);for(const o of t)o.options=o.optionFactory(o.options,this),Re(o.options)&&(o.options.context=n),je(this,o);if(e)return e.apply(this,r)}}function Ae(e,t){return async function(...r){return Q.get(this)===!0?(await q(this),e?e.apply(this,r):void 0):Y(e,t).apply(this,r)}}function V(e){return async function(...t){let r;return e&&(r=e.apply(this,t)),Pe(this),r}}function Re(e){return"context"in e}function q(e){const t=[];return e.platform||t.push(U(e,"platform")),e.context||t.push(U(e,"context")),t.length===0?Promise.resolve():Promise.all(t)}function U(e,t){const r=F.getElement(e);return new Promise(n=>{Object.defineProperty(r,t,{configurable:!0,set:o=>{delete r[t],r[t]=o,n()}})})}function we(e,t,r){const n=F.getElement(e),{get:o,set:i}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);Object.defineProperty(n,t,{configurable:!0,get:o,set:function(s){i.call(this,s),r.next(s)}})}function je(e,t){const r=Ie(e,t);if(typeof r!="function")return;g.get(e).push(r)}function Pe(e){const t=g.get(e);for(const r of t)r();g.set(e,[])}function De(e,t){return r=>{e[t]=r}}function Ie(e,t){const r={...t.options};Le(r,e);const n=t.service.name,o=e.platform;if(!o.has(n))throw new Error(`Service ${n} does not exist`);return o.get(n)[t.service.method](De(e,t.name),r)}function Le(e,t){e.filter&&(e.filter=e.filter.map(r=>r.bind(t))),e.map&&(e.map=e.map.map(r=>r.bind(t)))}function Ne(e={}){const t={name:c.LimeTypeRepository};return l(e,t)}function Me(e={}){const t={name:c.LimeTypeRepository};return e.map=[Te,...e.map||[]],e.context=null,l(e,t)}function Te(e){const{limetype:t}=this.context;return e[t]}const $e=e=>t=>Object.values(t).find(P(e));function xe(e,t){return Object.values(e.properties).filter(r=>r.type===t)}function Ve(e,t){return Object.values(e.properties).find(P(t))}function Ue(e,t){return e.properties[t]}const P=e=>t=>t?.label===e,Fe="state.limeobjects";c.LimeObjectRepository=Fe;function Be(e={}){const t={name:c.LimeObjectRepository,optionFactory:Ge};return l(e,t)}function ke(e={}){const t={name:c.LimeObjectRepository};return e.map=[We,...e.map||[]],e.context=null,l(e,t)}function We(e){const{limetype:t,id:r}=this.context;if(e[t])return e[t].find(n=>n.id===r)}function Ge(e,t){return e.getLimetype&&(e.limetype=e.getLimetype(t)),e}var K=(e=>(e.Received="command.received",e.Handled="command.handled",e.Failed="command.failed",e))(K||{});function d(e){return t=>{He(t,e.id),Qe(t,e.id)}}function He(e,t){e.commandId=t}function Qe(e,t){Object.defineProperty(e,Symbol.hasInstance,{value:r=>J(r).includes(t)})}function X(e){return typeof e=="string"?e:e&&e.constructor&&e.constructor.commandId?e.constructor.commandId:e&&e.commandId?e.commandId:null}function J(e){let t=[],r,n=e;for(;r=X(n);)t=[...t,r],n=Object.getPrototypeOf(n);return[...new Set(t)]}const Ye="commandBus";c.CommandBus=Ye;var qe=Object.getOwnPropertyDescriptor,Ke=(e,t,r,n)=>{for(var o=n>1?void 0:n?qe(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const Xe="limeobject.bulk-create-dialog";exports.BulkCreateDialogCommand=class{};exports.BulkCreateDialogCommand=Ke([d({id:Xe})],exports.BulkCreateDialogCommand);var Je=Object.getOwnPropertyDescriptor,Ze=(e,t,r,n)=>{for(var o=n>1?void 0:n?Je(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const ze="limeobject.create-dialog";exports.CreateLimeobjectDialogCommand=class{constructor(){this.route=!1}};exports.CreateLimeobjectDialogCommand=Ze([d({id:ze})],exports.CreateLimeobjectDialogCommand);var et=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?et(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const rt="limeobject.delete-object";exports.DeleteObjectCommand=class{};exports.DeleteObjectCommand=tt([d({id:rt})],exports.DeleteObjectCommand);var nt=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var o=n>1?void 0:n?nt(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const it="limeobject.object-access";exports.OpenObjectAccessDialogCommand=class{};exports.OpenObjectAccessDialogCommand=ot([d({id:it})],exports.OpenObjectAccessDialogCommand);var st=Object.getOwnPropertyDescriptor,ct=(e,t,r,n)=>{for(var o=n>1?void 0:n?st(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const at="limeobject.save-object";exports.SaveLimeObjectCommand=class{constructor(){this.route=!1}};exports.SaveLimeObjectCommand=ct([d({id:at})],exports.SaveLimeObjectCommand);var Z=(e=>(e.AND="AND",e.OR="OR",e.NOT="!",e.EQUALS="=",e.NOT_EQUALS="!=",e.GREATER=">",e.LESS="<",e.IN="IN",e.BEGINS="=?",e.LIKE="?",e.LESS_OR_EQUAL="<=",e.GREATER_OR_EQUAL=">=",e.ENDS="=$",e))(Z||{});const ut={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"},lt="query";c.Query=lt;const ft={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"},pt="http";c.Http=pt;const dt="eventDispatcher";c.EventDispatcher=dt;const mt="translate";c.Translate=mt;const ht="dialog";c.Dialog=ht;const bt="keybindingRegistry";c.KeybindingRegistry=bt;const yt="navigator";c.Navigator=yt;function vt(e){const t={name:c.Navigator};return l({context:null,...e},t)}var gt=Object.getOwnPropertyDescriptor,St=(e,t,r,n)=>{for(var o=n>1?void 0:n?gt(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=s(o)||o);return o};const Et="navigator.navigate";exports.NavigateCommand=class{};exports.NavigateCommand=St([d({id:Et})],exports.NavigateCommand);const Ct="notifications";c.Notification=Ct;const _t="routeRegistry";c.RouteRegistry=_t;var z=(e=>(e.Pending="PENDING",e.Started="STARTED",e.Retry="RETRY",e.Success="SUCCESS",e.Failure="FAILURE",e))(z||{}),ee=(e=>(e.Created="task.created",e.Success="task.success",e.Failed="task.failed",e))(ee||{});const Ot="state.tasks";c.TaskRepository=Ot;const At="state.configs";c.ConfigRepository=At;function Rt(e){const t={name:c.ConfigRepository};return l(e,t)}const wt="state.device";c.Device=wt;function jt(e={}){const t={name:c.Device};return l(e,t)}const Pt="state.filters";c.FilterRepository=Pt;function Dt(e={}){const t={name:c.FilterRepository};return l(e,t)}const It="state.user-data";c.UserDataRepository=It;function Lt(e={}){const t={name:c.UserDataRepository};return l(e,t)}const Nt="state.application";c.Application=Nt;function Mt(e={}){const t={name:c.Application};return e.map=[Tt,...e.map||[]],l(e,t)}function Tt(e){return e.applicationName}function $t(e={}){const t={name:c.Application};return e.map=[xt,...e.map||[]],l(e,t)}function xt(e){return e.currentUser}function Vt(e={}){const t={name:c.Application};return e.map=[Ut,...e.map||[]],l(e,t)}function Ut(e){return e.session}const Ft="userPreferences";c.UserPreferencesRepository=Ft;const Bt="datetimeformatter";c.DateTimeFormatter=Bt;function kt(e){return e.type==="limeobject"}function Wt(e){return e.type==="action"}const Gt="conditionRegistry";c.ConditionRegistry=Gt;const Ht="viewFactoryRegistry";c.ViewFactoryRegistry=Ht;const Qt="webComponentRegistry";c.WebComponentRegistry=Qt;const Yt="state.notifications";c.NotificationRepository=Yt;const qt="pollerFactory";c.PollerFactory=qt;const Kt={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Xt="logger";c.Logger=Xt;exports.AggregateOperator=ut;exports.Command=d;exports.CommandEventName=K;exports.HttpMethod=ft;exports.IdleStateEventName=re;exports.LogLevel=Kt;exports.Operator=Z;exports.PlatformServiceName=c;exports.SelectApplicationName=Mt;exports.SelectConfig=Rt;exports.SelectCurrentLimeObject=ke;exports.SelectCurrentLimeType=Me;exports.SelectCurrentUser=$t;exports.SelectDevice=jt;exports.SelectFilters=Dt;exports.SelectLimeObjects=Be;exports.SelectLimeTypes=Ne;exports.SelectQueryParam=vt;exports.SelectSession=Vt;exports.SelectUserData=Lt;exports.TaskEventType=ee;exports.TaskState=z;exports.findLimetypeByLabel=$e;exports.getCommandId=X;exports.getCommandIds=J;exports.getPropertiesByType=xe;exports.getPropertyByLabel=Ve;exports.getPropertyByName=Ue;exports.hasLabel=P;exports.isActionCondition=Wt;exports.isDate=ie;exports.isFloat=ce;exports.isLimeObjectCondition=kt;exports.isRelation=ne;exports.isSingleRelation=oe;exports.isString=se;
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function L(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var _=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var a=A(c),u=a.next();!u.done;u=a.next()){var O=u.value;O.remove(this)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else c.remove(this);var M=this.initialTeardown;if(d(M))try{M()}catch(f){i=f instanceof R?f.errors:[f]}var T=this._finalizers;if(T){this._finalizers=null;try{for(var v=A(T),y=v.next();!y.done;y=v.next()){var se=y.value;try{U(se)}catch(f){i=i??[],f instanceof R?i=I(I([],j(i)),j(f.errors)):i.push(f)}}}catch(f){n={error:f}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new R(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&L(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&L(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),G=_.EMPTY;function Q(e){return e instanceof _||e&&"closed"in e&&d(e.remove)&&d(e.add)&&d(e.unsubscribe)}function U(e){d(e)?e():e.unsubscribe()}var he={Promise:void 0},ye={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,I([e,t],j(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function be(e){ye.setTimeout(function(){throw e})}function $(){}function E(e){e()}var Y=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Q(r)&&r.add(n)):n.destination=Se,n}return t.create=function(r,n,o){return new D(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(_),ve=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){g(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){g(n)}else g(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){g(r)}},e})(),D=(function(e){b(t,e);function t(r,n,o){var i=e.call(this)||this,c;return d(r)||!r?c={next:r??void 0,error:n??void 0,complete:o??void 0}:c=r,i.destination=new ve(c),i}return t})(Y);function g(e){be(e)}function ge(e){throw e}var Se={closed:!0,next:$,error:ge,complete:$},Ee=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ce(e){return e}function _e(e){return e.length===0?Ce:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var F=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=Re(t)?t:new D(t,r,n);return E(function(){var c=o,a=c.operator,u=c.source;i.add(a?a.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=V(r),new r(function(o,i){var c=new D({next:function(a){try{t(a)}catch(u){i(u),c.unsubscribe()}},error:i,complete:o});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ee]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _e(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=V(t),new t(function(n,o){var i;r.subscribe(function(c){return i=c},function(c){return o(c)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})();function V(e){var t;return(t=e??he.Promise)!==null&&t!==void 0?t:Promise}function Oe(e){return e&&d(e.next)&&d(e.error)&&d(e.complete)}function Re(e){return e&&e instanceof Y||Oe(e)&&Q(e)}var Pe=W(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),K=(function(e){b(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new k(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Pe},t.prototype.next=function(r){var n=this;E(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=A(n.currentObservers),a=c.next();!a.done;a=c.next()){var u=a.value;u.next(r)}}catch(O){o={error:O}}finally{try{a&&!a.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;E(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;E(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,c=o.isStopped,a=o.observers;return i||c?G:(this.currentObservers=null,a.push(r),new _(function(){n.currentObservers=null,L(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,c=n.isStopped;o?r.error(i):c&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new k(r,n)},t})(F),k=(function(e){b(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:G},t})(K),we=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(K);function Ae(e){return e}function l(e,t){return(r,n)=>{const o=je(r,n,e,t);o.length===1&&Ie(r,o)}}const B=new WeakMap,C=new WeakMap,X=new WeakMap;function je(e,t,r,n){let o=B.get(e);return o||(o=[],B.set(e,o)),o.push({options:r,name:t,optionFactory:n.optionFactory||Ae,service:{name:n.name,method:n.method||"subscribe"}}),o}function Ie(e,t){e.connectedCallback=J(e.connectedCallback,t),e.componentWillLoad=Le(e.componentWillLoad,t),e.componentDidUnload=H(e.componentDidUnload),e.disconnectedCallback=H(e.disconnectedCallback)}function J(e,t){return async function(...r){X.set(this,!0),C.set(this,[]),await Z(this);const n=new we(this.context);Ne(this,"context",n);for(const o of t)o.options=o.optionFactory(o.options,this),De(o.options)&&(o.options.context=n),xe(this,o);if(e)return e.apply(this,r)}}function Le(e,t){return async function(...r){return X.get(this)===!0?(await Z(this),e?e.apply(this,r):void 0):J(e,t).apply(this,r)}}function H(e){return async function(...t){let r;return e&&(r=e.apply(this,t)),Me(this),r}}function De(e){return"context"in e}function Z(e){const t=[];return e.platform||t.push(q(e,"platform")),e.context||t.push(q(e,"context")),t.length===0?Promise.resolve():Promise.all(t)}function q(e,t){const r=N.getElement(e);return new Promise(n=>{Object.defineProperty(r,t,{configurable:!0,set:o=>{delete r[t],r[t]=o,n()}})})}function Ne(e,t,r){const n=N.getElement(e),{get:o,set:i}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);Object.defineProperty(n,t,{configurable:!0,get:o,set:function(c){i.call(this,c),r.next(c)}})}function xe(e,t){const r=Ue(e,t);if(typeof r!="function")return;C.get(e).push(r)}function Me(e){const t=C.get(e);for(const r of t)r();C.set(e,[])}function Te(e,t){return r=>{e[t]=r}}function Ue(e,t){const r={...t.options};$e(r,e);const n=t.service.name,o=e.platform;if(!o.has(n))throw new Error(`Service ${n} does not exist`);return o.get(n)[t.service.method](Te(e,t.name),r)}function $e(e,t){e.filter&&(e.filter=e.filter.map(r=>r.bind(t))),e.map&&(e.map=e.map.map(r=>r.bind(t)))}function Fe(e={}){const t={name:s.LimeTypeRepository};return l(e,t)}function Ve(e={}){const t={name:s.LimeTypeRepository};return e.map=[ke,...e.map||[]],e.context=null,l(e,t)}function ke(e){const{limetype:t}=this.context;return e[t]}const Be=e=>t=>Object.values(t).find(x(e));function He(e,t){return Object.values(e.properties).filter(r=>r.type===t)}function qe(e,t){return Object.values(e.properties).find(x(t))}function We(e,t){return e.properties[t]}const x=e=>t=>t?.label===e,Ge="state.limeobjects";s.LimeObjectRepository=Ge;function Qe(e={}){const t={name:s.LimeObjectRepository,optionFactory:Xe};return l(e,t)}function Ye(e={}){const t={name:s.LimeObjectRepository};return e.map=[Ke,...e.map||[]],e.context=null,l(e,t)}function Ke(e){const{limetype:t,id:r}=this.context;if(e[t])return e[t].find(n=>n.id===r)}function Xe(e,t){return e.getLimetype&&(e.limetype=e.getLimetype(t)),e}var z=(e=>(e.Received="command.received",e.Handled="command.handled",e.Failed="command.failed",e))(z||{});function m(e){return t=>{Je(t,e.id),Ze(t,e.id)}}function Je(e,t){e.commandId=t}function Ze(e,t){Object.defineProperty(e,Symbol.hasInstance,{value:r=>te(r).includes(t)})}function ee(e){return typeof e=="string"?e:e&&e.constructor&&e.constructor.commandId?e.constructor.commandId:e&&e.commandId?e.commandId:null}function te(e){let t=[],r,n=e;for(;r=ee(n);)t=[...t,r],n=Object.getPrototypeOf(n);return[...new Set(t)]}const ze="commandBus";s.CommandBus=ze;var et=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?et(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const rt="limeobject.bulk-create-dialog";exports.BulkCreateDialogCommand=class{context;filter;relation};exports.BulkCreateDialogCommand=tt([m({id:rt})],exports.BulkCreateDialogCommand);var nt=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var o=n>1?void 0:n?nt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const it="limeobject.create-dialog";exports.CreateLimeobjectDialogCommand=class{limetype;limeobject;route=!1;title;subtitle;context;autoAttachRelation;saveCommand};exports.CreateLimeobjectDialogCommand=ot([m({id:it})],exports.CreateLimeobjectDialogCommand);var ct=Object.getOwnPropertyDescriptor,st=(e,t,r,n)=>{for(var o=n>1?void 0:n?ct(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const at="limeobject.delete-object";exports.DeleteObjectCommand=class{context};exports.DeleteObjectCommand=st([m({id:at})],exports.DeleteObjectCommand);var ut=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ut(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const ft="limeobject.object-access";exports.OpenObjectAccessDialogCommand=class{context};exports.OpenObjectAccessDialogCommand=lt([m({id:ft})],exports.OpenObjectAccessDialogCommand);var pt=Object.getOwnPropertyDescriptor,dt=(e,t,r,n)=>{for(var o=n>1?void 0:n?pt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const mt="limeobject.save-object";exports.SaveLimeObjectCommand=class{context;limeobject;route=!1;label};exports.SaveLimeObjectCommand=dt([m({id:mt})],exports.SaveLimeObjectCommand);var re=(e=>(e.AND="AND",e.OR="OR",e.NOT="!",e.EQUALS="=",e.NOT_EQUALS="!=",e.GREATER=">",e.LESS="<",e.IN="IN",e.BEGINS="=?",e.LIKE="?",e.LESS_OR_EQUAL="<=",e.GREATER_OR_EQUAL=">=",e.ENDS="=$",e))(re||{});const ht={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"},yt="query";s.Query=yt;const bt={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"},vt="http";s.Http=vt;const gt="eventDispatcher";s.EventDispatcher=gt;const St="translate";s.Translate=St;const Et="dialog";s.Dialog=Et;const Ct="keybindingRegistry";s.KeybindingRegistry=Ct;const _t="navigator";s.Navigator=_t;function Ot(e){const t={name:s.Navigator};return l({context:null,...e},t)}var Rt=Object.getOwnPropertyDescriptor,Pt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Rt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const wt="navigator.navigate";exports.NavigateCommand=class{path;query;hash;state};exports.NavigateCommand=Pt([m({id:wt})],exports.NavigateCommand);const At="notifications";s.Notification=At;const jt="routeRegistry";s.RouteRegistry=jt;var ne=(e=>(e.Pending="PENDING",e.Started="STARTED",e.Retry="RETRY",e.Success="SUCCESS",e.Failure="FAILURE",e))(ne||{}),oe=(e=>(e.Created="task.created",e.Success="task.success",e.Failed="task.failed",e))(oe||{});const It="state.tasks";s.TaskRepository=It;const Lt="state.configs";s.ConfigRepository=Lt;function Dt(e){const t={name:s.ConfigRepository};return l(e,t)}const Nt="state.device";s.Device=Nt;function xt(e={}){const t={name:s.Device};return l(e,t)}const Mt="state.filters";s.FilterRepository=Mt;function Tt(e={}){const t={name:s.FilterRepository};return l(e,t)}const Ut="state.user-data";s.UserDataRepository=Ut;function $t(e={}){const t={name:s.UserDataRepository};return l(e,t)}const Ft="state.application";s.Application=Ft;function Vt(e={}){const t={name:s.Application};return e.map=[kt,...e.map||[]],l(e,t)}function kt(e){return e.applicationName}function Bt(e={}){const t={name:s.Application};return e.map=[Ht,...e.map||[]],l(e,t)}function Ht(e){return e.currentUser}function qt(e={}){const t={name:s.Application};return e.map=[Wt,...e.map||[]],l(e,t)}function Wt(e){return e.session}const Gt="userPreferences";s.UserPreferencesRepository=Gt;const Qt="datetimeformatter";s.DateTimeFormatter=Qt;function Yt(e){return e.type==="limeobject"}function Kt(e){return e.type==="action"}const Xt="conditionRegistry";s.ConditionRegistry=Xt;const Jt="viewFactoryRegistry";s.ViewFactoryRegistry=Jt;const Zt="webComponentRegistry";s.WebComponentRegistry=Zt;const zt="state.notifications";s.NotificationRepository=zt;const er="pollerFactory";s.PollerFactory=er;const tr={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},rr="logger";s.Logger=rr;let h,S;function ie(e){const t=window.Lime?.logger?.createLogger;return typeof t!="function"?(console.warn(`Logger factory is not configured. Returning console logger for scope "${e}".`),console):(S===void 0&&(S=ce(nr())),S&&(e=`${S}:${e}`),t(e))}function nr(){return h!==void 0?h:{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href}!==void 0&&typeof(typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href)=="string"?(h=typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href,h):(h=or(),h)}function or(){try{const e=new Error(".").stack;if(!e)return null;const t=e.split(`
|
|
4
|
+
`);for(const r of t){const n=r.match(/(https?:\/\/[^)\s:]+)/);if(n)return n[1]}return null}catch{return null}}function ce(e){if(!e)return null;const t=ir(e)||cr(e)||sr(e)||ar(e);return t||null}function ir(e){const t=/\/([^/]+)-lwc-components\//,r=e.match(t);return r?r[1]:null}function cr(e){const t=/\/packages\/(?:@[^/]+\/)?([^/]+)/,r=e.match(t);return r?r[1]:null}function sr(e){const t=e.indexOf("+");if(t===-1)return null;const r=e.slice(0,t),n=r.lastIndexOf("/");return n===-1?null:r.slice(n+1)}function ar(e){const t=/\/static\/([^/]+)\//,r=e.match(t);return r?r[1]:null}const ur={Low:"low",Medium:"medium",High:"high",Critical:"critical"},lr="problemRepository";s.ProblemRepository=lr;let P=null;function fr(e,t){P||(P=ie("uncaught-error"));const r={};t&&(r.element=t.tagName,t.id&&(r.elementId=t.id));const n=e instanceof Error?e.message:String(e),o=e instanceof Error?e:void 0;P.error(n,o,r)}try{N.setErrorHandler(fr)}catch{}exports.AggregateOperator=ht;exports.Command=m;exports.CommandEventName=z;exports.HttpMethod=bt;exports.IdleStateEventName=ae;exports.LogLevel=tr;exports.Operator=re;exports.PlatformServiceName=s;exports.ProblemSeverity=ur;exports.SelectApplicationName=Vt;exports.SelectConfig=Dt;exports.SelectCurrentLimeObject=Ye;exports.SelectCurrentLimeType=Ve;exports.SelectCurrentUser=Bt;exports.SelectDevice=xt;exports.SelectFilters=Tt;exports.SelectLimeObjects=Qe;exports.SelectLimeTypes=Fe;exports.SelectQueryParam=Ot;exports.SelectSession=qt;exports.SelectUserData=$t;exports.TaskEventType=oe;exports.TaskState=ne;exports.createLogger=ie;exports.findLimetypeByLabel=Be;exports.getCommandId=ee;exports.getCommandIds=te;exports.getPackageNameFromUrl=ce;exports.getPropertiesByType=He;exports.getPropertyByLabel=qe;exports.getPropertyByName=We;exports.hasLabel=x;exports.isActionCondition=Kt;exports.isDate=fe;exports.isFloat=de;exports.isLimeObjectCondition=Yt;exports.isRelation=ue;exports.isSingleRelation=le;exports.isString=pe;
|
|
4
5
|
//# sourceMappingURL=index.cjs.map
|