@bitblit/ngx-acute-warden 5.1.117 → 5.1.121
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/lib/components/acute-create-user/acute-create-user.component.js +41 -48
- package/lib/components/acute-create-user/acute-create-user.component.js.map +1 -1
- package/lib/components/acute-login/acute-login.component.d.ts +14 -5
- package/lib/components/acute-login/acute-login.component.js +148 -84
- package/lib/components/acute-login/acute-login.component.js.map +1 -1
- package/lib/components/acute-magic-lander/acute-magic-lander.component.js +7 -8
- package/lib/components/acute-magic-lander/acute-magic-lander.component.js.map +1 -1
- package/lib/components/acute-user-profile/acute-user-profile.component.d.ts +2 -0
- package/lib/components/acute-user-profile/acute-user-profile.component.js +74 -45
- package/lib/components/acute-user-profile/acute-user-profile.component.js.map +1 -1
- package/lib/constants.d.ts +4 -0
- package/lib/constants.js +5 -0
- package/lib/constants.js.map +1 -0
- package/lib/guards/logged-in-guard.d.ts +6 -4
- package/lib/guards/logged-in-guard.js +23 -8
- package/lib/guards/logged-in-guard.js.map +1 -1
- package/lib/guards/not-logged-in-guard.d.ts +6 -4
- package/lib/guards/not-logged-in-guard.js +24 -10
- package/lib/guards/not-logged-in-guard.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/services/warden-adapter.service.js +1 -1
- package/lib/services/warden-adapter.service.js.map +1 -1
- package/package.json +35 -35
|
@@ -17,50 +17,53 @@ import * as i2 from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
|
17
17
|
import * as i3 from "@bitblit/ratchet-warden-common/client/warden-delegating-current-user-providing-user-service-event-processing-provider";
|
|
18
18
|
import * as i4 from "primeng/button";
|
|
19
19
|
import * as i5 from "primeng/card";
|
|
20
|
-
import * as i6 from "
|
|
21
|
-
import * as i7 from "
|
|
22
|
-
function
|
|
20
|
+
import * as i6 from "primeng/tooltip";
|
|
21
|
+
import * as i7 from "@angular/common";
|
|
22
|
+
function AcuteUserProfileComponent_For_10_Template(rf, ctx) { if (rf & 1) {
|
|
23
23
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
24
|
-
i0.ɵɵelementStart(0, "li")(1, "p-button",
|
|
25
|
-
i0.ɵɵlistener("click", function
|
|
24
|
+
i0.ɵɵelementStart(0, "li")(1, "p-button", 6);
|
|
25
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_For_10_Template_p_button_click_1_listener() { const cm_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.removeContact(cm_r2)); });
|
|
26
26
|
i0.ɵɵelementEnd();
|
|
27
27
|
i0.ɵɵtext(2);
|
|
28
28
|
i0.ɵɵelementEnd();
|
|
29
29
|
} if (rf & 2) {
|
|
30
30
|
const cm_r2 = ctx.$implicit;
|
|
31
31
|
i0.ɵɵadvance();
|
|
32
|
-
i0.ɵɵ
|
|
32
|
+
i0.ɵɵproperty("pTooltip", i0.ɵɵinterpolate1("Remove contact method ", cm_r2.value));
|
|
33
33
|
i0.ɵɵadvance();
|
|
34
34
|
i0.ɵɵtextInterpolate2(" ", cm_r2.type, " : ", cm_r2.value, " ");
|
|
35
35
|
} }
|
|
36
|
-
function
|
|
36
|
+
function AcuteUserProfileComponent_Conditional_11_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
37
37
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
38
|
-
i0.ɵɵelementStart(0, "li")(1, "p-button",
|
|
39
|
-
i0.ɵɵlistener("click", function
|
|
38
|
+
i0.ɵɵelementStart(0, "li")(1, "p-button", 6);
|
|
39
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Conditional_11_For_4_Template_p_button_click_1_listener() { const waa_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.removeWebAuthn(waa_r5)); });
|
|
40
40
|
i0.ɵɵelementEnd();
|
|
41
|
-
i0.ɵɵ
|
|
41
|
+
i0.ɵɵelementStart(2, "p-button", 7);
|
|
42
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Conditional_11_For_4_Template_p_button_click_2_listener() { const waa_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.exportWebAuthn(waa_r5.origin)); });
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
i0.ɵɵtext(3);
|
|
42
45
|
i0.ɵɵelementEnd();
|
|
43
46
|
} if (rf & 2) {
|
|
44
47
|
const waa_r5 = ctx.$implicit;
|
|
45
48
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
46
49
|
i0.ɵɵadvance();
|
|
47
|
-
i0.ɵɵ
|
|
50
|
+
i0.ɵɵproperty("pTooltip", i0.ɵɵinterpolate1("Remove web auth ", ctx_r2.webAuthLabel(waa_r5)));
|
|
51
|
+
i0.ɵɵadvance();
|
|
52
|
+
i0.ɵɵproperty("pTooltip", i0.ɵɵinterpolate1("Export web auth ", ctx_r2.webAuthLabel(waa_r5)));
|
|
48
53
|
i0.ɵɵadvance();
|
|
49
54
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.webAuthLabel(waa_r5), " ");
|
|
50
55
|
} }
|
|
51
|
-
function
|
|
52
|
-
i0.ɵɵ
|
|
53
|
-
i0.ɵɵ
|
|
54
|
-
i0.ɵɵtext(2, "Web Authenticators");
|
|
56
|
+
function AcuteUserProfileComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
i0.ɵɵelementStart(0, "h3");
|
|
58
|
+
i0.ɵɵtext(1, "Web Authenticators");
|
|
55
59
|
i0.ɵɵelementEnd();
|
|
56
|
-
i0.ɵɵelementStart(
|
|
57
|
-
i0.ɵɵ
|
|
60
|
+
i0.ɵɵelementStart(2, "ul");
|
|
61
|
+
i0.ɵɵrepeaterCreate(3, AcuteUserProfileComponent_Conditional_11_For_4_Template, 4, 5, "li", null, i0.ɵɵrepeaterTrackByIdentity);
|
|
58
62
|
i0.ɵɵelementEnd();
|
|
59
|
-
i0.ɵɵelementContainerEnd();
|
|
60
63
|
} if (rf & 2) {
|
|
61
64
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
62
|
-
i0.ɵɵadvance(
|
|
63
|
-
i0.ɵɵ
|
|
65
|
+
i0.ɵɵadvance(3);
|
|
66
|
+
i0.ɵɵrepeater(ctx_r2.user.userObject.wardenData.webAuthnAuthenticatorSummaries);
|
|
64
67
|
} }
|
|
65
68
|
export class AcuteUserProfileComponent {
|
|
66
69
|
router;
|
|
@@ -122,6 +125,23 @@ export class AcuteUserProfileComponent {
|
|
|
122
125
|
await this.userService.removeWebAuthnRegistrationFromLoggedInUser(webId.credentialIdBase64);
|
|
123
126
|
await this.userService.refreshToken();
|
|
124
127
|
}
|
|
128
|
+
async exportWebAuthn(origin) {
|
|
129
|
+
Logger.info('exportWebAuthn: %s', origin);
|
|
130
|
+
const newValue = await this.userService.exportWebAuthnRegistrationEntryForLoggedInUser(origin);
|
|
131
|
+
alert(newValue);
|
|
132
|
+
Logger.info('Export token is %s', newValue);
|
|
133
|
+
return newValue;
|
|
134
|
+
}
|
|
135
|
+
async importWebAuthn() {
|
|
136
|
+
let rval = false;
|
|
137
|
+
const value = prompt('Input the web authn token to import');
|
|
138
|
+
if (StringRatchet.trimToNull(value)) {
|
|
139
|
+
Logger.info('importWebAuthn: %s', origin);
|
|
140
|
+
rval = await this.userService.importWebAuthnRegistrationEntryForLoggedInUser(value);
|
|
141
|
+
}
|
|
142
|
+
Logger.info('Import returned is %s', rval);
|
|
143
|
+
return rval;
|
|
144
|
+
}
|
|
125
145
|
webAuthLabel(webId) {
|
|
126
146
|
let rval = 'Error - missing';
|
|
127
147
|
if (webId) {
|
|
@@ -137,7 +157,7 @@ export class AcuteUserProfileComponent {
|
|
|
137
157
|
this.router.navigate(['/public/login']).then(No.op);
|
|
138
158
|
}
|
|
139
159
|
static ɵfac = function AcuteUserProfileComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AcuteUserProfileComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i2.WardenUserService), i0.ɵɵdirectiveInject(i3.WardenDelegatingCurrentUserProvidingUserServiceEventProcessingProvider)); };
|
|
140
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: AcuteUserProfileComponent, selectors: [["ngx-acute-warden-user-profile"]], decls:
|
|
160
|
+
static ɵcmp = i0.ɵɵdefineComponent({ type: AcuteUserProfileComponent, selectors: [["ngx-acute-warden-user-profile"]], decls: 28, vars: 12, consts: [[3, "header"], [2, "display", "flex", "flex-direction", "row"], ["icon", "pi pi-user", "pTooltip", "Add a new contact method", "icon", "pi pi-user-plus", 3, "click"], ["icon", "pi pi-lock", "pTooltip", "Add this device as an authenticator", 3, "click"], ["icon", "pi pi-file-import", "pTooltip", "Import web authn", 3, "click"], [3, "click"], ["icon", "pi pi-trash", 3, "click", "pTooltip"], ["icon", "pi pi-file-export", 3, "click", "pTooltip"]], template: function AcuteUserProfileComponent_Template(rf, ctx) { if (rf & 1) {
|
|
141
161
|
i0.ɵɵelementStart(0, "p-card", 0)(1, "div");
|
|
142
162
|
i0.ɵɵtext(2);
|
|
143
163
|
i0.ɵɵelement(3, "br");
|
|
@@ -147,42 +167,51 @@ export class AcuteUserProfileComponent {
|
|
|
147
167
|
i0.ɵɵtext(7, "Contacts");
|
|
148
168
|
i0.ɵɵelementEnd();
|
|
149
169
|
i0.ɵɵelementStart(8, "ul");
|
|
150
|
-
i0.ɵɵ
|
|
170
|
+
i0.ɵɵrepeaterCreate(9, AcuteUserProfileComponent_For_10_Template, 3, 4, "li", null, i0.ɵɵrepeaterTrackByIdentity);
|
|
171
|
+
i0.ɵɵelementEnd();
|
|
172
|
+
i0.ɵɵconditionalCreate(11, AcuteUserProfileComponent_Conditional_11_Template, 5, 0);
|
|
173
|
+
i0.ɵɵelementStart(12, "div", 1)(13, "p-button", 2);
|
|
174
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Template_p_button_click_13_listener() { return ctx.addContact(); });
|
|
151
175
|
i0.ɵɵelementEnd();
|
|
152
|
-
i0.ɵɵ
|
|
153
|
-
i0.ɵɵ
|
|
154
|
-
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Template_p_button_click_12_listener() { return ctx.addContact(); });
|
|
176
|
+
i0.ɵɵelementStart(14, "p-button", 3);
|
|
177
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Template_p_button_click_14_listener() { return ctx.addWebAuthnDevice(); });
|
|
155
178
|
i0.ɵɵelementEnd();
|
|
156
|
-
i0.ɵɵelementStart(
|
|
157
|
-
i0.ɵɵlistener("click", function
|
|
179
|
+
i0.ɵɵelementStart(15, "p-button", 4);
|
|
180
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Template_p_button_click_15_listener() { return ctx.importWebAuthn(); });
|
|
158
181
|
i0.ɵɵelementEnd()();
|
|
159
|
-
i0.ɵɵelement(
|
|
160
|
-
i0.ɵɵtext(
|
|
161
|
-
i0.ɵɵ
|
|
162
|
-
i0.ɵɵ
|
|
163
|
-
i0.ɵɵ
|
|
164
|
-
i0.ɵɵ
|
|
165
|
-
i0.ɵɵ
|
|
182
|
+
i0.ɵɵelement(16, "br");
|
|
183
|
+
i0.ɵɵtext(17);
|
|
184
|
+
i0.ɵɵpipe(18, "json");
|
|
185
|
+
i0.ɵɵelement(19, "br")(20, "br");
|
|
186
|
+
i0.ɵɵtext(21);
|
|
187
|
+
i0.ɵɵpipe(22, "json");
|
|
188
|
+
i0.ɵɵelement(23, "br")(24, "hr");
|
|
189
|
+
i0.ɵɵtext(25);
|
|
190
|
+
i0.ɵɵelementStart(26, "button", 5);
|
|
191
|
+
i0.ɵɵlistener("click", function AcuteUserProfileComponent_Template_button_click_26_listener() { return ctx.refreshToken(); });
|
|
192
|
+
i0.ɵɵtext(27, "Refresh");
|
|
166
193
|
i0.ɵɵelementEnd()()();
|
|
167
194
|
} if (rf & 2) {
|
|
168
|
-
i0.ɵɵ
|
|
195
|
+
i0.ɵɵproperty("header", i0.ɵɵinterpolate1("User profile : ", ctx.user.userObject.wardenData.userLabel));
|
|
169
196
|
i0.ɵɵadvance(2);
|
|
170
|
-
i0.ɵɵtextInterpolate1(" ID: ", ctx.user.userObject.
|
|
197
|
+
i0.ɵɵtextInterpolate1(" ID: ", ctx.user.userObject.wardenData.userId, " ");
|
|
171
198
|
i0.ɵɵadvance(2);
|
|
172
|
-
i0.ɵɵtextInterpolate1(" Full Name: ", ctx.user.userObject.
|
|
199
|
+
i0.ɵɵtextInterpolate1(" Full Name: ", ctx.user.userObject.wardenData.userLabel, " ");
|
|
173
200
|
i0.ɵɵadvance(5);
|
|
174
|
-
i0.ɵɵ
|
|
175
|
-
i0.ɵɵadvance();
|
|
176
|
-
i0.ɵɵ
|
|
177
|
-
i0.ɵɵadvance(
|
|
178
|
-
i0.ɵɵtextInterpolate1(" Roles: ", ctx.user.userObject.
|
|
179
|
-
i0.ɵɵadvance(
|
|
201
|
+
i0.ɵɵrepeater(ctx.user.userObject.wardenData.contactMethods);
|
|
202
|
+
i0.ɵɵadvance(2);
|
|
203
|
+
i0.ɵɵconditional((ctx.user == null ? null : ctx.user.userObject == null ? null : ctx.user.userObject.wardenData == null ? null : ctx.user.userObject.wardenData.webAuthnAuthenticatorSummaries == null ? null : ctx.user.userObject.wardenData.webAuthnAuthenticatorSummaries.length) ? 11 : -1);
|
|
204
|
+
i0.ɵɵadvance(6);
|
|
205
|
+
i0.ɵɵtextInterpolate1(" Global Roles: ", i0.ɵɵpipeBind1(18, 8, ctx.user.userObject.globalRoleIds), " ");
|
|
206
|
+
i0.ɵɵadvance(4);
|
|
207
|
+
i0.ɵɵtextInterpolate1(" Roles: ", i0.ɵɵpipeBind1(22, 10, ctx.user.userObject.teamRoleMappings), " ");
|
|
208
|
+
i0.ɵɵadvance(4);
|
|
180
209
|
i0.ɵɵtextInterpolate1(" Time (MS) left in token : ", ctx.timeLeftMS, " ");
|
|
181
|
-
} }, dependencies: [ButtonModule, i4.Button, CardModule, i5.Card, CommonModule,
|
|
210
|
+
} }, dependencies: [ButtonModule, i4.Button, CardModule, i5.Card, CommonModule, TooltipModule, i6.Tooltip, i7.JsonPipe], encapsulation: 2 });
|
|
182
211
|
}
|
|
183
212
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AcuteUserProfileComponent, [{
|
|
184
213
|
type: Component,
|
|
185
|
-
args: [{ selector: 'ngx-acute-warden-user-profile', standalone: true, imports: [ButtonModule, CardModule, CommonModule, TooltipModule], template: "<p-card header=\"User profile : {{ user.userObject.
|
|
214
|
+
args: [{ selector: 'ngx-acute-warden-user-profile', standalone: true, imports: [ButtonModule, CardModule, CommonModule, TooltipModule], template: "<p-card header=\"User profile : {{ user.userObject.wardenData.userLabel }}\">\n <div>\n ID: {{ user.userObject.wardenData.userId }} <br />\n Full Name: {{ user.userObject.wardenData.userLabel }} <br />\n <h3>Contacts</h3>\n <ul>\n @for(cm of user.userObject.wardenData.contactMethods; track cm) {\n <li>\n <p-button icon=\"pi pi-trash\" pTooltip=\"Remove contact method {{ cm.value }}\" (click)=\"removeContact(cm)\"></p-button>\n {{ cm.type }} : {{ cm.value }}\n </li>\n }\n </ul>\n @if (user?.userObject?.wardenData?.webAuthnAuthenticatorSummaries?.length) {\n <h3>Web Authenticators</h3>\n <ul>\n @for(waa of user.userObject.wardenData.webAuthnAuthenticatorSummaries; track waa) {\n <li>\n <p-button icon=\"pi pi-trash\" pTooltip=\"Remove web auth {{ webAuthLabel(waa) }}\" (click)=\"removeWebAuthn(waa)\"></p-button>\n <p-button icon=\"pi pi-file-export\" pTooltip=\"Export web auth {{ webAuthLabel(waa) }}\" (click)=\"exportWebAuthn(waa.origin)\"></p-button>\n {{ webAuthLabel(waa) }}\n </li>\n }\n </ul>\n }\n\n <div style=\"display: flex; flex-direction: row\">\n <p-button icon=\"pi pi-user\" pTooltip=\"Add a new contact method\" (click)=\"addContact()\" icon=\"pi pi-user-plus\"></p-button>\n <p-button icon=\"pi pi-lock\" pTooltip=\"Add this device as an authenticator\" (click)=\"addWebAuthnDevice()\"></p-button>\n <p-button icon=\"pi pi-file-import\" pTooltip=\"Import web authn\" (click)=\"importWebAuthn()\"></p-button>\n </div>\n\n <br />\n Global Roles: {{ user.userObject.globalRoleIds | json}} <br />\n <br />\n Roles: {{ user.userObject.teamRoleMappings | json}} <br />\n <hr />\n Time (MS) left in token : {{ timeLeftMS }} <button (click)=\"refreshToken()\">Refresh</button>\n </div>\n</p-card>\n" }]
|
|
186
215
|
}], () => [{ type: i1.Router }, { type: i2.WardenUserService }, { type: i3.WardenDelegatingCurrentUserProvidingUserServiceEventProcessingProvider }], null); })();
|
|
187
216
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AcuteUserProfileComponent, { className: "AcuteUserProfileComponent", filePath: "components/acute-user-profile/acute-user-profile.component.ts", lineNumber: 24 }); })();
|
|
188
217
|
//# sourceMappingURL=acute-user-profile.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acute-user-profile.component.js","sourceRoot":"","sources":["../../../src/components/acute-user-profile/acute-user-profile.component.ts","../../../src/components/acute-user-profile/acute-user-profile.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AACtF,OAAO,EAAE,sEAAsE,EAAE,MAAM,uHAAuH,CAAC;AAC/M,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAGhF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"acute-user-profile.component.js","sourceRoot":"","sources":["../../../src/components/acute-user-profile/acute-user-profile.component.ts","../../../src/components/acute-user-profile/acute-user-profile.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AACtF,OAAO,EAAE,sEAAsE,EAAE,MAAM,uHAAuH,CAAC;AAC/M,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAGhF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;;;;;;;;;;;ICPtC,AADF,0BAAI,kBACuG;IAA5B,gNAAS,2BAAiB,KAAC;IAAC,iBAAW;IACpH,YACF;IAAA,iBAAK;;;IAF0B,cAA+C;IAA/C,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AoD;;YACpD,AADoD,sBAAM,UACpD;YACN,aAA2C;YAAA,kCAAiC;YAAzB,uGAAS,kBAAc,IAAC;YAAC,wBAAO;YAEvF,AADE,AADqF,iBAAS,EACxF,EACC;;YAvCD,wBAAA,8EAAkE,CAAA;YAEtE,eAA4C;YAA5C,0EAA4C;YAC5C,eAAsD;YAAtD,oFAAsD;YAGpD,eAKC;YALD,4DAKC;YAEH,eAWC;YAXD,gSAWC;YASD,eAAwD;YAAxD,uGAAwD;YAExD,eAAoD;YAApD,oGAAoD;YAEpD,eAA2C;YAA3C,yEAA2C;4BDhBnC,YAAY,aAAE,UAAU,WAAE,YAAY,EAAE,aAAa;;iFAEpD,yBAAyB;cANrC,SAAS;2BACE,+BAA+B,cAE7B,IAAI,WACP,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC;;kFAErD,yBAAyB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InjectionToken } from "@angular/core";
|
|
2
|
+
export declare const ACUTE_WARDEN_LOGIN_PATH: InjectionToken<string>;
|
|
3
|
+
export declare const ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH: InjectionToken<string>;
|
|
4
|
+
export declare const ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH: InjectionToken<string>;
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InjectionToken } from "@angular/core";
|
|
2
|
+
export const ACUTE_WARDEN_LOGIN_PATH = new InjectionToken('ACUTE_WARDEN_LOGIN_PATH');
|
|
3
|
+
export const ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH = new InjectionToken('ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH');
|
|
4
|
+
export const ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH = new InjectionToken('ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH');
|
|
5
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,uBAAuB,GAA2B,IAAI,cAAc,CAAS,yBAAyB,CAAC,CAAC;AACrH,MAAM,CAAC,MAAM,oCAAoC,GAA2B,IAAI,cAAc,CAAS,sCAAsC,CAAC,CAAC;AAC/I,MAAM,CAAC,MAAM,sCAAsC,GAA2B,IAAI,cAAc,CAAS,wCAAwC,CAAC,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from
|
|
2
|
-
import { Observable } from
|
|
3
|
-
import { WardenUserService } from
|
|
1
|
+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from "@angular/router";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { WardenUserService } from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class LoggedInGuard implements CanActivate {
|
|
6
6
|
private userService;
|
|
7
7
|
private router;
|
|
8
|
-
|
|
8
|
+
private loginPath;
|
|
9
|
+
private defaultPostLoginPath;
|
|
10
|
+
constructor(userService: WardenUserService<any>, router: Router, loginPath: string, defaultPostLoginPath: string);
|
|
9
11
|
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<LoggedInGuard, never>;
|
|
11
13
|
static ɵprov: i0.ɵɵInjectableDeclaration<LoggedInGuard>;
|
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
import { Injectable } from
|
|
2
|
-
import { Router } from
|
|
3
|
-
import { WardenUserService } from
|
|
4
|
-
import { No } from
|
|
1
|
+
import { Inject, Injectable } from "@angular/core";
|
|
2
|
+
import { Router } from "@angular/router";
|
|
3
|
+
import { WardenUserService } from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
4
|
+
import { No } from "@bitblit/ratchet-common/lang/no";
|
|
5
|
+
import { ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH, ACUTE_WARDEN_LOGIN_PATH } from "../constants.js";
|
|
6
|
+
import { RequireRatchet } from "@bitblit/ratchet-common/lang/require-ratchet";
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
import * as i1 from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
7
9
|
import * as i2 from "@angular/router";
|
|
8
10
|
export class LoggedInGuard {
|
|
9
11
|
userService;
|
|
10
12
|
router;
|
|
11
|
-
|
|
13
|
+
loginPath;
|
|
14
|
+
defaultPostLoginPath;
|
|
15
|
+
constructor(userService, router, loginPath, defaultPostLoginPath) {
|
|
12
16
|
this.userService = userService;
|
|
13
17
|
this.router = router;
|
|
18
|
+
this.loginPath = loginPath;
|
|
19
|
+
this.defaultPostLoginPath = defaultPostLoginPath;
|
|
20
|
+
RequireRatchet.notNullUndefinedOrOnlyWhitespaceString(this.loginPath, 'ACUTE_WARDEN_LOGIN_PATH');
|
|
21
|
+
RequireRatchet.notNullUndefinedOrOnlyWhitespaceString(this.defaultPostLoginPath, 'ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH');
|
|
14
22
|
}
|
|
15
23
|
canActivate(route, state) {
|
|
16
24
|
if (!this.userService.isLoggedIn()) {
|
|
17
|
-
this.
|
|
25
|
+
const target = state.url === this.loginPath ? this.defaultPostLoginPath : state.url;
|
|
26
|
+
this.router.navigate([this.loginPath], { queryParams: { returnUrl: target } }).then(No.op);
|
|
18
27
|
return false;
|
|
19
28
|
}
|
|
20
29
|
return true;
|
|
21
30
|
}
|
|
22
|
-
static ɵfac = function LoggedInGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LoggedInGuard)(i0.ɵɵinject(i1.WardenUserService), i0.ɵɵinject(i2.Router)); };
|
|
31
|
+
static ɵfac = function LoggedInGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LoggedInGuard)(i0.ɵɵinject(i1.WardenUserService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(ACUTE_WARDEN_LOGIN_PATH), i0.ɵɵinject(ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH)); };
|
|
23
32
|
static ɵprov = i0.ɵɵdefineInjectable({ token: LoggedInGuard, factory: LoggedInGuard.ɵfac });
|
|
24
33
|
}
|
|
25
34
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggedInGuard, [{
|
|
26
35
|
type: Injectable
|
|
27
|
-
}], () => [{ type: i1.WardenUserService }, { type: i2.Router }
|
|
36
|
+
}], () => [{ type: i1.WardenUserService }, { type: i2.Router }, { type: undefined, decorators: [{
|
|
37
|
+
type: Inject,
|
|
38
|
+
args: [ACUTE_WARDEN_LOGIN_PATH]
|
|
39
|
+
}] }, { type: undefined, decorators: [{
|
|
40
|
+
type: Inject,
|
|
41
|
+
args: [ACUTE_WARDEN_DEFAULT_POST_LOGIN_PATH]
|
|
42
|
+
}] }], null); })();
|
|
28
43
|
//# sourceMappingURL=logged-in-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logged-in-guard.js","sourceRoot":"","sources":["../../src/guards/logged-in-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"logged-in-guard.js","sourceRoot":"","sources":["../../src/guards/logged-in-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAuC,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,E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RouteSnapshot, CanActivate, Router, RouterStateSnapshot } from
|
|
2
|
-
import { Observable } from
|
|
3
|
-
import { WardenUserService } from
|
|
1
|
+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from "@angular/router";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { WardenUserService } from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class NotLoggedInGuard implements CanActivate {
|
|
6
6
|
private userService;
|
|
7
7
|
private router;
|
|
8
|
-
|
|
8
|
+
private defaultIfLoggedInPath;
|
|
9
|
+
private loginPath;
|
|
10
|
+
constructor(userService: WardenUserService<any>, router: Router, defaultIfLoggedInPath: string, loginPath: string);
|
|
9
11
|
canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean;
|
|
10
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<NotLoggedInGuard, never>;
|
|
11
13
|
static ɵprov: i0.ɵɵInjectableDeclaration<NotLoggedInGuard>;
|
|
@@ -1,37 +1,51 @@
|
|
|
1
|
-
import { Injectable } from
|
|
2
|
-
import { Router } from
|
|
3
|
-
import { Logger } from
|
|
4
|
-
import { WardenUserService } from
|
|
5
|
-
import { No } from
|
|
1
|
+
import { Inject, Injectable } from "@angular/core";
|
|
2
|
+
import { Router } from "@angular/router";
|
|
3
|
+
import { Logger } from "@bitblit/ratchet-common/logger/logger";
|
|
4
|
+
import { WardenUserService } from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
5
|
+
import { No } from "@bitblit/ratchet-common/lang/no";
|
|
6
|
+
import { ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH, ACUTE_WARDEN_LOGIN_PATH } from "../constants.js";
|
|
7
|
+
import { RequireRatchet } from "@bitblit/ratchet-common/lang/require-ratchet";
|
|
6
8
|
import * as i0 from "@angular/core";
|
|
7
9
|
import * as i1 from "@bitblit/ratchet-warden-common/client/warden-user-service";
|
|
8
10
|
import * as i2 from "@angular/router";
|
|
9
11
|
export class NotLoggedInGuard {
|
|
10
12
|
userService;
|
|
11
13
|
router;
|
|
12
|
-
|
|
14
|
+
defaultIfLoggedInPath;
|
|
15
|
+
loginPath;
|
|
16
|
+
constructor(userService, router, defaultIfLoggedInPath, loginPath) {
|
|
13
17
|
this.userService = userService;
|
|
14
18
|
this.router = router;
|
|
19
|
+
this.defaultIfLoggedInPath = defaultIfLoggedInPath;
|
|
20
|
+
this.loginPath = loginPath;
|
|
21
|
+
RequireRatchet.notNullUndefinedOrOnlyWhitespaceString(this.defaultIfLoggedInPath, 'ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH');
|
|
22
|
+
RequireRatchet.notNullUndefinedOrOnlyWhitespaceString(this.loginPath, 'ACUTE_WARDEN_LOGIN_PATH');
|
|
15
23
|
}
|
|
16
24
|
canActivate(route, _state) {
|
|
17
25
|
Logger.info('--- %j', route.queryParamMap);
|
|
18
26
|
if (route.queryParamMap.get('logout') === 'true') {
|
|
19
27
|
Logger.info('Logging out...');
|
|
20
28
|
this.userService.logout();
|
|
21
|
-
this.router.navigate([
|
|
29
|
+
this.router.navigate([this.loginPath]).then(No.op);
|
|
22
30
|
}
|
|
23
31
|
if (this.userService.isLoggedIn()) {
|
|
24
|
-
const target =
|
|
32
|
+
const target = this.defaultIfLoggedInPath;
|
|
25
33
|
Logger.info('NotLoggedInGuard fail(logged in) : Redirecting to logged in %s', target);
|
|
26
34
|
this.router.navigate([target]).then(No.op);
|
|
27
35
|
return false;
|
|
28
36
|
}
|
|
29
37
|
return true;
|
|
30
38
|
}
|
|
31
|
-
static ɵfac = function NotLoggedInGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NotLoggedInGuard)(i0.ɵɵinject(i1.WardenUserService), i0.ɵɵinject(i2.Router)); };
|
|
39
|
+
static ɵfac = function NotLoggedInGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NotLoggedInGuard)(i0.ɵɵinject(i1.WardenUserService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH), i0.ɵɵinject(ACUTE_WARDEN_LOGIN_PATH)); };
|
|
32
40
|
static ɵprov = i0.ɵɵdefineInjectable({ token: NotLoggedInGuard, factory: NotLoggedInGuard.ɵfac });
|
|
33
41
|
}
|
|
34
42
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NotLoggedInGuard, [{
|
|
35
43
|
type: Injectable
|
|
36
|
-
}], () => [{ type: i1.WardenUserService }, { type: i2.Router }
|
|
44
|
+
}], () => [{ type: i1.WardenUserService }, { type: i2.Router }, { type: undefined, decorators: [{
|
|
45
|
+
type: Inject,
|
|
46
|
+
args: [ACUTE_WARDEN_DEFAULT_IF_LOGGED_IN_PATH]
|
|
47
|
+
}] }, { type: undefined, decorators: [{
|
|
48
|
+
type: Inject,
|
|
49
|
+
args: [ACUTE_WARDEN_LOGIN_PATH]
|
|
50
|
+
}] }], null); })();
|
|
37
51
|
//# sourceMappingURL=not-logged-in-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-logged-in-guard.js","sourceRoot":"","sources":["../../src/guards/not-logged-in-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"not-logged-in-guard.js","sourceRoot":"","sources":["../../src/guards/not-logged-in-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAuC,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAGnG,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,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,CAAC,EAAE,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;0GA5BU,gBAAgB,yEAIjB,sCAAsC,eACtC,uBAAuB;kDALtB,gBAAgB,WAAhB,gBAAgB;;iFAAhB,gBAAgB;cAD5B,UAAU;;sBAKN,MAAM;uBAAC,sCAAsC;;sBAC7C,MAAM;uBAAC,uBAAuB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './build/ngx-acute-warden-info';
|
|
2
|
+
export * from './constants';
|
|
2
3
|
export * from './components/acute-create-user/acute-create-user.component';
|
|
3
4
|
export * from './components/acute-login/acute-login.component';
|
|
4
5
|
export * from './components/acute-magic-lander/acute-magic-lander.component';
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './build/ngx-acute-warden-info';
|
|
2
|
+
export * from './constants';
|
|
2
3
|
export * from './components/acute-create-user/acute-create-user.component';
|
|
3
4
|
export * from './components/acute-login/acute-login.component';
|
|
4
5
|
export * from './components/acute-magic-lander/acute-magic-lander.component';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,aAAa,CAAC;AAE5B,cAAc,4DAA4D,CAAC;AAC3E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAE7E,cAAc,mCAAmC,CAAC"}
|
|
@@ -27,7 +27,7 @@ export class WardenAdapterService {
|
|
|
27
27
|
this.router.navigate(['/public/login']).then(No.op);
|
|
28
28
|
}
|
|
29
29
|
onSuccessfulLogin(newUser) {
|
|
30
|
-
Logger.info('Logged in as %s', newUser?.userObject?.
|
|
30
|
+
Logger.info('Logged in as %s', newUser?.userObject?.wardenData?.userLabel);
|
|
31
31
|
}
|
|
32
32
|
async sendMagicLink(contact, magicLanderUrl, postLoginUrl) {
|
|
33
33
|
RequireRatchet.notNullUndefinedOrOnlyWhitespaceString(magicLanderUrl, 'magicLanderUrl may not be empty');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warden-adapter.service.js","sourceRoot":"","sources":["../../src/services/warden-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;;;;AAGnF,MAAM,OAAO,oBAAoB;IAEtB;IACA;IAFT,YACS,MAAc,EACd,YAA0B;QAD1B,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ,YAAY,CAAc;IAChC,CAAC;IAEG,iBAAiB;QAEtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAEM,uBAAuB,CAAC,YAA4C;QACzE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;IAEM,cAAc,CAAC,MAAc;QAClC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAEM,QAAQ;QAEb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,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
|
+
"version": "5.1.121",
|
|
4
4
|
"description": "Library for using angular with ratchet-warden",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -35,45 +35,45 @@
|
|
|
35
35
|
"config": {},
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@angular/animations": "
|
|
39
|
-
"@angular/cdk": "
|
|
40
|
-
"@angular/common": "
|
|
41
|
-
"@angular/compiler": "
|
|
42
|
-
"@angular/core": "
|
|
43
|
-
"@angular/forms": "
|
|
44
|
-
"@angular/platform-browser": "
|
|
45
|
-
"@angular/platform-browser-dynamic": "
|
|
46
|
-
"@angular/router": "
|
|
47
|
-
"@bitblit/ngx-acute-common": "5.1.
|
|
48
|
-
"@bitblit/ratchet-common": "5.1.
|
|
49
|
-
"@bitblit/ratchet-warden-common": "5.1.
|
|
50
|
-
"primeflex": "
|
|
38
|
+
"@angular/animations": "20.3.7",
|
|
39
|
+
"@angular/cdk": "20.2.10",
|
|
40
|
+
"@angular/common": "20.3.7",
|
|
41
|
+
"@angular/compiler": "20.3.7",
|
|
42
|
+
"@angular/core": "20.3.7",
|
|
43
|
+
"@angular/forms": "20.3.7",
|
|
44
|
+
"@angular/platform-browser": "20.3.7",
|
|
45
|
+
"@angular/platform-browser-dynamic": "20.3.7",
|
|
46
|
+
"@angular/router": "20.3.7",
|
|
47
|
+
"@bitblit/ngx-acute-common": "5.1.121",
|
|
48
|
+
"@bitblit/ratchet-common": "5.1.121",
|
|
49
|
+
"@bitblit/ratchet-warden-common": "5.1.121",
|
|
50
|
+
"primeflex": "4.0.0",
|
|
51
51
|
"primeicons": "7.0.0",
|
|
52
|
-
"primeng": "
|
|
53
|
-
"rxjs": "7.8.
|
|
54
|
-
"zone.js": "0.15.
|
|
52
|
+
"primeng": "20.2.0",
|
|
53
|
+
"rxjs": "7.8.2",
|
|
54
|
+
"zone.js": "0.15.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@angular/animations": "^
|
|
58
|
-
"@angular/cdk": "^
|
|
59
|
-
"@angular/common": "^
|
|
60
|
-
"@angular/compiler": "^
|
|
61
|
-
"@angular/core": "^
|
|
62
|
-
"@angular/forms": "^
|
|
63
|
-
"@angular/platform-browser": "^
|
|
64
|
-
"@angular/platform-browser-dynamic": "^
|
|
65
|
-
"@angular/router": "^
|
|
66
|
-
"@bitblit/ngx-acute-common": "5.1.
|
|
67
|
-
"@bitblit/ratchet-common": "5.1.
|
|
68
|
-
"@bitblit/ratchet-warden-common": "5.1.
|
|
69
|
-
"primeflex": "
|
|
57
|
+
"@angular/animations": "^20.3.7",
|
|
58
|
+
"@angular/cdk": "^20.2.10",
|
|
59
|
+
"@angular/common": "^20.3.7",
|
|
60
|
+
"@angular/compiler": "^20.3.7",
|
|
61
|
+
"@angular/core": "^20.3.7",
|
|
62
|
+
"@angular/forms": "^20.3.7",
|
|
63
|
+
"@angular/platform-browser": "^20.3.7",
|
|
64
|
+
"@angular/platform-browser-dynamic": "^20.3.7",
|
|
65
|
+
"@angular/router": "^20.3.7",
|
|
66
|
+
"@bitblit/ngx-acute-common": "5.1.121",
|
|
67
|
+
"@bitblit/ratchet-common": "5.1.121",
|
|
68
|
+
"@bitblit/ratchet-warden-common": "5.1.121",
|
|
69
|
+
"primeflex": "4.0.0",
|
|
70
70
|
"primeicons": "7.0.0",
|
|
71
|
-
"primeng": "
|
|
72
|
-
"rxjs": "7.8.
|
|
73
|
-
"zone.js": "0.15.
|
|
71
|
+
"primeng": "20.2.0",
|
|
72
|
+
"rxjs": "7.8.2",
|
|
73
|
+
"zone.js": "0.15.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@angular/compiler-cli": "
|
|
77
|
-
"@bitblit/ratchet-node-only": "5.1.
|
|
76
|
+
"@angular/compiler-cli": "20.3.7",
|
|
77
|
+
"@bitblit/ratchet-node-only": "5.1.121"
|
|
78
78
|
}
|
|
79
79
|
}
|