@mintplayer/ng-spark 0.0.9 → 0.1.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/ng-spark",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "Angular component library for MintPlayer.Spark CRUD applications",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@angular/common": "^21.0.0",
|
|
14
14
|
"@angular/router": "^21.0.0",
|
|
15
15
|
"@angular/forms": "^21.0.0",
|
|
16
|
-
"@mintplayer/ng-bootstrap": "^21.12.
|
|
16
|
+
"@mintplayer/ng-bootstrap": "^21.12.4",
|
|
17
17
|
"@mintplayer/pagination": "*",
|
|
18
18
|
"rxjs": "~7.8.0"
|
|
19
19
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { WritableSignal, InjectionToken, Type, TemplateRef, PipeTransform, InputSignal, Provider } from '@angular/core';
|
|
3
3
|
import { SortColumn, PaginationResponse } from '@mintplayer/pagination';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
4
5
|
import { Color } from '@mintplayer/ng-bootstrap';
|
|
5
6
|
import { DatatableSettings } from '@mintplayer/ng-bootstrap/datatable';
|
|
6
7
|
import * as _mintplayer_ng_spark from '@mintplayer/ng-spark';
|
|
@@ -170,6 +171,8 @@ interface SparkQuery {
|
|
|
170
171
|
useProjection?: boolean;
|
|
171
172
|
/** Optional entity type name (e.g., "Person"). When set, used for entity type resolution. */
|
|
172
173
|
entityType?: string;
|
|
174
|
+
/** When true, this query uses WebSocket streaming with snapshot + patch updates. */
|
|
175
|
+
isStreamingQuery?: boolean;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
interface QueryResult {
|
|
@@ -263,6 +266,24 @@ interface SparkConfig {
|
|
|
263
266
|
declare const SPARK_CONFIG: InjectionToken<SparkConfig>;
|
|
264
267
|
declare const defaultSparkConfig: SparkConfig;
|
|
265
268
|
|
|
269
|
+
interface StreamingSnapshotMessage {
|
|
270
|
+
type: 'snapshot';
|
|
271
|
+
data: PersistentObject[];
|
|
272
|
+
}
|
|
273
|
+
interface StreamingPatchItem {
|
|
274
|
+
id: string;
|
|
275
|
+
attributes: Record<string, any>;
|
|
276
|
+
}
|
|
277
|
+
interface StreamingPatchMessage {
|
|
278
|
+
type: 'patch';
|
|
279
|
+
updated: StreamingPatchItem[];
|
|
280
|
+
}
|
|
281
|
+
interface StreamingErrorMessage {
|
|
282
|
+
type: 'error';
|
|
283
|
+
message: string;
|
|
284
|
+
}
|
|
285
|
+
type StreamingMessage = StreamingSnapshotMessage | StreamingPatchMessage | StreamingErrorMessage;
|
|
286
|
+
|
|
266
287
|
declare class SparkService {
|
|
267
288
|
private readonly config;
|
|
268
289
|
private readonly baseUrl;
|
|
@@ -305,6 +326,16 @@ declare class SparkService {
|
|
|
305
326
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SparkService>;
|
|
306
327
|
}
|
|
307
328
|
|
|
329
|
+
declare class SparkStreamingService {
|
|
330
|
+
private readonly config;
|
|
331
|
+
private readonly baseUrl;
|
|
332
|
+
private readonly ngZone;
|
|
333
|
+
connectToStreamingQuery(queryId: string): Observable<StreamingMessage>;
|
|
334
|
+
private buildWebSocketUrl;
|
|
335
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkStreamingService, never>;
|
|
336
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SparkStreamingService>;
|
|
337
|
+
}
|
|
338
|
+
|
|
308
339
|
declare class SparkLanguageService {
|
|
309
340
|
private readonly http;
|
|
310
341
|
private readonly config;
|
|
@@ -509,7 +540,9 @@ declare class SparkQueryListComponent {
|
|
|
509
540
|
private readonly route;
|
|
510
541
|
private readonly router;
|
|
511
542
|
private readonly sparkService;
|
|
543
|
+
private readonly streamingService;
|
|
512
544
|
private readonly rendererRegistry;
|
|
545
|
+
private readonly destroyRef;
|
|
513
546
|
extraActionsTemplate: _angular_core.InputSignal<TemplateRef<void>>;
|
|
514
547
|
rowClicked: _angular_core.OutputEmitterRef<PersistentObject>;
|
|
515
548
|
createClicked: _angular_core.OutputEmitterRef<void>;
|
|
@@ -523,6 +556,10 @@ declare class SparkQueryListComponent {
|
|
|
523
556
|
searchTerm: string;
|
|
524
557
|
canRead: _angular_core.WritableSignal<boolean>;
|
|
525
558
|
canCreate: _angular_core.WritableSignal<boolean>;
|
|
559
|
+
isStreaming: _angular_core.WritableSignal<boolean>;
|
|
560
|
+
private streamingSub;
|
|
561
|
+
private allItems;
|
|
562
|
+
private filteredItems;
|
|
526
563
|
settings: _angular_core.WritableSignal<DatatableSettings>;
|
|
527
564
|
virtualDataSource: _angular_core.WritableSignal<VirtualDatatableDataSource<PersistentObject>>;
|
|
528
565
|
virtualSettings: _angular_core.WritableSignal<DatatableSettings>;
|
|
@@ -542,6 +579,10 @@ declare class SparkQueryListComponent {
|
|
|
542
579
|
getColumnRendererInputs(item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any>;
|
|
543
580
|
private loadLookupReferenceOptions;
|
|
544
581
|
onCreate(): void;
|
|
582
|
+
private connectStreaming;
|
|
583
|
+
private disconnectStreaming;
|
|
584
|
+
private handleStreamingMessage;
|
|
585
|
+
private applyFilter;
|
|
545
586
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkQueryListComponent, never>;
|
|
546
587
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkQueryListComponent, "spark-query-list", never, { "extraActionsTemplate": { "alias": "extraActionsTemplate"; "required": false; "isSignal": true; }; }, { "rowClicked": "rowClicked"; "createClicked": "createClicked"; }, never, never, true, never>;
|
|
547
588
|
}
|
|
@@ -814,5 +855,5 @@ declare function sparkRoutes(config?: SparkRouteConfig): Routes;
|
|
|
814
855
|
|
|
815
856
|
declare function provideSpark(config?: Partial<SparkConfig>): Provider[];
|
|
816
857
|
|
|
817
|
-
export { ArrayValuePipe, AsDetailCellValuePipe, AsDetailColumnsPipe, AsDetailDisplayValuePipe, AsDetailTypePipe, AttributeValuePipe, CanCreateDetailRowPipe, CanDeleteDetailRowPipe, ELookupDisplayType, ErrorForAttributePipe, IconNamePipe, InlineRefOptionsPipe, InputTypePipe, LookupDisplayTypePipe, LookupDisplayValuePipe, LookupOptionsPipe, RawAttributeValuePipe, ReferenceAttrValuePipe, ReferenceDisplayValuePipe, ReferenceLinkRoutePipe, ResolveTranslationPipe, RetryActionService, RouterLinkPipe, SPARK_ATTRIBUTE_RENDERERS, SPARK_CONFIG, ShowedOn, SparkIconComponent, SparkIconRegistry, SparkLanguageService, SparkPoCreateComponent, SparkPoDetailComponent, SparkPoEditComponent, SparkPoFormComponent, SparkQueryListComponent, SparkRetryActionModalComponent, SparkService, SparkSubQueryComponent, TranslateKeyPipe, currentLanguage, defaultSparkConfig, hasShowedOnFlag, provideSpark, provideSparkAttributeRenderers, resolveTranslation, sparkRoutes };
|
|
818
|
-
export type { AttributeGroup, AttributeTab, CustomActionDefinition, EntityAttributeDefinition, EntityPermissions, EntityType, LookupReference, LookupReferenceListItem, LookupReferenceValue, PersistentObject, PersistentObjectAttribute, ProgramUnit, ProgramUnitGroup, ProgramUnitsConfiguration, QueryResult, RetryActionPayload, RetryActionResult, SparkAttributeColumnRenderer, SparkAttributeDetailRenderer, SparkAttributeEditRenderer, SparkAttributeRendererRegistration, SparkConfig, SparkQuery, SparkQueryRenderMode, SparkQuerySortColumn, SparkRouteConfig, TranslatedString, ValidationError, ValidationRule };
|
|
858
|
+
export { ArrayValuePipe, AsDetailCellValuePipe, AsDetailColumnsPipe, AsDetailDisplayValuePipe, AsDetailTypePipe, AttributeValuePipe, CanCreateDetailRowPipe, CanDeleteDetailRowPipe, ELookupDisplayType, ErrorForAttributePipe, IconNamePipe, InlineRefOptionsPipe, InputTypePipe, LookupDisplayTypePipe, LookupDisplayValuePipe, LookupOptionsPipe, RawAttributeValuePipe, ReferenceAttrValuePipe, ReferenceDisplayValuePipe, ReferenceLinkRoutePipe, ResolveTranslationPipe, RetryActionService, RouterLinkPipe, SPARK_ATTRIBUTE_RENDERERS, SPARK_CONFIG, ShowedOn, SparkIconComponent, SparkIconRegistry, SparkLanguageService, SparkPoCreateComponent, SparkPoDetailComponent, SparkPoEditComponent, SparkPoFormComponent, SparkQueryListComponent, SparkRetryActionModalComponent, SparkService, SparkStreamingService, SparkSubQueryComponent, TranslateKeyPipe, currentLanguage, defaultSparkConfig, hasShowedOnFlag, provideSpark, provideSparkAttributeRenderers, resolveTranslation, sparkRoutes };
|
|
859
|
+
export type { AttributeGroup, AttributeTab, CustomActionDefinition, EntityAttributeDefinition, EntityPermissions, EntityType, LookupReference, LookupReferenceListItem, LookupReferenceValue, PersistentObject, PersistentObjectAttribute, ProgramUnit, ProgramUnitGroup, ProgramUnitsConfiguration, QueryResult, RetryActionPayload, RetryActionResult, SparkAttributeColumnRenderer, SparkAttributeDetailRenderer, SparkAttributeEditRenderer, SparkAttributeRendererRegistration, SparkConfig, SparkQuery, SparkQueryRenderMode, SparkQuerySortColumn, SparkRouteConfig, StreamingErrorMessage, StreamingMessage, StreamingPatchItem, StreamingPatchMessage, StreamingSnapshotMessage, TranslatedString, ValidationError, ValidationRule };
|