@yomotech/view-toolkit 1.0.19 → 1.0.20

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": "@yomotech/view-toolkit",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^21.0.0",
6
6
  "@angular/common": "^21.0.0",
@@ -81,10 +81,12 @@ declare class UtilityService {
81
81
  authorizationBaseUrl: any;
82
82
  accessTokenEndpoint: any;
83
83
  redirectUrl: any;
84
- scope: any;
84
+ scope: string;
85
85
  responseType: any;
86
86
  pkceEnabled: any;
87
87
  };
88
+ /** OAuth scope as the space separated string the OAuth2 plugin expects. */
89
+ private oauthScope;
88
90
  setupStripePaymentForm(environment: any, form: any, onCardChange: (message: string) => void): Promise<void>;
89
91
  formData(form: any, environment: any, cartInfo: any): Promise<void>;
90
92
  normalizeDatesForStorage(obj: any): any;
@@ -510,6 +512,9 @@ declare class CardComponent {
510
512
  showButtonIcon(button: any): boolean;
511
513
  showButtonCaption(button: any): boolean;
512
514
  getScope(scope: any): string;
515
+ getMediaSource(layout: any, record: any): string;
516
+ getMediaLabel(layout: any): string;
517
+ getMediaKind(layout: any, record: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
513
518
  static ɵfac: i0.ɵɵFactoryDeclaration<CardComponent, never>;
514
519
  static ɵcmp: i0.ɵɵComponentDeclaration<CardComponent, "vl-card", never, { "itemInfo": { "alias": "itemInfo"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "mobileDisplay": { "alias": "mobileDisplay"; "required": false; }; "scrollPagination": { "alias": "scrollPagination"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "paginationMode": { "alias": "paginationMode"; "required": false; }; "paginationLoading": { "alias": "paginationLoading"; "required": false; }; }, { "cardButtonClick": "cardButtonClick"; "cardHeaderButtonClick": "cardHeaderButtonClick"; "linkDetails": "linkDetails"; "imageDetails": "imageDetails"; "onPageSizeChange": "onPageSizeChange"; "onPageChange": "onPageChange"; "cardDataChange": "cardDataChange"; }, never, never, true, never>;
515
520
  }
@@ -566,6 +571,10 @@ declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestr
566
571
  timeChangeEvent(formField: any, event: any): void;
567
572
  autocompChangeEvent(event: any, formfield: any): void;
568
573
  autocompFocusOutEvent(event: any, formfield: any): void;
574
+ private getMediaProperty;
575
+ getMediaSource(field: any): string;
576
+ getMediaLabel(field: any): string;
577
+ getMediaKind(field: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
569
578
  static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
570
579
  static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "vl-form", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "creditCardError": { "alias": "creditCardError"; "required": false; }; "form": { "alias": "form"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; }, { "formButtonClick": "formButtonClick"; "checkBoxChangeEvent": "checkBoxChangeEvent"; }, never, never, true, never>;
571
580
  }
@@ -671,6 +680,10 @@ declare class GridComponent implements AfterViewInit, OnDestroy {
671
680
  clearColumnFilter(column: any): void;
672
681
  private hasFilterValue;
673
682
  private matchesColumnFilter;
683
+ isMediaColumn(col: any): boolean;
684
+ getMediaSource(col: any, data: any): string;
685
+ getMediaLabel(col: any): string;
686
+ getMediaKind(col: any, data: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
674
687
  static ɵfac: i0.ɵɵFactoryDeclaration<GridComponent, never>;
675
688
  static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent, "vl-grid", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "environment": { "alias": "environment"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "tableitemInfo": { "alias": "tableitemInfo"; "required": false; }; "form": { "alias": "form"; "required": false; }; "isTableDataLoad": { "alias": "isTableDataLoad"; "required": false; }; "currenTableOptions": { "alias": "currenTableOptions"; "required": false; }; "projectSeleted": { "alias": "projectSeleted"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "userInfo": { "alias": "userInfo"; "required": false; }; }, { "onPageChange": "onPageChange"; "onPageSizeChange": "onPageSizeChange"; "onGridScroll": "onGridScroll"; "showGridLink": "showGridLink"; "gridButtonClick": "gridButtonClick"; "gridIncreamentClick": "gridIncreamentClick"; "gridDecreamentClick": "gridDecreamentClick"; "gridImgClick": "gridImgClick"; }, never, never, true, never>;
676
689
  }
@@ -792,6 +805,10 @@ declare class ModelComponent implements OnChanges, OnDestroy {
792
805
  invokeFormBtnClick(option: any, propertySchema: any, form: NgForm): void;
793
806
  checkValidty(form: NgForm): boolean;
794
807
  onCancel(): void;
808
+ private getMediaProperty;
809
+ getMediaSource(field: any): string;
810
+ getMediaLabel(field: any): string;
811
+ getMediaKind(field: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
795
812
  static ɵfac: i0.ɵɵFactoryDeclaration<ModelComponent, never>;
796
813
  static ɵcmp: i0.ɵɵComponentDeclaration<ModelComponent, "vl-model", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "modalItemInfo": { "alias": "modalItemInfo"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "userInfo": { "alias": "userInfo"; "required": false; }; "setFormDataHandler": { "alias": "setFormDataHandler"; "required": false; }; }, {}, never, never, true, never>;
797
814
  }
@@ -827,6 +844,61 @@ declare class PaginationComponent implements OnInit {
827
844
  static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "vl-pagination", never, { "itemInfo": { "alias": "itemInfo"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; }, { "pageSizeChange": "pageSizeChange"; "onGoToPage": "onGoToPage"; }, never, never, true, never>;
828
845
  }
829
846
 
847
+ /** What a project's login configuration has to say about its identity provider. */
848
+ interface OidcProvider {
849
+ /** e.g. https://keycloak-poc.wilken.de/realms/p5, https://integrator-1772139.okta.com/oauth2/default */
850
+ issuer: string;
851
+ clientId: string;
852
+ redirectUri: string;
853
+ /** Space separated string or array; default "openid profile email". */
854
+ scope?: string | string[];
855
+ /** Ask for offline_access (refresh token that outlives the browser session). */
856
+ offlineAccess?: boolean;
857
+ }
858
+ interface OidcTokens {
859
+ access_token: string;
860
+ refresh_token?: string;
861
+ id_token?: string;
862
+ expires_in?: number;
863
+ token_type?: string;
864
+ issuer?: string;
865
+ }
866
+ /** Result of a refresh: new tokens, 'refused' (sign in again) or null (no answer - keep the sign-in). */
867
+ type OidcRefresh = OidcTokens | 'refused' | null;
868
+ declare class MobileOidcService {
869
+ private discoveries;
870
+ /** The issuer's discovery document, fetched once per issuer. */
871
+ discover(issuer: string): Promise<any>;
872
+ /**
873
+ * Signs in through the system browser (authorization code + PKCE). With offlineAccess the scope
874
+ * gets offline_access; if the provider refuses it the login is repeated without it. After a
875
+ * logout the provider is asked for the password again (prompt=login).
876
+ */
877
+ login(provider: OidcProvider): Promise<OidcTokens | null>;
878
+ /** New tokens from the refresh token (grant_type=refresh_token, public client - no secret). */
879
+ refresh(provider: OidcProvider, stored: OidcTokens | any): Promise<OidcRefresh>;
880
+ /** The user's claims from the provider's userinfo endpoint; null when the token is refused. */
881
+ userInfo(provider: OidcProvider, accessToken: string): Promise<any | null>;
882
+ /**
883
+ * The same logout for every provider, without a browser window: the provider session is ended
884
+ * where the provider allows it from the app (Keycloak: logout endpoint with the refresh token),
885
+ * refresh and access token are revoked, the saved sign-in is removed and the app restarts. The
886
+ * next login asks for the password. When the project requires a login, the restarted app shows
887
+ * its loader until the sign-in window opens.
888
+ */
889
+ signOut(provider: OidcProvider | null, stored: OidcTokens | any, storageKey: string, removeStored: (key: string) => Promise<void>, options: {
890
+ loginRequired: boolean;
891
+ }): Promise<void>;
892
+ /** Scope as the space separated string the OAuth2 plugin expects. */
893
+ scopeOf(scope: string | string[] | undefined): string;
894
+ private withOfflineAccess;
895
+ private post;
896
+ private flag;
897
+ private setFlag;
898
+ static ɵfac: i0.ɵɵFactoryDeclaration<MobileOidcService, never>;
899
+ static ɵprov: i0.ɵɵInjectableDeclaration<MobileOidcService>;
900
+ }
901
+
830
902
  interface MobileAuthTokens {
831
903
  access_token: string;
832
904
  refresh_token?: string;
@@ -839,15 +911,12 @@ declare class MobileKeycloakService {
839
911
  private http;
840
912
  private utilityService;
841
913
  private platform;
914
+ private oidc;
842
915
  private tokens;
843
- constructor(config: ConfigService, http: HttpClient, utilityService: UtilityService, platform: Platform);
916
+ constructor(config: ConfigService, http: HttpClient, utilityService: UtilityService, platform: Platform, oidc: MobileOidcService);
917
+ /** The Keycloak realm as an OIDC provider, from login.mobile of the project. */
918
+ private provider;
844
919
  login(): Promise<any>;
845
- /** The configured scope plus offline_access, without duplicating it. */
846
- private withOfflineAccess;
847
- /**
848
- * New tokens from the refresh token (grant_type=refresh_token). Returns them in the stored token
849
- * shape, or null when Keycloak refuses - then the caller falls back to the login.
850
- */
851
920
  refreshTokens(stored: MobileAuthTokens | any): Promise<any | null>;
852
921
  getUserInfo(accessToken: any, issuer: any): Promise<any>;
853
922
  getAccessToken(): string | null;
@@ -1085,6 +1154,29 @@ declare class AppVersionResetService {
1085
1154
  static ɵprov: i0.ɵɵInjectableDeclaration<AppVersionResetService>;
1086
1155
  }
1087
1156
 
1157
+ type MobileOktaTokens = OidcTokens;
1158
+ type MobileOktaRefresh = OidcRefresh;
1159
+ declare class MobileOktaService {
1160
+ private utilityService;
1161
+ private oidc;
1162
+ constructor(utilityService: UtilityService, oidc: MobileOidcService);
1163
+ /**
1164
+ * The Okta authorization server as an OIDC provider, from login.mobile of the project. The issuer
1165
+ * is login.mobile.issuer, else login.web.issuer, else derived from the authorize URL
1166
+ * (https://…/oauth2/default/v1/authorize → https://…/oauth2/default).
1167
+ */
1168
+ provider(environment: any): OidcProvider;
1169
+ login(environment: any): Promise<MobileOktaTokens | null>;
1170
+ refreshTokens(environment: any, stored: MobileOktaTokens | any): Promise<MobileOktaRefresh>;
1171
+ /**
1172
+ * Logout with the shared flow. login.required decides where the restarted app goes: true → the
1173
+ * loader until the sign-in opens, otherwise (default for Okta) the start page, signed out.
1174
+ */
1175
+ signOut(environment: any, stored: MobileOktaTokens | any): Promise<void>;
1176
+ static ɵfac: i0.ɵɵFactoryDeclaration<MobileOktaService, never>;
1177
+ static ɵprov: i0.ɵɵInjectableDeclaration<MobileOktaService>;
1178
+ }
1179
+
1088
1180
  /** True in the native app on iOS (iPhone and iPad) and Android; false in a browser. */
1089
1181
  declare function isNativeMobile(): boolean;
1090
1182
  /**
@@ -1211,5 +1303,5 @@ declare class RemoteListService {
1211
1303
  static ɵprov: i0.ɵɵInjectableDeclaration<RemoteListService>;
1212
1304
  }
1213
1305
 
1214
- export { AppVersionResetService, CardComponent, ConfigService, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MobileKeycloakService, ModelComponent, NetworkLogService, NotificationService, PaginationComponent, PlaceholderPipe, REQUEST_STAGES, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, SIDE_DOCK_CLASS, SideMenuComponent, UtilityService, ViewToolkitModule, isNativeMobile, isNativePhone, normalizeCustomKeyboardType, resolveCustomKeyboardType, resolvePlaceholder, sideDockWidth, stagedRequest };
1215
- export type { CustomKeyboardTarget, CustomKeyboardType, MobileAuthTokens, RequestTimeoutMessages };
1306
+ export { AppVersionResetService, CardComponent, ConfigService, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, PaginationComponent, PlaceholderPipe, REQUEST_STAGES, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, SIDE_DOCK_CLASS, SideMenuComponent, UtilityService, ViewToolkitModule, isNativeMobile, isNativePhone, normalizeCustomKeyboardType, resolveCustomKeyboardType, resolvePlaceholder, sideDockWidth, stagedRequest };
1307
+ export type { CustomKeyboardTarget, CustomKeyboardType, MobileAuthTokens, MobileOktaRefresh, MobileOktaTokens, OidcProvider, OidcRefresh, OidcTokens, RequestTimeoutMessages };