210 lines
5.4 KiB
TypeScript
210 lines
5.4 KiB
TypeScript
import {
|
|
DefaultLocale,
|
|
AppResourceIDs,
|
|
AvailableTranslationResources,
|
|
} from './localization.config';
|
|
import {
|
|
RegistrationStep,
|
|
XFrameworkIdentitySDKConfig,
|
|
} from 'x-framework-identity-sdk';
|
|
import { Pages } from './page.config';
|
|
import { LogLevel } from '@microsoft/signalr';
|
|
import { NotificationAudioSources } from './audio.config';
|
|
import { XSaherElmApiSDKConfig } from 'x-saherelm-api-sdk';
|
|
import { XFrameworkCoreConfig, XPage } from 'x-framework-core';
|
|
import { XFrameworkServicesConfig } from 'x-framework-services';
|
|
import { XFrameworkComponentsConfig } from 'x-framework-components';
|
|
import { XFrameworkPushServiceConfig } from 'x-framework-push-service';
|
|
|
|
// tslint:disable-next-line:no-empty-interface
|
|
export interface AppConfig {
|
|
//
|
|
defaultLandingPage?: XPage;
|
|
defaultBlogPage?: XPage;
|
|
forceLogin: boolean;
|
|
|
|
//
|
|
refreshTokensDelay?: number;
|
|
|
|
//
|
|
// Content Configurations ...
|
|
seeMoreResourceId: string;
|
|
}
|
|
|
|
export type XFrameworkCoreSharedConfig = Partial<XFrameworkCoreConfig>;
|
|
export type XFrameworkServicesSharedConfig = Partial<XFrameworkServicesConfig>;
|
|
export type XFrameworkComponentsSharedConfig =
|
|
Partial<XFrameworkComponentsConfig>;
|
|
export type XFrameworkIdentitySDKSharedConfig =
|
|
Partial<XFrameworkIdentitySDKConfig>;
|
|
export type XFrameworkPushServiceSharedConfig =
|
|
Partial<XFrameworkPushServiceConfig>;
|
|
export type XSaherElmApiSDKSharedConfig = Partial<XSaherElmApiSDKConfig>;
|
|
export type XAppSharedConfig = Partial<AppConfig>;
|
|
|
|
export type XConfig = XFrameworkCoreConfig &
|
|
XFrameworkServicesConfig &
|
|
XFrameworkComponentsConfig &
|
|
XFrameworkIdentitySDKConfig &
|
|
XFrameworkPushServiceConfig &
|
|
XSaherElmApiSDKConfig &
|
|
AppConfig;
|
|
export type XSharedConfig = Partial<XConfig>;
|
|
|
|
export const xFrameworkCoreSharedConfig: XFrameworkCoreSharedConfig = {
|
|
appInstanceName: 'xMabsutClient',
|
|
appNameResource: 'app_name',
|
|
appCompanyResource: 'company',
|
|
appVersion: 'v1.1',
|
|
defaultNotificationDelay: 2000,
|
|
notificationAudioSources: NotificationAudioSources,
|
|
availableLanguages: AvailableTranslationResources,
|
|
defaultLanguage: DefaultLocale,
|
|
minAllowedImageSize: 512,
|
|
maxAllowedImageSize: 5242880,
|
|
minAllowedImageCroppableSize: 512,
|
|
allowedImageExtensions: ['.png', '.jpg', '.jpeg'],
|
|
maxProfileImageSize: 5242880,
|
|
maxProfileImagesUploadFiles: 10,
|
|
defaultCountryCode: 'IR',
|
|
defaultPageSize: 5,
|
|
pageSizes: [5, 10, 20, 40, 50, 100, 200],
|
|
defaultActionDelay: 500,
|
|
poweredValue: 'SaherElmITCenter',
|
|
secretKey: 'SaherElm@09121694056@Hadi_Khazaee_Asl@yahoo.com',
|
|
};
|
|
|
|
export const xFrameworkServicesSharedConfig: XFrameworkServicesSharedConfig = {
|
|
geoLocationConfig: {
|
|
enableHighAccuracy: true,
|
|
timeout: 5000,
|
|
},
|
|
};
|
|
|
|
export const xFrameworkComponentsSharedConfig: XFrameworkComponentsSharedConfig =
|
|
{
|
|
minAllowedFileSize: 512,
|
|
maxAllowedFileSize: 20971520,
|
|
maxAllowedSize: 966367641,
|
|
maxUploadFiles: 10,
|
|
defaultSearchDebounceTime: 500,
|
|
};
|
|
|
|
export const xFrameworkIdentitySDKSharedConfig: XFrameworkIdentitySDKSharedConfig =
|
|
{
|
|
//
|
|
// Pages,
|
|
Pages,
|
|
|
|
//
|
|
minAvailableDateConst: 100 * 365 * 24 * 60 * 60 * 1000,
|
|
maxAvailableDateConst: 18 * 365 * 24 * 60 * 60 * 1000,
|
|
|
|
//
|
|
// Registration Type ...
|
|
registrationType: [
|
|
RegistrationStep.Terms,
|
|
RegistrationStep.Info,
|
|
RegistrationStep.Avatar,
|
|
RegistrationStep.EmailConfirmation,
|
|
RegistrationStep.Finish,
|
|
],
|
|
|
|
//
|
|
debounceTime: 500,
|
|
|
|
//
|
|
nameMinLength: 3,
|
|
nameMaxLength: 20,
|
|
|
|
//
|
|
registrationOnlyWithInvitation: false,
|
|
|
|
//
|
|
userNameMinLength: 4,
|
|
userNameMaxLength: 20,
|
|
|
|
//
|
|
passwordPolicies: {
|
|
requireDigit: true,
|
|
requiredLength: 6,
|
|
requiredUniqueChars: 1,
|
|
requireLowercase: true,
|
|
requireNonAlphanumeric: true,
|
|
requireUppercase: true,
|
|
},
|
|
|
|
//
|
|
passwordMinLength: 6,
|
|
passwordMaxLength: 20,
|
|
|
|
//
|
|
verificationCodeLength: 6,
|
|
delayBetweenTwoVerificationCode: 180,
|
|
};
|
|
|
|
export const xFrameworkPushServiceSharedConfig: XFrameworkPushServiceSharedConfig =
|
|
{
|
|
//
|
|
// Push Notifications ...
|
|
hubsBaseRoute: 'hubs',
|
|
pushConnectionMaxRetry: 10,
|
|
addSupportMessageProtocol: false,
|
|
connectionLogLevel: LogLevel.None,
|
|
pushConnectionReconnectDelay: 30000,
|
|
|
|
//
|
|
// Stun Servers ...
|
|
iceServers: [
|
|
{
|
|
urls: [
|
|
'stun:stun.l.google.com:19302',
|
|
'stun:stun1.l.google.com:19302',
|
|
'stun:stun2.l.google.com:19302',
|
|
],
|
|
},
|
|
{
|
|
urls: ['turn:turn.saherelmhub.ir:3478'],
|
|
username: 'saherelm',
|
|
credential: 's@H@1694056',
|
|
},
|
|
],
|
|
};
|
|
|
|
export const xMabsutApiSDKSharedConfig: XSaherElmApiSDKSharedConfig = {
|
|
//
|
|
// Configure API ...
|
|
apiIdentifier: 'api',
|
|
apiVersion: 'v1.0',
|
|
|
|
//
|
|
// Push Notifications ...
|
|
pushManagerReconnectDelay: 20000,
|
|
pushServiceRoute: 'push',
|
|
pushMessageAction: 'PushMessageAsync',
|
|
};
|
|
|
|
export const xAppSharedConfig: XAppSharedConfig = {
|
|
//
|
|
defaultLandingPage: Pages.Landing,
|
|
forceLogin: false,
|
|
|
|
//
|
|
// Refresh Tokens in MilliSeconds ...
|
|
refreshTokensDelay: 1 * 15 * 1000,
|
|
|
|
//
|
|
// Contents Configurations ...
|
|
seeMoreResourceId: AppResourceIDs.see_more,
|
|
};
|
|
|
|
export const xSharedConfig: XSharedConfig = {
|
|
...xFrameworkCoreSharedConfig,
|
|
...xFrameworkServicesSharedConfig,
|
|
...xFrameworkComponentsSharedConfig,
|
|
...xFrameworkIdentitySDKSharedConfig,
|
|
...xFrameworkPushServiceSharedConfig,
|
|
...xMabsutApiSDKSharedConfig,
|
|
...xAppSharedConfig,
|
|
};
|