2024-05-02 21:37:11 +03:00
|
|
|
///
|
|
|
|
|
/// Copyright © 2016-2024 The Thingsboard Authors
|
|
|
|
|
///
|
|
|
|
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
/// you may not use this file except in compliance with the License.
|
|
|
|
|
/// You may obtain a copy of the License at
|
|
|
|
|
///
|
|
|
|
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
///
|
|
|
|
|
/// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
/// See the License for the specific language governing permissions and
|
|
|
|
|
/// limitations under the License.
|
|
|
|
|
///
|
|
|
|
|
|
2024-05-15 17:26:36 +03:00
|
|
|
import { HasTenantId } from '@shared/models/entity.models';
|
2024-10-11 11:24:39 +03:00
|
|
|
import { BaseData } from '@shared/models/base-data';
|
|
|
|
|
import { MobileAppId } from '@shared/models/id/mobile-app-id';
|
|
|
|
|
import { OAuth2ClientInfo, PlatformType } from '@shared/models/oauth2.models';
|
|
|
|
|
import { MobileAppBundleId } from '@shared/models/id/mobile-app-bundle-id';
|
2024-05-02 21:37:11 +03:00
|
|
|
|
2024-10-11 11:24:39 +03:00
|
|
|
export interface QrCodeSettings extends HasTenantId {
|
2024-05-02 21:37:11 +03:00
|
|
|
useDefaultApp: boolean;
|
2024-10-11 11:24:39 +03:00
|
|
|
mobileAppBundleId: MobileAppBundleId
|
|
|
|
|
androidConfig: AndroidConfig; //TODO: need remove
|
|
|
|
|
iosConfig: IosConfig; //TODO: need remove
|
2024-05-02 21:37:11 +03:00
|
|
|
qrCodeConfig: QRCodeConfig;
|
2024-06-06 13:25:23 +03:00
|
|
|
defaultGooglePlayLink: string;
|
|
|
|
|
defaultAppStoreLink: string;
|
2024-10-11 11:24:39 +03:00
|
|
|
id: {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
2024-05-02 21:37:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface AndroidConfig {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
appPackage: string;
|
2024-06-05 11:25:49 +03:00
|
|
|
sha256CertFingerprints: string;
|
|
|
|
|
storeLink: string;
|
2024-05-02 21:37:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IosConfig {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
appId: string;
|
2024-06-05 11:25:49 +03:00
|
|
|
storeLink: string;
|
2024-05-02 21:37:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface QRCodeConfig {
|
|
|
|
|
showOnHomePage: boolean;
|
|
|
|
|
badgeEnabled: boolean;
|
|
|
|
|
badgePosition: BadgePosition;
|
|
|
|
|
qrCodeLabelEnabled: boolean;
|
|
|
|
|
qrCodeLabel: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileOSBadgeURL {
|
|
|
|
|
iOS: string;
|
|
|
|
|
android: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum BadgePosition {
|
|
|
|
|
RIGHT = 'RIGHT',
|
|
|
|
|
LEFT = 'LEFT'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const badgePositionTranslationsMap = new Map<BadgePosition, string>([
|
|
|
|
|
[BadgePosition.RIGHT, 'admin.mobile-app.right'],
|
|
|
|
|
[BadgePosition.LEFT, 'admin.mobile-app.left']
|
|
|
|
|
]);
|
2024-10-11 11:24:39 +03:00
|
|
|
|
|
|
|
|
export type QrCodeConfig = AndroidConfig & IosConfig;
|
|
|
|
|
|
|
|
|
|
export enum MobileAppStatus {
|
|
|
|
|
DRAFT = 'DRAFT',
|
|
|
|
|
PUBLISHED = 'PUBLISHED',
|
|
|
|
|
DEPRECATED = 'DEPRECATED',
|
|
|
|
|
SUSPENDED = 'SUSPENDED'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const mobileAppStatusTranslations = new Map<MobileAppStatus, string>(
|
|
|
|
|
[
|
|
|
|
|
[MobileAppStatus.DRAFT, 'mobile.status-type.draft'],
|
|
|
|
|
[MobileAppStatus.PUBLISHED, 'mobile.status-type.published'],
|
|
|
|
|
[MobileAppStatus.DEPRECATED, 'mobile.status-type.deprecated'],
|
|
|
|
|
[MobileAppStatus.SUSPENDED, 'mobile.status-type.suspended'],
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export interface VersionInfo {
|
|
|
|
|
minVersion: string;
|
|
|
|
|
minVersionReleaseNotes?: string;
|
|
|
|
|
latestVersion: string;
|
|
|
|
|
latestVersionReleaseNotes?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface StoreInfo {
|
|
|
|
|
sha256CertFingerprints?: string;
|
|
|
|
|
storeLink: string;
|
|
|
|
|
appId?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileApp extends BaseData<MobileAppId>, HasTenantId {
|
|
|
|
|
pkgName: string;
|
|
|
|
|
appSecret: string;
|
|
|
|
|
platformType: PlatformType;
|
|
|
|
|
status: MobileAppStatus;
|
|
|
|
|
versionInfo: VersionInfo;
|
|
|
|
|
storeInfo: StoreInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum MobileMenuPath {
|
|
|
|
|
HOME = 'HOME',
|
|
|
|
|
ASSETS = 'ASSETS',
|
|
|
|
|
DEVICES = 'DEVICES',
|
|
|
|
|
DEVICE_LIST = 'DEVICE_LIST',
|
|
|
|
|
ALARMS = 'ALARMS',
|
|
|
|
|
DASHBOARDS = 'DASHBOARDS',
|
|
|
|
|
DASHBOARD = 'DASHBOARD',
|
|
|
|
|
AUDIT_LOGS = 'AUDIT_LOGS',
|
|
|
|
|
CUSTOMERS = 'CUSTOMERS',
|
|
|
|
|
CUSTOMER = 'CUSTOMER',
|
|
|
|
|
NOTIFICATION = 'NOTIFICATION',
|
|
|
|
|
CUSTOM = 'CUSTOM'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileMenuItem {
|
|
|
|
|
label: string;
|
|
|
|
|
icon: string;
|
|
|
|
|
path: MobileMenuPath;
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileLayoutConfig {
|
|
|
|
|
items: MobileMenuItem[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileAppBundle extends Omit<BaseData<MobileAppBundleId>, 'label'>, HasTenantId {
|
|
|
|
|
title?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
androidAppId?: MobileAppId;
|
|
|
|
|
iosAppId?: MobileAppId;
|
|
|
|
|
layoutConfig?: MobileLayoutConfig;
|
|
|
|
|
oauth2Enabled: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface MobileAppBundleInfo extends MobileAppBundle {
|
|
|
|
|
androidPkgName: string;
|
|
|
|
|
iosPkgName: string;
|
|
|
|
|
oauth2ClientInfos?: Array<OAuth2ClientInfo>;
|
|
|
|
|
}
|