pro server: Enterprise edition lite

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5219
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Nithin <36623418+nithindv@users.noreply.github.com>
GitOrigin-RevId: b5c33ea5653a6e107a14d106082cf4301481fc40
This commit is contained in:
Karthikeyan Chinnakonda 2022-08-17 00:19:30 +05:30 committed by hasura-bot
parent bb1020bd47
commit 05d2f05b36
5 changed files with 33 additions and 4 deletions

View File

@ -4,7 +4,7 @@ import { getFeaturesCompatibility } from './helpers/versionUtils';
import { stripTrailingSlash } from './components/Common/utils/urlUtils'; import { stripTrailingSlash } from './components/Common/utils/urlUtils';
import { isEmpty } from './components/Common/utils/jsUtils'; import { isEmpty } from './components/Common/utils/jsUtils';
type ConsoleType = 'oss' | 'cloud' | 'pro'; type ConsoleType = 'oss' | 'cloud' | 'pro' | 'pro-lite';
type UUID = string; type UUID = string;
@ -32,6 +32,18 @@ type ProServerEnv = {
urlPrefix: string; urlPrefix: string;
}; };
type ProLiteServerEnv = {
consoleType: 'pro-lite';
consoleId: string;
consoleMode: 'server';
assetsPath: string;
consolePath: string;
enableTelemetry: boolean;
isAdminSecretSet: boolean;
serverVersion: string;
urlPrefix: string;
};
type CloudUserRole = 'owner' | 'user'; type CloudUserRole = 'owner' | 'user';
type CloudServerEnv = { type CloudServerEnv = {
@ -91,6 +103,7 @@ export type CloudCliEnv = {
}; };
type ProCliEnv = CloudCliEnv; type ProCliEnv = CloudCliEnv;
type ProLiteCliEnv = CloudCliEnv;
export type EnvVars = { export type EnvVars = {
nodeEnv?: string; nodeEnv?: string;
@ -114,9 +127,11 @@ export type EnvVars = {
| OSSServerEnv | OSSServerEnv
| CloudServerEnv | CloudServerEnv
| ProServerEnv | ProServerEnv
| ProLiteServerEnv
| OSSCliEnv | OSSCliEnv
| CloudCliEnv | CloudCliEnv
| ProCliEnv | ProCliEnv
| ProLiteCliEnv
); );
declare global { declare global {

View File

@ -1,4 +1,4 @@
export type AllowedConsoleTypes = 'oss' | 'pro' | 'cloud'; export type AllowedConsoleTypes = 'oss' | 'pro' | 'cloud' | 'pro-lite';
export type AllowedConsoleModes = 'cli' | 'server'; export type AllowedConsoleModes = 'cli' | 'server';
export type Privileges = string[]; export type Privileges = string[];

View File

@ -746,7 +746,9 @@ export const supportedFeatures: DeepRequired<SupportedFeaturesType> = {
connection_lifetime: true, connection_lifetime: true,
namingConvention: true, namingConvention: true,
ssl_certificates: ssl_certificates:
globals.consoleType === 'cloud' || globals.consoleType === 'pro', globals.consoleType === 'cloud' ||
globals.consoleType === 'pro' ||
globals.consoleType === 'pro-lite',
}, },
}; };

View File

@ -32,6 +32,16 @@ describe('isProConsole', () => {
}); });
}); });
describe('when consoleMode is server and consoleType is pro-lite', () => {
it('returns true', () => {
const env: ProConsoleEnv = {
consoleMode: 'server',
consoleType: 'pro-lite',
};
expect(isProConsole(env)).toBe(true);
});
});
describe('when consoleMode is server and consoleType is oss', () => { describe('when consoleMode is server and consoleType is oss', () => {
it('returns false', () => { it('returns false', () => {
const env: ProConsoleEnv = { const env: ProConsoleEnv = {

View File

@ -9,7 +9,9 @@ export type ProConsoleEnv = {
export const isProConsole = (env: ProConsoleEnv) => { export const isProConsole = (env: ProConsoleEnv) => {
if ( if (
env.consoleMode === 'server' && env.consoleMode === 'server' &&
(env.consoleType === 'cloud' || env.consoleType === 'pro') (env.consoleType === 'cloud' ||
env.consoleType === 'pro' ||
env.consoleType === 'pro-lite')
) { ) {
return true; return true;
} }