@mintplayer/ng-spark 0.0.9 → 0.1.1
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.
|
|
4
|
+
"version": "0.1.1",
|
|
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;
|
|
@@ -283,7 +304,10 @@ declare class SparkService {
|
|
|
283
304
|
take?: number;
|
|
284
305
|
search?: string;
|
|
285
306
|
}): Promise<QueryResult>;
|
|
286
|
-
executeQueryByName(queryName: string
|
|
307
|
+
executeQueryByName(queryName: string, options?: {
|
|
308
|
+
parentId?: string;
|
|
309
|
+
parentType?: string;
|
|
310
|
+
}): Promise<QueryResult>;
|
|
287
311
|
getProgramUnits(): Promise<ProgramUnitsConfiguration>;
|
|
288
312
|
list(type: string): Promise<PersistentObject[]>;
|
|
289
313
|
get(type: string, id: string): Promise<PersistentObject>;
|
|
@@ -305,6 +329,16 @@ declare class SparkService {
|
|
|
305
329
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SparkService>;
|
|
306
330
|
}
|
|
307
331
|
|
|
332
|
+
declare class SparkStreamingService {
|
|
333
|
+
private readonly config;
|
|
334
|
+
private readonly baseUrl;
|
|
335
|
+
private readonly ngZone;
|
|
336
|
+
connectToStreamingQuery(queryId: string): Observable<StreamingMessage>;
|
|
337
|
+
private buildWebSocketUrl;
|
|
338
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkStreamingService, never>;
|
|
339
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SparkStreamingService>;
|
|
340
|
+
}
|
|
341
|
+
|
|
308
342
|
declare class SparkLanguageService {
|
|
309
343
|
private readonly http;
|
|
310
344
|
private readonly config;
|
|
@@ -341,6 +375,8 @@ declare class SparkPoFormComponent {
|
|
|
341
375
|
validationErrors: _angular_core.InputSignal<ValidationError[]>;
|
|
342
376
|
showButtons: _angular_core.InputSignal<boolean>;
|
|
343
377
|
isSaving: _angular_core.InputSignal<boolean>;
|
|
378
|
+
parentId: _angular_core.InputSignal<string>;
|
|
379
|
+
parentType: _angular_core.InputSignal<string>;
|
|
344
380
|
save: _angular_core.OutputEmitterRef<void>;
|
|
345
381
|
cancel: _angular_core.OutputEmitterRef<void>;
|
|
346
382
|
colors: typeof Color;
|
|
@@ -403,7 +439,7 @@ declare class SparkPoFormComponent {
|
|
|
403
439
|
selectReferenceItem(item: PersistentObject): void;
|
|
404
440
|
closeReferenceModal(): void;
|
|
405
441
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkPoFormComponent, never>;
|
|
406
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkPoFormComponent, "spark-po-form", never, { "entityType": { "alias": "entityType"; "required": false; "isSignal": true; }; "formData": { "alias": "formData"; "required": false; "isSignal": true; }; "validationErrors": { "alias": "validationErrors"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "isSaving": { "alias": "isSaving"; "required": false; "isSignal": true; }; }, { "formData": "formDataChange"; "save": "save"; "cancel": "cancel"; }, never, never, true, never>;
|
|
442
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SparkPoFormComponent, "spark-po-form", never, { "entityType": { "alias": "entityType"; "required": false; "isSignal": true; }; "formData": { "alias": "formData"; "required": false; "isSignal": true; }; "validationErrors": { "alias": "validationErrors"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "isSaving": { "alias": "isSaving"; "required": false; "isSignal": true; }; "parentId": { "alias": "parentId"; "required": false; "isSignal": true; }; "parentType": { "alias": "parentType"; "required": false; "isSignal": true; }; }, { "formData": "formDataChange"; "save": "save"; "cancel": "cancel"; }, never, never, true, never>;
|
|
407
443
|
}
|
|
408
444
|
|
|
409
445
|
declare class SparkPoCreateComponent {
|
|
@@ -509,7 +545,9 @@ declare class SparkQueryListComponent {
|
|
|
509
545
|
private readonly route;
|
|
510
546
|
private readonly router;
|
|
511
547
|
private readonly sparkService;
|
|
548
|
+
private readonly streamingService;
|
|
512
549
|
private readonly rendererRegistry;
|
|
550
|
+
private readonly destroyRef;
|
|
513
551
|
extraActionsTemplate: _angular_core.InputSignal<TemplateRef<void>>;
|
|
514
552
|
rowClicked: _angular_core.OutputEmitterRef<PersistentObject>;
|
|
515
553
|
createClicked: _angular_core.OutputEmitterRef<void>;
|
|
@@ -523,6 +561,10 @@ declare class SparkQueryListComponent {
|
|
|
523
561
|
searchTerm: string;
|
|
524
562
|
canRead: _angular_core.WritableSignal<boolean>;
|
|
525
563
|
canCreate: _angular_core.WritableSignal<boolean>;
|
|
564
|
+
isStreaming: _angular_core.WritableSignal<boolean>;
|
|
565
|
+
private streamingSub;
|
|
566
|
+
private allItems;
|
|
567
|
+
private filteredItems;
|
|
526
568
|
settings: _angular_core.WritableSignal<DatatableSettings>;
|
|
527
569
|
virtualDataSource: _angular_core.WritableSignal<VirtualDatatableDataSource<PersistentObject>>;
|
|
528
570
|
virtualSettings: _angular_core.WritableSignal<DatatableSettings>;
|
|
@@ -542,6 +584,10 @@ declare class SparkQueryListComponent {
|
|
|
542
584
|
getColumnRendererInputs(item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any>;
|
|
543
585
|
private loadLookupReferenceOptions;
|
|
544
586
|
onCreate(): void;
|
|
587
|
+
private connectStreaming;
|
|
588
|
+
private disconnectStreaming;
|
|
589
|
+
private handleStreamingMessage;
|
|
590
|
+
private applyFilter;
|
|
545
591
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SparkQueryListComponent, never>;
|
|
546
592
|
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
593
|
}
|
|
@@ -814,5 +860,5 @@ declare function sparkRoutes(config?: SparkRouteConfig): Routes;
|
|
|
814
860
|
|
|
815
861
|
declare function provideSpark(config?: Partial<SparkConfig>): Provider[];
|
|
816
862
|
|
|
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 };
|
|
863
|
+
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 };
|
|
864
|
+
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 };
|