@memberjunction/ng-user-routines 0.0.0 → 5.45.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/dist/lib/my-routines-list.component.d.ts +119 -0
- package/dist/lib/my-routines-list.component.d.ts.map +1 -0
- package/dist/lib/my-routines-list.component.js +574 -0
- package/dist/lib/my-routines-list.component.js.map +1 -0
- package/dist/lib/new-routine.component.d.ts +182 -0
- package/dist/lib/new-routine.component.d.ts.map +1 -0
- package/dist/lib/new-routine.component.js +1070 -0
- package/dist/lib/new-routine.component.js.map +1 -0
- package/dist/lib/routine-history.component.d.ts +65 -0
- package/dist/lib/routine-history.component.d.ts.map +1 -0
- package/dist/lib/routine-history.component.js +290 -0
- package/dist/lib/routine-history.component.js.map +1 -0
- package/dist/lib/routine-target-catalog.d.ts +48 -0
- package/dist/lib/routine-target-catalog.d.ts.map +1 -0
- package/dist/lib/routine-target-catalog.js +59 -0
- package/dist/lib/routine-target-catalog.js.map +1 -0
- package/dist/lib/routine-ui-helpers.d.ts +49 -0
- package/dist/lib/routine-ui-helpers.d.ts.map +1 -0
- package/dist/lib/routine-ui-helpers.js +174 -0
- package/dist/lib/routine-ui-helpers.js.map +1 -0
- package/dist/lib/user-routines-command-center.component.d.ts +88 -0
- package/dist/lib/user-routines-command-center.component.d.ts.map +1 -0
- package/dist/lib/user-routines-command-center.component.js +372 -0
- package/dist/lib/user-routines-command-center.component.js.map +1 -0
- package/dist/lib/user-routines-events.d.ts +88 -0
- package/dist/lib/user-routines-events.d.ts.map +1 -0
- package/dist/lib/user-routines-events.js +97 -0
- package/dist/lib/user-routines-events.js.map +1 -0
- package/dist/lib/user-routines-slide-in.component.d.ts +57 -0
- package/dist/lib/user-routines-slide-in.component.d.ts.map +1 -0
- package/dist/lib/user-routines-slide-in.component.js +170 -0
- package/dist/lib/user-routines-slide-in.component.js.map +1 -0
- package/dist/lib/user-routines.module.d.ts +37 -0
- package/dist/lib/user-routines.module.d.ts.map +1 -0
- package/dist/lib/user-routines.module.js +113 -0
- package/dist/lib/user-routines.module.js.map +1 -0
- package/dist/public-api.d.ts +10 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +19 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +49 -7
- package/README.md +0 -45
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
|
+
import { MJUserRoutineEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { DescribeCronExpression } from '@memberjunction/global';
|
|
5
|
+
import { FormatRelativeTime, RoutineChipVariant, RoutineStatusVariant, RunStatusVariant } from './routine-ui-helpers';
|
|
6
|
+
import { ConversationOpenedEventArgs, AfterRoutineDeletedEventArgs, AfterRoutinePausedEventArgs, AfterRoutineRunNowEventArgs, BeforeRoutineDeletedEventArgs, BeforeRoutinePausedEventArgs, BeforeRoutineRunNowEventArgs, RoutineSelectedEventArgs } from './user-routines-events';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/** Filter value for the routine Status facet ('all' disables the facet). */
|
|
9
|
+
export type RoutineStatusFilter = 'all' | MJUserRoutineEntity['Status'];
|
|
10
|
+
/** Emitted whenever the loaded/filtered routine counts change (load, filter, refresh). */
|
|
11
|
+
export interface RoutineCounts {
|
|
12
|
+
Filtered: number;
|
|
13
|
+
Total: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* "My Routines" — card list of the CURRENT USER's routines with per-card quick actions
|
|
17
|
+
* (run now / pause-resume / edit / history / delete). Data comes from the shared
|
|
18
|
+
* {@link UserRoutineEngine} cache — no ad-hoc RunViews.
|
|
19
|
+
*
|
|
20
|
+
* Reusable (Generic) component: no Router, no page chrome. Mutating quick actions raise
|
|
21
|
+
* cancelable `Before*` events (set `Cancel = true` to veto) followed by informational
|
|
22
|
+
* `After*` events, per the standard MJ Before/After event idiom.
|
|
23
|
+
*
|
|
24
|
+
* Run-now v1 semantics: sets `NextRunAt = now` and saves — the User Routine Dispatcher
|
|
25
|
+
* job claims due routines on its next sweep (within a minute).
|
|
26
|
+
*/
|
|
27
|
+
export declare class MyRoutinesListComponent extends BaseAngularComponent implements OnInit, OnDestroy {
|
|
28
|
+
private cdr;
|
|
29
|
+
private notifications;
|
|
30
|
+
private confirm;
|
|
31
|
+
private destroy$;
|
|
32
|
+
private _searchText;
|
|
33
|
+
/** Free-text filter over routine name, description, and agent name. */
|
|
34
|
+
get SearchText(): string;
|
|
35
|
+
set SearchText(value: string);
|
|
36
|
+
private _statusFilter;
|
|
37
|
+
/** Status facet filter. */
|
|
38
|
+
get StatusFilter(): RoutineStatusFilter;
|
|
39
|
+
set StatusFilter(value: RoutineStatusFilter);
|
|
40
|
+
/** User asked to create a new routine (empty-state CTA). The host opens the editor. */
|
|
41
|
+
CreateRequested: EventEmitter<void>;
|
|
42
|
+
/** User asked to edit a routine. The host opens the editor. */
|
|
43
|
+
EditRequested: EventEmitter<MJUserRoutineEntity>;
|
|
44
|
+
/** User asked to view a routine's run history. The host opens the history view. */
|
|
45
|
+
HistoryRequested: EventEmitter<MJUserRoutineEntity>;
|
|
46
|
+
/** Informational: a routine was selected (history/detail opened). */
|
|
47
|
+
RoutineSelected: EventEmitter<RoutineSelectedEventArgs>;
|
|
48
|
+
/** Loaded/filtered counts changed (load, filter, refresh). */
|
|
49
|
+
CountsChanged: EventEmitter<RoutineCounts>;
|
|
50
|
+
/** Cancelable: fires before a pause/resume Status toggle is saved. */
|
|
51
|
+
BeforeRoutinePaused: EventEmitter<BeforeRoutinePausedEventArgs>;
|
|
52
|
+
/** Informational: fires after a pause/resume Status toggle was saved. */
|
|
53
|
+
AfterRoutinePaused: EventEmitter<AfterRoutinePausedEventArgs>;
|
|
54
|
+
/** Cancelable: fires before a routine is queued to run now. */
|
|
55
|
+
BeforeRoutineRunNow: EventEmitter<BeforeRoutineRunNowEventArgs>;
|
|
56
|
+
/** Informational: fires after a routine was queued to run now. */
|
|
57
|
+
AfterRoutineRunNow: EventEmitter<AfterRoutineRunNowEventArgs>;
|
|
58
|
+
/** Cancelable: fires before a routine (and its recipients) is deleted. */
|
|
59
|
+
BeforeRoutineDeleted: EventEmitter<BeforeRoutineDeletedEventArgs>;
|
|
60
|
+
/** Informational: fires after a routine was deleted. */
|
|
61
|
+
AfterRoutineDeleted: EventEmitter<AfterRoutineDeletedEventArgs>;
|
|
62
|
+
Routines: MJUserRoutineEntity[];
|
|
63
|
+
FilteredRoutines: MJUserRoutineEntity[];
|
|
64
|
+
IsLoading: boolean;
|
|
65
|
+
/** IDs of routines with an in-flight save/delete (disables that card's action buttons). */
|
|
66
|
+
BusyRoutineIDs: Set<string>;
|
|
67
|
+
private agentNameByID;
|
|
68
|
+
private agentIconByID;
|
|
69
|
+
readonly DescribeCron: typeof DescribeCronExpression;
|
|
70
|
+
readonly RelativeTime: typeof FormatRelativeTime;
|
|
71
|
+
readonly StatusVariant: typeof RoutineStatusVariant;
|
|
72
|
+
readonly LastRunVariant: typeof RunStatusVariant;
|
|
73
|
+
ngOnInit(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Snapshot of the time-relative strings, keyed by routine ID. Templates must NOT
|
|
76
|
+
* call FormatRelativeTime directly — its value can change between check passes at
|
|
77
|
+
* a minute boundary (NG0100). Rebuilt on every data change and on a 30s timer.
|
|
78
|
+
*/
|
|
79
|
+
private relativeText;
|
|
80
|
+
private relativeTimer;
|
|
81
|
+
/** Stable-within-a-pass "Last run" text for a routine. */
|
|
82
|
+
LastRunText(routine: MJUserRoutineEntity): string;
|
|
83
|
+
/** Stable-within-a-pass "Next run" text for a routine. */
|
|
84
|
+
NextRunText(routine: MJUserRoutineEntity): string;
|
|
85
|
+
private rebuildRelativeText;
|
|
86
|
+
ngOnDestroy(): void;
|
|
87
|
+
/** Force-refreshes the engine cache (and this list). */
|
|
88
|
+
Refresh(): Promise<void>;
|
|
89
|
+
/** Display name of a routine's target agent (falls back when the agent no longer exists). */
|
|
90
|
+
AgentName(routine: MJUserRoutineEntity): string;
|
|
91
|
+
/** The agent's own IconClass, falling back to the standard robot mark. */
|
|
92
|
+
AgentIcon(routine: MJUserRoutineEntity): string;
|
|
93
|
+
/** Toggles Active ⇄ Paused (Disabled routines resume to Active as well). */
|
|
94
|
+
ToggleStatus(routine: MJUserRoutineEntity): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Run-now v1: stamps NextRunAt = now and saves; the dispatcher job claims due
|
|
97
|
+
* routines on its next sweep. Only meaningful for Active routines.
|
|
98
|
+
*/
|
|
99
|
+
RunNow(routine: MJUserRoutineEntity): Promise<void>;
|
|
100
|
+
/** Deletes a routine (after user confirmation), removing its recipients first. */
|
|
101
|
+
DeleteRoutine(routine: MJUserRoutineEntity): Promise<void>;
|
|
102
|
+
/** The routine's dedicated conversation was requested (chat icon on the card). */
|
|
103
|
+
ConversationOpened: EventEmitter<ConversationOpenedEventArgs>;
|
|
104
|
+
/** Raises ConversationOpened for hosts to present the routine's conversation. */
|
|
105
|
+
OpenConversation(routine: MJUserRoutineEntity): void;
|
|
106
|
+
/** Opens a routine's history (raises RoutineSelected + HistoryRequested). */
|
|
107
|
+
OpenHistory(routine: MJUserRoutineEntity): void;
|
|
108
|
+
/** True when the run-now button should be disabled for this routine. */
|
|
109
|
+
RunNowDisabled(routine: MJUserRoutineEntity): boolean;
|
|
110
|
+
/** Chip variant helper narrowed for the template. */
|
|
111
|
+
ChipClass(variant: RoutineChipVariant): string;
|
|
112
|
+
private engine;
|
|
113
|
+
/** Saves a routine, surfacing LatestResult.CompleteMessage and reverting on failure. */
|
|
114
|
+
private saveRoutine;
|
|
115
|
+
private applyFilters;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MyRoutinesListComponent, never>;
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MyRoutinesListComponent, "mj-my-routines-list", never, { "SearchText": { "alias": "SearchText"; "required": false; }; "StatusFilter": { "alias": "StatusFilter"; "required": false; }; }, { "CreateRequested": "CreateRequested"; "EditRequested": "EditRequested"; "HistoryRequested": "HistoryRequested"; "RoutineSelected": "RoutineSelected"; "CountsChanged": "CountsChanged"; "BeforeRoutinePaused": "BeforeRoutinePaused"; "AfterRoutinePaused": "AfterRoutinePaused"; "BeforeRoutineRunNow": "BeforeRoutineRunNow"; "AfterRoutineRunNow": "AfterRoutineRunNow"; "BeforeRoutineDeleted": "BeforeRoutineDeleted"; "AfterRoutineDeleted": "AfterRoutineDeleted"; "ConversationOpened": "ConversationOpened"; }, never, never, false, never>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=my-routines-list.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-routines-list.component.d.ts","sourceRoot":"","sources":["../../src/lib/my-routines-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAGrH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,+BAA+B,CAAC;AAIvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEtH,OAAO,EAAE,2BAA2B,EAChC,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,wBAAwB,EAC3B,MAAM,wBAAwB,CAAC;;AAEhC,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAExE,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB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