ichec-angular-core 0.2.0 → 0.2.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ichec-angular-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.1.1",
6
6
  "@angular/core": "^20.1.1"
@@ -11,7 +11,7 @@
11
11
  "default": "./package.json"
12
12
  },
13
13
  ".": {
14
- "types": "./index.d.ts",
14
+ "types": "./types/ichec-angular-core.d.ts",
15
15
  "default": "./fesm2022/ichec-angular-core.mjs"
16
16
  }
17
17
  },
@@ -20,5 +20,5 @@
20
20
  },
21
21
  "sideEffects": false,
22
22
  "module": "fesm2022/ichec-angular-core.mjs",
23
- "typings": "index.d.ts"
23
+ "typings": "types/ichec-angular-core.d.ts"
24
24
  }
@@ -3,7 +3,8 @@ import * as rxjs from 'rxjs';
3
3
  import { Observable, BehaviorSubject } from 'rxjs';
4
4
  import { HttpClient, HttpErrorResponse } from '@angular/common/http';
5
5
  import * as _angular_core from '@angular/core';
6
- import { InjectionToken, OnInit, WritableSignal, AfterViewInit, TemplateRef } from '@angular/core';
6
+ import { InjectionToken, OnInit, AfterViewInit, TemplateRef } from '@angular/core';
7
+ import { CookieService } from 'ngx-cookie-service';
7
8
  import * as ichec_angular_core from 'ichec-angular-core';
8
9
  import { MatSidenavContent } from '@angular/material/sidenav';
9
10
  import { Location } from '@angular/common';
@@ -278,11 +279,17 @@ interface LeftNavCategory {
278
279
  options: LeftNavOption[];
279
280
  }
280
281
 
281
- declare const ENDPOINT_URL: InjectionToken<string>;
282
+ interface RestServiceConfig {
283
+ endpoint_url: string;
284
+ auth_type: string;
285
+ allow_cross_origin: boolean;
286
+ }
287
+ declare const REST_SERVICE_CONFIG: InjectionToken<RestServiceConfig>;
282
288
  declare class RestService<D extends Identifiable, L extends Identifiable = D, C = D, U extends Identifiable = D> {
283
289
  readonly _url: string;
284
- protected _endpoint_url: string;
290
+ protected config: RestServiceConfig;
285
291
  protected _http: HttpClient;
292
+ protected cookieService: CookieService;
286
293
  deleteItem(id: number): Observable<void>;
287
294
  getForUser(user: IPortalMemberDetail, query?: IItemQuery): Observable<IPaginated<L>>;
288
295
  get(query?: IItemQuery): Observable<IPaginated<L>>;
@@ -297,8 +304,9 @@ declare class RestService<D extends Identifiable, L extends Identifiable = D, C
297
304
  putFileStandalone(url: string, file: File): Observable<void>;
298
305
  patchItem(item: U, include_keys: string[], exclude_keys: string[]): Observable<D>;
299
306
  postItem(item: C): Observable<D>;
307
+ getCsrfCookie(): string;
300
308
  private getHeaders;
301
- private getBaseUrl;
309
+ protected getBaseUrl(): string;
302
310
  private getMediaUrl;
303
311
  handleError(error: HttpErrorResponse): Observable<never>;
304
312
  }
@@ -321,12 +329,16 @@ declare class ResolvedPermission {
321
329
  }
322
330
  declare class UserService extends ItemService<IPortalMemberDetail, IPortalMemberList, IPortalMemberCreate> {
323
331
  /**
324
- Service to handle IPortalMember via REST and also handle logins.
332
+ Service to handle IPortalMember via REST and also handle logins.
325
333
  */
326
334
  loggedInUser: BehaviorSubject<IPortalMemberList | null>;
335
+ private document;
327
336
  readonly _url: string;
328
337
  typename: string;
329
338
  private permissions;
339
+ get authType(): string;
340
+ sessionLogin(next?: string): Observable<void>;
341
+ onSessionLoginError(error: HttpErrorResponse, next: string): Observable<void>;
330
342
  login(username: string, password: string): Observable<void>;
331
343
  hasAddPermission(feature: string): boolean;
332
344
  hasDeletePermission(feature: string): boolean;
@@ -458,7 +470,7 @@ interface LoginUser {
458
470
  declare const LOGIN_USER: InjectionToken<LoginUser>;
459
471
  declare class LandingComponent implements OnInit {
460
472
  loginUser: LoginUser;
461
- loginError: WritableSignal<string>;
473
+ loginError: _angular_core.WritableSignal<string>;
462
474
  message: _angular_core.InputSignal<string | undefined>;
463
475
  private userService;
464
476
  private router;
@@ -955,5 +967,5 @@ declare class OrganizationEditComponent extends EditView<IOrganizationDetail, IO
955
967
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<OrganizationEditComponent, "lib-organization-edit", never, {}, {}, never, never, true, never>;
956
968
  }
957
969
 
958
- export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, ENDPOINT_URL, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FieldType, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldValueForm, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MemberSelectionManager, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PopulatedFormComponent, PopulatedFormForm, PortalMember, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService, getFieldTypeFromKey };
959
- export type { IAddressBase, IAddressCreate, IAddressDetail, IAddressForm, IAddressList, ICountry, IDynamicFormForm, IFieldFile, IFileRecord, IForm, IFormCreate, IFormDetail, IFormFieldBase, IFormFieldCreate, IFormFieldDetail, IFormFieldValueBase, IFormFieldValueCreate, IFormFieldValueDetail, IFormFieldValueForm, IFormFieldValueUpdate, IFormGroupBase, IFormGroupCreate, IFormGroupDetail, IFormGroupUpdate, IFormUpdate, IGroupBase, IGroupCreate, IGroupDetail, IGroupList, IItemQuery, IMemberIdentifierBase, IMemberIdentifierCreate, IMemberIdentifierDetail, IOrganizationBase, IOrganizationCreate, IOrganizationDetail, IOrganizationList, IPaginated, IPermission, IPopulatedFormCreate, IPopulatedFormDetail, IPopulatedFormForm, IPopulatedFormUpdate, IPortalMemberBase, IPortalMemberCreate, IPortalMemberDetail, IPortalMemberList, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice, Selectable, TableColumn, TypeChoice };
970
+ export { Address, AddressDetailComponent, AddressEditComponent, AddressForm, AddressService, ApiError, AvatarComponent, BackButtonComponent, DetailHeaderComponent, DetailView, DynamicFormBuilderComponent, DynamicFormComponent, DynamicFormForm, EditView, ErrorCode, FORM_FIELD_CHOICES, FeedbackComponent, FieldType, FileRecord, FileUploadComponent, FormFieldDetailComponent, FormFieldEditComponent, FormFieldValueForm, FormService, Group, GroupComponent, GroupDetailComponent, GroupService, ItemQuery, ItemService, ItemWithUserService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListTableViewComponent, ListViewComponent, MemberSelectionManager, MockItemService, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, Paginated, Permission, PopulatedFormComponent, PopulatedFormForm, PortalMember, REST_SERVICE_CONFIG, ResolvedPermission, RestService, SearchBarComponent, SelectTableComponent, SelectionManager, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService, getFieldTypeFromKey };
971
+ export type { IAddressBase, IAddressCreate, IAddressDetail, IAddressForm, IAddressList, ICountry, IDynamicFormForm, IFieldFile, IFileRecord, IForm, IFormCreate, IFormDetail, IFormFieldBase, IFormFieldCreate, IFormFieldDetail, IFormFieldValueBase, IFormFieldValueCreate, IFormFieldValueDetail, IFormFieldValueForm, IFormFieldValueUpdate, IFormGroupBase, IFormGroupCreate, IFormGroupDetail, IFormGroupUpdate, IFormUpdate, IGroupBase, IGroupCreate, IGroupDetail, IGroupList, IItemQuery, IMemberIdentifierBase, IMemberIdentifierCreate, IMemberIdentifierDetail, IOrganizationBase, IOrganizationCreate, IOrganizationDetail, IOrganizationList, IPaginated, IPermission, IPopulatedFormCreate, IPopulatedFormDetail, IPopulatedFormForm, IPopulatedFormUpdate, IPortalMemberBase, IPortalMemberCreate, IPortalMemberDetail, IPortalMemberList, IRestOptions, Identifiable, LeftNavCategory, LeftNavOption, NavGroup, NavOption, OptionAction, OptionActionChoice, RestServiceConfig, Selectable, TableColumn, TypeChoice };