feat(AppConfig): iterate how apps are managed

- auth clients are always shared, cannot be disabled
- custom connections are enabled by default, can be disabled
- any existing connections can be reconnected regardless of its AppConfig or AppAuthClient states
This commit is contained in:
Ali BARIN
2024-12-09 17:46:51 +00:00
parent 17614d6d47
commit 2a77763c51
48 changed files with 192 additions and 563 deletions

View File

@@ -2,8 +2,7 @@ const createAppConfigMock = (appConfig) => {
return {
data: {
key: appConfig.key,
customConnectionAllowed: appConfig.customConnectionAllowed,
shared: appConfig.shared,
useOnlyPredefinedAuthClients: appConfig.useOnlyPredefinedAuthClients,
disabled: appConfig.disabled,
},
meta: {

View File

@@ -2,7 +2,6 @@ const createConnection = (connection) => {
const connectionData = {
id: connection.id,
key: connection.key,
reconnectable: connection.reconnectable || true,
appAuthClientId: connection.appAuthClientId,
formattedData: connection.formattedData,
verified: connection.verified || false,

View File

@@ -4,6 +4,8 @@ const getAuthMock = (auth) => {
fields: auth.fields,
authenticationSteps: auth.authenticationSteps,
reconnectionSteps: auth.reconnectionSteps,
sharedReconnectionSteps: auth.sharedReconnectionSteps,
sharedAuthenticationSteps: auth.sharedAuthenticationSteps,
},
meta: {
count: 1,

View File

@@ -2,10 +2,8 @@ const getAppConfigMock = (appConfig) => {
return {
data: {
key: appConfig.key,
customConnectionAllowed: appConfig.customConnectionAllowed,
shared: appConfig.shared,
useOnlyPredefinedAuthClients: appConfig.useOnlyPredefinedAuthClients,
disabled: appConfig.disabled,
connectionAllowed: appConfig.connectionAllowed,
createdAt: appConfig.createdAt.getTime(),
updatedAt: appConfig.updatedAt.getTime(),
},

View File

@@ -3,7 +3,6 @@ const getConnectionsMock = (connections) => {
data: connections.map((connection) => ({
id: connection.id,
key: connection.key,
reconnectable: connection.reconnectable,
verified: connection.verified,
appAuthClientId: connection.appAuthClientId,
formattedData: {

View File

@@ -3,7 +3,6 @@ const resetConnectionMock = (connection) => {
id: connection.id,
key: connection.key,
verified: connection.verified,
reconnectable: connection.reconnectable,
appAuthClientId: connection.appAuthClientId,
formattedData: {
screenName: connection.formattedData.screenName,

View File

@@ -3,7 +3,6 @@ const updateConnectionMock = (connection) => {
id: connection.id,
key: connection.key,
verified: connection.verified,
reconnectable: connection.reconnectable,
appAuthClientId: connection.appAuthClientId,
formattedData: {
screenName: connection.formattedData.screenName,

View File

@@ -3,7 +3,6 @@ const getConnectionMock = async (connection) => {
id: connection.id,
key: connection.key,
verified: connection.verified,
reconnectable: connection.reconnectable,
appAuthClientId: connection.appAuthClientId,
formattedData: {
screenName: connection.formattedData.screenName,