Skip to content

Commit

Permalink
reorganize types and order imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vscheuber committed Aug 16, 2023
1 parent b909c6f commit d13621a
Show file tree
Hide file tree
Showing 76 changed files with 1,636 additions and 1,387 deletions.
16 changes: 14 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,23 @@
"requireConfigFile": false,
"project": "./tsconfig.json"
},
"plugins": ["prettier", "jest", "@typescript-eslint", "deprecation"],
"plugins": [
"prettier",
"jest",
"@typescript-eslint",
"deprecation",
"simple-import-sort",
"import"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"prettier/prettier": ["error"],
"deprecation/deprecation": "warn"
"deprecation/deprecation": "warn",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error"
},
"env": {
"jest": true,
Expand Down
99 changes: 80 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-deprecation": "^1.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"jest": "^29.3.1",
"jest-jasmine2": "^29.3.1",
"loglevel": "^1.8.1",
Expand Down
19 changes: 15 additions & 4 deletions src/api/AgentApi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import util from 'util';
import { generateAmApi } from './BaseApi';
import { getCurrentRealmPath } from '../utils/ForgeRockUtils';
import { deleteDeepByKey } from '../utils/JsonUtils';

import { State } from '../shared/State';
import { debugMessage } from '../utils/Console';
import { AgentSkeleton, AgentType } from './ApiTypes';
import { getCurrentRealmPath } from '../utils/ForgeRockUtils';
import { deleteDeepByKey } from '../utils/JsonUtils';
import { type IdObjectSkeletonInterface } from './ApiTypes';
import { generateAmApi } from './BaseApi';
import { type AmServiceType } from './ServiceApi';

const getAgentTypesURLTemplate =
'%s/json%s/realm-config/agents?_action=getAllTypes';
Expand All @@ -24,6 +26,15 @@ const getApiConfig = () => {
};
};

export type GatewayAgentType = 'IdentityGatewayAgent';
export type JavaAgentType = 'J2EEAgent';
export type WebAgentType = 'WebAgent';
export type AgentType = GatewayAgentType | JavaAgentType | WebAgentType;

export type AgentSkeleton = IdObjectSkeletonInterface & {
_type: AmServiceType;
};

/**
* Get agent types
* @returns {Promise} a promise that resolves to an object containing an array of agent types
Expand Down
Loading

0 comments on commit d13621a

Please sign in to comment.